Example #1
0
 public static function rmdir($path)
 {
     if (is_dir($path)) {
         foreach (scandir($path) as $name) {
             if (in_array($name, array('.', '..'))) {
                 continue;
             }
             $subpath = $path . DIRECTORY_SEPARATOR . $name;
             Kurogo::rmdir($subpath);
         }
         return rmdir($path);
     } else {
         if (file_exists($path)) {
             return unlink($path);
         }
     }
 }
Example #2
0
 public function clearCacheGroup($cacheGroup)
 {
     if (!$cacheGroup) {
         return false;
     }
     $folder = $this->getCacheFolder($cacheGroup);
     return Kurogo::rmdir($folder);
 }