protected function init() { $this->path = DATA_PATH . 'mutex/'; if (!is_dir($this->path)) { FileHelper::makeDir($this->path); } }
/** * 获取控制器列表 */ protected function getControllers() { $controllers = array(); $paths = App::getControllerPaths(); foreach ($paths as $ns => $nsPaths) { foreach ($nsPaths as $path) { $files = FileHelper::scanDir($path); foreach ($files as $file) { if (substr_compare($file, 'Controller.php', -14, 14) !== 0) { continue; } $file = substr($file, strlen($path), -4); $controllers[] = $ns . strtr($file, '/', '\\'); } } } return $controllers; }