added some logs
This commit is contained in:
parent
95448a76c3
commit
baa835cb8c
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue