示例#1
0
文件: Tool.php 项目: kevinwan/xf
 public function makeConfig()
 {
     $this->make(APPLICATION_PATH . '/controllers/');
     $dirs = XF_File::getFolder(APPLICATION_PATH . '/modules/');
     if (is_array($dirs)) {
         foreach ($dirs as $dir) {
             $this->make(APPLICATION_PATH . '/modules/' . $dir . '/controllers/');
         }
     }
     if (!is_array($this->_map)) {
         return;
     }
     $phpCode = '';
     foreach ($this->_map as $k => $ms) {
         $str = '';
         foreach ($ms as $m) {
             if ($str == '') {
                 $str .= "'{$m}:'";
             } else {
                 $str .= ",\n\t'{$m}:'";
             }
         }
         $phpCode .= "'{$k}:' => array(\n\t{$str}\n),\n";
     }
     echo $phpCode;
 }