Exemplo n.º 1
0
 /** Рекурсивное удаление $path **/
 public static function __DeleteDirFilesEx($path)
 {
     if (!file_exists($path)) {
         return False;
     }
     if (is_file($path)) {
         @unlink($path);
         return True;
     }
     if ($handle = @opendir($path)) {
         while (($file = readdir($handle)) !== false) {
             if ($file == "." || $file == "..") {
                 continue;
             }
             if (is_dir($path . "/" . $file)) {
                 CUpdateClientPartner::__DeleteDirFilesEx($path . "/" . $file);
             } else {
                 @unlink($path . "/" . $file);
             }
         }
     }
     @closedir($handle);
     @rmdir($path);
     return True;
 }