/** * 创建 Application 系统中的核心对象 * 如果没有 Application 单件对像,则将传入的 Application对像做为 Application 的全局单件 */ public function buildApplication(Application $aApp, $sApplicationRootPath) { $aOriApp = Application::switchSingleton($aApp); // filesystem Folder::setSingleton(new Folder($sApplicationRootPath)); // 初始化 class loader ClassLoader::setSingleton($this->createClassLoader($aApp)); // AccessRouter AccessRouter::setSingleton($this->createAccessRouter($aApp)); // Request Request::setSingleton($this->createRequest($aApp)); // setting Setting::setSingleton($this->createSetting($aApp)); if ($aOriApp) { Application::setSingleton($aOriApp); } }
public function isDebugging() { if ($this->bDebugging === null) { $this->bDebugging = (bool) Setting::singleton()->item('/service/debug', 'stat'); } return $this->bDebugging; }