Changeset 2321 for branches

Show
Ignore:
Timestamp:
12/19/10 16:38:27 (17 months ago)
Author:
petsagouris
Message:

[Branch 1.5] Fixing the FileSystem::deleteFiles() as per Nick's comment refs #182

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/1.5/libs/FileSystem.php

    r2315 r2321  
    7070        { 
    7171                foreach (new DirectoryIterator($path) as $file) { 
    72                         $file = new SplFileInfo($file_name); 
    73                         if ($file->isFile()) { 
    74                                 @unlink($path.$file->getFilename()); 
    75                         } 
    76                         if ($delete_directories && $file->isDir()) { 
    77                                 $this->delete_files($file->getRealPath(), TRUE, TRUE); 
     72                        if (!$file->isDot()) { 
     73                                if ($file->isFile()) { 
     74                                        unlink($file->getRealPath()); 
     75                                } 
     76                                if ($delete_directories && $file->isDir()) { 
     77                                        self::deleteFiles($file->getRealPath(), TRUE, TRUE); 
     78                                } 
    7879                        } 
    7980                } 
    8081                if ($remove_directory && is_dir($path)) { 
    81                         @rmdir($path); 
     82                        rmdir($path); 
    8283                } 
    8384                return FALSE;