public static function start() { //--------设置时区--------// date_default_timezone_set("PRC"); //--------设置错误级别, 记录程序开始时间及内存--------// if (DEBUG) { ini_set('display_errors', 'On'); error_reporting(E_ALL ^ E_NOTICE); self::$_startTime = microtime(true); self::$_memoryStart = memory_get_usage(true); } //--------自动注册类--------// spl_autoload_register(array('OneFox\\Onefox', 'autoload')); //--------运行结束执行--------// register_shutdown_function(array('OneFox\\Onefox', 'end')); //--------自定义错误处理--------// set_error_handler(array('OneFox\\Onefox', 'errorHandler')); //--------处理未捕捉的异常--------// set_exception_handler(array('OneFox\\Onefox', 'exceptionHandler')); //--------引入composer机制--------// if (is_dir(VENDOR_PATH) && is_file(VENDOR_PATH . DS . 'autoload.php')) { require VENDOR_PATH . DS . 'autoload.php'; } if (!IS_CLI) { //--------处理请求数据--------// Request::deal(); //--------简单路由--------// Dispatcher::dipatcher(); //--------执行--------// self::_exec(); } return; }