Fix unlink to rmdir

This commit is contained in:
Jay Trees 2022-01-21 15:04:22 +01:00
parent 540d49eb3d
commit f99c53591f
2 changed files with 8 additions and 4 deletions

View file

@ -16,13 +16,16 @@ function delete_directory(string $directoryToDelete)
$filepath = $directoryToDelete . '/' . $filename; $filepath = $directoryToDelete . '/' . $filename;
if (is_file($filepath) && !is_dir($filepath)) { if (is_file($filepath) && !is_dir($filepath)) {
unlink($filepath); echo 'unlink: ' . $filepath . '<br>';
// unlink($filepath);
} }
if (is_dir($filepath)) { if (is_dir($filepath)) {
delete_directory($filepath); echo 'delete_directory: ' . $filepath . '<br>';
// delete_directory($filepath);
} }
} }
unlink($directoryToDelete); echo 'rmdir (final): ' . $filepath . '<br>';
// rmdir($directoryToDelete);
} }

View file

@ -112,7 +112,8 @@ if ($zip->open($zip_filename)) {
delete_directory($filepath); delete_directory($filepath);
} }
rename($filepath, __DIR__ . '/' . $filename); echo 'reanme: ' . $filepath . ' to ' . __DIR__ . '/' . $filename . '<br>';
// rename($filepath, __DIR__ . '/' . $filename);
} }
} }