Ejemplo n.º 1
0
    }
    throw new Exception(sprintf("%s:%d\r\n%s", $errfile, $errline, $errstr));
}
set_error_handler("__shell_default_error_handler");
$__shell = new PHP_Shell();
$f = <<<EOF
>> use '?' to open the inline help 
EOF;
printf($f, $__shell->getVersion(), $__shell->hasReadline() ? ', with readline() support' : '');
unset($f);
print $__shell->getColour("default");
while ($__shell->input()) {
    try {
        if ($__shell->parse() == 0) {
            ## we have a full command, execute it
            if ($__shell->isAutoloadEnabled() && !function_exists('__autoload')) {
                /**
                 * default autoloader
                 *
                 * If a class doesn't exist try to load it by guessing the filename
                 * class PHP_Shell should be located in PHP/Shell.php.
                 *
                 * you can set your own autoloader by defining __autoload() before including
                 * this file
                 * 
                 * @param string $classname name of the class
                 */
                function __autoload($classname)
                {
                    include str_replace('_', '/', $classname) . '.php';
                }