mirror of
https://github.com/archtechx/tenancy.git
synced 2026-09-20 18:44:05 +00:00
Use rmdir instead of deleteDirectory
rmdir refuses to delete non-empty directories, so it's the better alternative to deleteDirectory here.
This commit is contained in:
parent
388f253964
commit
35d96b5b6f
1 changed files with 4 additions and 1 deletions
|
|
@ -68,7 +68,10 @@ class RemoveStorageSymlinksAction
|
||||||
// Remove the directories CreateStorageSymlinksAction created for the symlink
|
// Remove the directories CreateStorageSymlinksAction created for the symlink
|
||||||
// until a non-empty one is reached.
|
// until a non-empty one is reached.
|
||||||
while (str_starts_with(rtrim($directory, '/\\'), rtrim($publicRoot, '/\\') . DIRECTORY_SEPARATOR) && $files->isEmptyDirectory($directory)) {
|
while (str_starts_with(rtrim($directory, '/\\'), rtrim($publicRoot, '/\\') . DIRECTORY_SEPARATOR) && $files->isEmptyDirectory($directory)) {
|
||||||
$files->deleteDirectory($directory);
|
if (! @rmdir($directory)) {
|
||||||
|
// Stop the loop if the directory couldn't be removed
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
$directory = dirname($directory);
|
$directory = dirname($directory);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue