23 lines
648 B
PHP
23 lines
648 B
PHP
|
<?php
|
||
|
|
||
|
echo "ARE YOU SURE ABOUT THIS? THIS WILL DELETE ALL USER UPLOADED IMAGES!\nwaiting 5 seconds... ";
|
||
|
sleep(5);
|
||
|
echo "Goodbye";
|
||
|
|
||
|
rrmdir("anti_spam");
|
||
|
rrmdir("public/uploads/");
|
||
|
|
||
|
function rrmdir($dir) {
|
||
|
if (is_dir($dir)) {
|
||
|
$objects = scandir($dir);
|
||
|
foreach ($objects as $object) {
|
||
|
if ($object != "." && $object != "..") {
|
||
|
if (is_dir($dir. DIRECTORY_SEPARATOR .$object) && !is_link($dir."/".$object))
|
||
|
rrmdir($dir. DIRECTORY_SEPARATOR .$object);
|
||
|
else
|
||
|
unlink($dir. DIRECTORY_SEPARATOR .$object);
|
||
|
}
|
||
|
}
|
||
|
rmdir($dir);
|
||
|
}
|
||
|
}
|