public
Description: Git mirror of the CMS Made Simple 2.0 rewrite
Homepage: http://cmsmadesimple.org
Clone URL: git://github.com/tedkulp/cmsmadesimple-2-0.git
Search Repo:
calguy1000 (author)
Sat Apr 26 08:47:59 -0700 2008
commit  68e9e77b6bdc9b3db937026d3f89f71b71d5fac8
tree    a9f3f2c9017b2074395d45d8ffdfc47a443e58f2
parent  59759ed1d0a83fcdc9300b67c3c8a0784dbc5a1c
cmsmadesimple-2-0 / command.php
100644 50 lines (38 sloc) 1.12 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
<?php
@ob_end_clean();
error_reporting(E_ALL);
set_time_limit(0);
 
require_once "lib/pear/php_shell/Shell.php";
require_once 'lib/cmsms.api.php';
require_once 'include.php';
    
$__shell = new PHP_Shell();
 
$f = <<<EOF
PHP-Barebone-Shell - Version %s%s
(c) 2006, Jan Kneschke <jan@kneschke.de>
 
>> use '?' to open the inline help
 
EOF;
 
printf($f,
    $__shell->getVersion(),
    $__shell->hasReadline() ? ', with readline() support' : '');
unset($f);
 
while($__shell->input()) {
    try {
        if ($__shell->parse() == 0) {
            ## we have a full command, execute it
 
//  echo $__shell->getCode();
            $__shell_retval = eval($__shell->getCode());
            if (isset($__shell_retval)) {
                echo($__shell_retval);
            }
            ## cleanup the variable namespace
            unset($__shell_retval);
            $__shell->resetCode();
        }
    } catch(Exception $__shell_exception) {
        print $__shell_exception->getTraceAsString();
        
        $__shell->resetCode();
 
        ## cleanup the variable namespace
        unset($__shell_exception);
    }
}
 
?>