diff --git a/library/think/loader.php b/library/think/loader.php index 34a0608f..f69c08dd 100644 --- a/library/think/loader.php +++ b/library/think/loader.php @@ -75,8 +75,10 @@ class Loader // 注册自动加载机制 public static function register($autoload = '') { + // 注册系统自动加载 + spl_autoload_register($autoload ? $autoload : 'think\\loader::autoload'); + // 注册composer自动加载 self::registerComposerLoader(); - spl_autoload_register($autoload ? $autoload : ['think\\loader', 'autoload']); } // 注册composer自动加载 diff --git a/start.php b/start.php index 90135a8c..a4570cb0 100644 --- a/start.php +++ b/start.php @@ -20,9 +20,9 @@ require CORE_PATH . 'loader.php'; Loader::register(); // 注册错误和异常处理机制 -register_shutdown_function(['think\Error', 'appShutdown']); -set_error_handler(['think\Error', 'appError']); -set_exception_handler(['think\Error', 'appException']); +register_shutdown_function('think\Error::appShutdown'); +set_error_handler('think\Error::appError'); +set_exception_handler('think\Error::appException'); // 加载模式定义文件 $mode = require MODE_PATH . APP_MODE . EXT;