module() . '/functions.php'; if (file_exists($funcFile)) { require $funcFile; } $sessionConfig = Register::get('Config')->get('session'); if (!empty($sessionConfig) && $sessionConfig['open'] === true) { session_save_path(SESSION_PATH); session_start(); } // 数据库驱动 $config = Register::get('Config')->get('db'); $driver = $config['driver'] ? $config['driver'] : 'MySQLi'; Register::set('DBDriver', function () use ($driver) { $class = '\\top\\library\\database\\driver\\' . $driver; return $class::instance(); }); // 视图文件缓存 Register::set('FileCache', function () { return File::instance(); }); // 配置文件中配置的注册 $initRegister = Register::get('Config')->get('register'); if (!empty($initRegister)) { foreach ($initRegister as $key => $value) { Register::set($key, function () use ($value) { return $value::instance(); }); } } // 注册视图 Register::set('View', function () { return View::instance(); }); return true; } /** * @param array $data */ public function after($data) { } }