mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
fix(profiler): clear command does not work
- The loop is supposed to delete the files first and then the directories. - getPathInfo returns a SplFileInfo object for the parent (the folder in our case). - A non-empty directory cannot be deleted. Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
This commit is contained in:
parent
bc5222726b
commit
4ae10aa7f9
1 changed files with 4 additions and 4 deletions
|
|
@ -81,11 +81,11 @@ class FileProfilerStorage {
|
|||
$iterator = new \RecursiveIteratorIterator($iterator, \RecursiveIteratorIterator::CHILD_FIRST);
|
||||
|
||||
foreach ($iterator as $file) {
|
||||
$file = (string)$file->getPathInfo();
|
||||
if (is_file($file)) {
|
||||
unlink($file);
|
||||
$path = $file->getPathname();
|
||||
if (is_file($path)) {
|
||||
unlink($path);
|
||||
} else {
|
||||
rmdir($file);
|
||||
rmdir($path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue