From baa835cb8cea5833e90e9caaa132cd39de86ef8f Mon Sep 17 00:00:00 2001 From: Diego Najar Date: Mon, 27 May 2019 19:07:53 +0200 Subject: [PATCH] added some logs --- bl-kernel/helpers/filesystem.class.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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);