-
-
Save tomaszmadeyski/337c8c7e66dd42475ec4 to your computer and use it in GitHub Desktop.
A script to remove directories as a apache user
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
ini_set("display_errors",true); | |
error_reporting(E_ALL); | |
function rrmdir($dir) { | |
if (is_dir($dir)) { | |
$objects = scandir($dir); | |
foreach ($objects as $object) { | |
if ($object != "." && $object != "..") { | |
if (filetype($dir."/".$object) == "dir") rrmdir($dir."/".$object); else unlink($dir."/".$object); | |
} | |
} | |
reset($objects); | |
rmdir($dir); | |
} | |
} | |
rmdir('cache/front'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment