/** * 初始化应用配置 * * @param string $module */ protected function preheatApp($module) { $_SERVER['REQUEST_URI'] = '/' . $module; $app = new App(); $bootFile = Common::concatPath(App::app()->getAppDirectory(), 'Bootstrap.php'); if (file_exists($bootFile)) { $app->bootstrap(); } }
/** * 获取当前类所在的文件路径 * * @return string */ public function getClassPath() { $task = empty($this->taskName) ? self::DEFAULT_TASK : $this->taskName; return Common::concatPath(APP_PATH, 'app', $this->moduleName, 'task', $task . '.php'); }