mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-06 10:11:38 +09:00
fixed #121 FileHandler::removeFilesInDir() 등 문제 수정.
This commit is contained in:
parent
c7a4363a9a
commit
f43fadbe0f
1 changed files with 50 additions and 20 deletions
|
|
@ -365,19 +365,32 @@ class FileHandler
|
|||
return;
|
||||
}
|
||||
|
||||
$files = array_diff(scandir($path), array('..', '.'));
|
||||
foreach($files as $file)
|
||||
if(self::isDir($path))
|
||||
{
|
||||
if(is_dir($path . DIRECTORY_SEPARATOR . $file))
|
||||
$files = array_diff(scandir($path), array('..', '.'));
|
||||
|
||||
foreach($files as $file)
|
||||
{
|
||||
self::removeDir($path . DIRECTORY_SEPARATOR . $entry);
|
||||
}
|
||||
else
|
||||
{
|
||||
@unlink($path . DIRECTORY_SEPARATOR . $file);
|
||||
if(($target = self::getRealPath($path . DIRECTORY_SEPARATOR . $file)) === FALSE)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if(is_dir($target))
|
||||
{
|
||||
self::removeDir($target);
|
||||
}
|
||||
else
|
||||
{
|
||||
unlink($target);
|
||||
}
|
||||
}
|
||||
rmdir($path);
|
||||
}
|
||||
else
|
||||
{
|
||||
unlink($path);
|
||||
}
|
||||
@rmdir($path);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -394,18 +407,21 @@ class FileHandler
|
|||
}
|
||||
|
||||
$files = array_diff(scandir($path), array('..', '.'));
|
||||
|
||||
if(count($files) < 1)
|
||||
{
|
||||
@rmdir($path);
|
||||
rmdir($path);
|
||||
return;
|
||||
}
|
||||
|
||||
foreach($files as $file)
|
||||
{
|
||||
if(is_dir($path . DIRECTORY_SEPARATOR . $file))
|
||||
if(($target = self::isDir($path . DIRECTORY_SEPARATOR . $file)) === FALSE)
|
||||
{
|
||||
self::removeBlankDir($path . DIRECTORY_SEPARATOR . $file);
|
||||
continue;
|
||||
}
|
||||
|
||||
self::removeBlankDir($target);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -424,18 +440,32 @@ class FileHandler
|
|||
return;
|
||||
}
|
||||
|
||||
$files = array_diff(scandir($path), array('..', '.'));
|
||||
foreach($files as $file)
|
||||
if(is_dir($path))
|
||||
{
|
||||
if(is_dir($path . DIRECTORY_SEPARATOR . $file))
|
||||
$files = array_diff(scandir($path), array('..', '.'));
|
||||
|
||||
foreach($files as $file)
|
||||
{
|
||||
self::removeFilesInDir($path . DIRECTORY_SEPARATOR . $file);
|
||||
}
|
||||
else
|
||||
{
|
||||
@unlink($path . DIRECTORY_SEPARATOR . $file);
|
||||
if(($target = self::getRealPath($path . DIRECTORY_SEPARATOR . $file)) === FALSE)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if(is_dir($target))
|
||||
{
|
||||
self::removeFilesInDir($target);
|
||||
}
|
||||
else
|
||||
{
|
||||
unlink($target);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(self::exists($path)) unlink($path);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue