--2452:tools/class.php:-- toString()); } return $buf; } // }}} // {{{ internal void __except(Exception e) // Exception handler function __except($e) { fputs(STDERR, 'Uncaught exception: '.xp::stringOf($e)); } // }}} // Verify SAPI if ('cgi' === PHP_SAPI || 'cgi-fcgi' === PHP_SAPI) { ini_set('html_errors', 0); define('STDIN', fopen('php://stdin', 'rb')); define('STDOUT', fopen('php://stdout', 'wb')); define('STDERR', fopen('php://stderr', 'wb')); } else if ('cli' !== PHP_SAPI) { trigger_error('[bootstrap] Cannot be run under '.PHP_SAPI.' SAPI', E_USER_ERROR); exit(0x3d); } $home= getenv('HOME'); list($use, $include)= explode(PATH_SEPARATOR.PATH_SEPARATOR, get_include_path()); set_include_path( scanpath(explode(PATH_SEPARATOR, $use), $home). $include ); if (!include('lang.base.php')) { trigger_error('[bootstrap] Cannot determine boot class path', E_USER_ERROR); exit(0x3d); } uses('util.cmd.ParamString', 'util.cmd.Console'); ini_set('error_prepend_string', EPREPEND_IDENTIFIER); set_exception_handler('__except'); ob_start('__output'); array_shift($_SERVER['argv']); exit(XPClass::forName($argv[1])->getMethod('main')->invoke(NULL, array(array_slice($argv, 2)))); ?> --2649:tools/xar.php:-- toString()); } return $buf; } // }}} // {{{ internal void __except(Exception e) // Exception handler function __except($e) { fputs(STDERR, 'Uncaught exception: '.xp::stringOf($e)); } // }}} // Verify SAPI if ('cgi' === PHP_SAPI || 'cgi-fcgi' === PHP_SAPI) { ini_set('html_errors', 0); define('STDIN', fopen('php://stdin', 'rb')); define('STDOUT', fopen('php://stdout', 'wb')); define('STDERR', fopen('php://stderr', 'wb')); } else if ('cli' !== PHP_SAPI) { trigger_error('[bootstrap] Cannot be run under '.PHP_SAPI.' SAPI', E_USER_ERROR); exit(0x3d); } $home= getenv('HOME'); list($use, $include)= explode(PATH_SEPARATOR.PATH_SEPARATOR, get_include_path()); set_include_path( scanpath(explode(PATH_SEPARATOR, $use), $home). $include ); if (!include('lang.base.php')) { trigger_error('[bootstrap] Cannot determine boot class path', E_USER_ERROR); exit(0x3d); } uses('util.cmd.ParamString', 'util.cmd.Console', 'util.Properties'); ini_set('error_prepend_string', EPREPEND_IDENTIFIER); set_exception_handler('__except'); ob_start('__output'); $cl= ClassLoader::registerLoader(new ArchiveClassLoader($argv[1])); $pr= Properties::fromString($cl->getResource('META-INF/manifest.ini')); array_shift($_SERVER['argv']); exit(XPClass::forName($pr->readString('archive', 'main-class'), $cl)->getMethod('main')->invoke(NULL, array(array_slice($argv, 2)))); ?> --1780:tools/web.php:-- $value) { if (0 !== strncmp('HTTP_', $name, 5)) continue; $headers[strtr(ucwords(strtolower(strtr(substr($name, 5), '_', ' '))), ' ', '-')]= $value; } return $headers; } } $webroot= getenv('DOCUMENT_ROOT').'/..'; $paths= array(); foreach (explode(PATH_SEPARATOR, get_include_path()) as $path) { $paths[]= ('~' == $path{0} ? str_replace('~', $webroot, $path) : $path ); } set_include_path(rtrim(scanpath($paths, $webroot), PATH_SEPARATOR)); // Bootstrap if (!include('lang.base.php')) { trigger_error('[bootstrap] Cannot determine boot class path', E_USER_ERROR); exit(0x3d); } uses('xp.scriptlet.Runner'); exit(xp·scriptlet·Runner::main(array($webroot))); ?>