diff options
author | Daniel Kesselberg <mail@danielkesselberg.de> | 2024-09-20 18:14:33 +0200 |
---|---|---|
committer | Daniel Kesselberg <mail@danielkesselberg.de> | 2024-09-20 18:14:33 +0200 |
commit | 4ae10aa7f95e11608d465b3c58d7a88c48cbfbf5 (patch) | |
tree | e4381580ad169d393fd78979de8b7574dcf3dca7 /lib | |
parent | bc5222726b7f6f04308231ff55b8e89ade582d37 (diff) | |
download | nextcloud-server-4ae10aa7f95e11608d465b3c58d7a88c48cbfbf5.tar.gz nextcloud-server-4ae10aa7f95e11608d465b3c58d7a88c48cbfbf5.zip |
fix(profiler): clear command does not workbug/noid/profile-clear-not-working
- 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>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Profiler/FileProfilerStorage.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/private/Profiler/FileProfilerStorage.php b/lib/private/Profiler/FileProfilerStorage.php index a4021d064a9..cd45090e7ca 100644 --- a/lib/private/Profiler/FileProfilerStorage.php +++ b/lib/private/Profiler/FileProfilerStorage.php @@ -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); } } } |