コード例 #1
0
ファイル: Treeview.php プロジェクト: bombush/NatsuCon
 /**
  * Get dir structure
  *
  * @param string $dir Dir path
  *
  * @return array
  */
 private function getDirTree($dir)
 {
     $x = array();
     $dirs = Finder::findDirectories("*")->in($dir);
     foreach ($dirs as $dir) {
         $x[$dir->getFilename()] = $this->getDirTree($dir->getPathName());
     }
     return $x;
 }
コード例 #2
0
ファイル: Caching.php プロジェクト: bombush/NatsuCon
 /**
  * Delete items from cache with recursion
  *
  * @param string $absDir Absolute directory path
  */
 public function deleteItemsRecursive($absDir)
 {
     $dirs = Finder::findDirectories("*")->from($absDir);
     $cache = $this->cache;
     foreach ($dirs as $dir) {
         unset($cache[array("content", $dir->getRealPath())]);
     }
     unset($cache[array("content", $absDir)]);
     $this->deleteItem(null, array("tags" => "treeview"));
 }
コード例 #3
0
ファイル: Themes.php プロジェクト: bombush/NatsuCon
 /**
  * Load themes from theme dir
  *
  * @param string $themeDir Dir with themes
  *
  * @return array
  */
 public function loadThemes($themeDir)
 {
     $themes = array();
     if (!is_dir($themeDir)) {
         return $themes;
     }
     $dirs = Finder::findDirectories("*")->in($themeDir);
     foreach ($dirs as $dir) {
         $themes[$dir->getFilename()] = ucfirst($dir->getFilename());
     }
     return $themes;
 }