Exemplo n.º 1
0
 protected function init()
 {
     $this->path = DATA_PATH . 'mutex/';
     if (!is_dir($this->path)) {
         FileHelper::makeDir($this->path);
     }
 }
Exemplo n.º 2
0
 /**
  * 获取控制器列表
  */
 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;
 }