-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathwiff
More file actions
executable file
·70 lines (63 loc) · 1.38 KB
/
wiff
File metadata and controls
executable file
·70 lines (63 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/usr/bin/env php
<?php
/**
* Web Installer for Freedom
* Command Line Interface
* @author Anakeen
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License
*/
$mypath = array_shift($argv);
$wiff_root = getenv('WIFF_ROOT');
if( $wiff_root === false ) {
if( is_link($mypath) ) {
$mypath = readlink($mypath);
}
$realpath = realpath($mypath);
$wiff_root = dirname($realpath);
}
set_include_path(get_include_path().PATH_SEPARATOR."$wiff_root".DIRECTORY_SEPARATOR.'include');
putenv('WIFF_ROOT='.$wiff_root);
require('lib/Lib.Cli.php');
$ret = setuid_wiff($_SERVER['SCRIPT_FILENAME']);
if( $ret === false ) {
exit( 1 );
}
$ret = 0;
switch( $argv[0] ) {
case 'context':
$cmd = array_shift($argv);
$ret = wiff_context($argv);
break;
case 'help':
$ret = wiff_help($argv);
break;
case 'list':
$cmd = array_shift($argv);
$ret = wiff_list($argv);
break;
case 'whattext':
$cmd = array_shift($argv);
$ret = wiff_whattext($argv);
break;
case 'wstart':
$cmd = array_shift($argv);
$ret = wiff_wstart($argv);
break;
case 'wstop':
$cmd = array_shift($argv);
$ret = wiff_wstop($argv);
break;
case 'mkrepoidx':
$cmd = array_shift($argv);
$ret = wiff_mkrepoidx($argv);
break;
case 'delete':
$cmd = array_shift($argv);
$ret = wiff_delete($argv);
break;
default:
$ret = wiff_default($argv);
break;
}
exit( $ret );
?>