diff --git a/bl-kernel/helpers/filesystem.class.php b/bl-kernel/helpers/filesystem.class.php index 3af90466..c7c8b186 100644 --- a/bl-kernel/helpers/filesystem.class.php +++ b/bl-kernel/helpers/filesystem.class.php @@ -57,16 +57,19 @@ class Filesystem { public static function rmdir($pathname) { + Log::set('rmdir = '.$pathname, LOG_TYPE_INFO); return rmdir($pathname); } public static function mv($oldname, $newname) { + Log::set('mv '.$oldname.' '.$newname, LOG_TYPE_INFO); return rename($oldname, $newname); } public static function rmfile($filename) { + Log::set('rmfile = '.$filename, LOG_TYPE_INFO); return unlink($filename); } @@ -123,6 +126,8 @@ class Filesystem { // The directory is delete public static function deleteRecursive($source, $deleteDirectory=true) { + Log::set('deleteRecursive = '.$source, LOG_TYPE_INFO); + if (!self::directoryExists($source)) { return false; } @@ -130,7 +135,7 @@ class Filesystem { foreach (new RecursiveIteratorIterator( new RecursiveDirectoryIterator($source, FilesystemIterator::SKIP_DOTS), RecursiveIteratorIterator::CHILD_FIRST) as $item) { - if ($item->isFile()) { + if ($item->isFile() || $item->isLink()) { unlink($item); } else { rmdir($item);