Recursive remove folder
This commit is contained in:
parent
b65ae0ab71
commit
5af9af91e1
@ -50,16 +50,15 @@ class RefreshCommand extends Command
|
|||||||
return Command::FAILURE;
|
return Command::FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
function recursiveRemoveDirectory($directory)
|
function recursiveRemoveDirectory($dir)
|
||||||
{
|
{
|
||||||
foreach(glob($directory . "/*") as $file)
|
|
||||||
{
|
$files = array_diff(scandir($dir), array('.', '..'));
|
||||||
if(is_dir($file)) {
|
|
||||||
$this->recursiveRemoveDirectory($file);
|
foreach ($files as $file) {
|
||||||
} else {
|
(is_dir("$dir/$file")) ? $this->recursiveRemoveDirectory("$dir/$file") : unlink("$dir/$file");
|
||||||
unlink($file);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
rmdir($directory);
|
|
||||||
|
return rmdir($dir);
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user