/** * 命令行模式运行php * 1. 例如:/usr/lib/php /usr/local/web/www/index.php index test sq * 2. index 控制器名称 test Action名称 sql controller/文件夹下的文件名称 * 3. 全局使用方法:InitPHP::cli_init(); * @return object */ public static function cli_init($argv) { self::isDebug(); try { $InitPHP_conf = InitPHP::getConfig(); $argv[1] = $argv[1] == '' ? '' : trim($argv[1]) . $InitPHP_conf['controller']['controller_postfix']; $argv[2] = $argv[2] == '' ? '' : trim($argv[2]) . $InitPHP_conf['controller']['action_postfix']; $argv[3] = $argv[3] == '' ? '' : trim($argv[3]); InitPHP::getController($argv[1], $argv[2], $params = array(), $argv[3]); } catch (exceptionInit $e) { exceptionInit::cliErrorTpl($e); } catch (Exception $e) { exceptionInit::cliErrorTpl($e); } }
public function handleException($exception) { restore_exception_handler(); exceptionInit::errorTpl($exception); }