public function __construct($config = ['/config.php']) { if (!defined('WEB_ROOT')) { if (isset($_SERVER['DOCUMENT_ROOT']) && $_SERVER['DOCUMENT_ROOT'] != '') { define('WEB_ROOT', $_SERVER['DOCUMENT_ROOT']); } else { die('"WEB_ROOT" is not define.'); } } Config::load_config($config); if (!defined('DEBUG')) { define('DEBUG', Minifw\Config::get('debug', 'debug', 0)); } if (!defined('DBPREFIX')) { define('DBPREFIX', Minifw\Config::get('main', 'dbprefix', '')); } date_default_timezone_set(Minifw\Config::get('main', 'timezone', 'UTC')); //设置错误处理函数 set_error_handler([__NAMESPACE__ . '\\Error', 'captureNormal']); //设置异常处理函数 set_exception_handler([__NAMESPACE__ . '\\Error', 'captureException']); //设置停机处理函数 register_shutdown_function([__NAMESPACE__ . '\\Error', 'captureShutdown']); }