示例#1
0
文件: Manager.php 项目: vgrish/dvelum
 /**
  * Get list of dictionaries
  * return array
  */
 public function getList()
 {
     if (!is_null(self::$_list)) {
         return array_keys(self::$_list);
     }
     $files = File::scanFiles($this->_path, array('.php'), false, File::Files_Only);
     $list = array();
     if (!empty($files)) {
         foreach ($files as $path) {
             $name = substr(basename($path), 0, -4);
             $list[$name] = $path;
         }
     }
     $external = Dictionary::getExternal();
     if (!empty($external)) {
         $list = array_merge($list, $external);
     }
     self::$_list = $list;
     if ($this->_cache) {
         $this->_cache->save($list, self::CACHE_KEY_LIST);
     }
     return array_keys($list);
 }