/** * 自动加载注册方法。 * * @access public * @param 自动加载对象的目录 * @return void */ public static function register($config) { self::$config = $config; try { // 注册自动加载的回调函数 if (!spl_autoload_register(array(new self(), '__autoload'))) { throw new Exception('Register autoloader function is failed.'); } } catch (Exception $e) { Logger::error($e->getMessage()); } }