aboutsummaryrefslogtreecommitdiffstats
path: root/boot.php
diff options
context:
space:
mode:
Diffstat (limited to 'boot.php')
-rwxr-xr-xboot.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/boot.php b/boot.php
index 7120632f4..9338bc5b2 100755
--- a/boot.php
+++ b/boot.php
@@ -1384,6 +1384,24 @@ function os_mkdir($path, $mode = 0777, $recursive = false) {
return $result;
}
+
+// recursively delete a directory
+function rrmdir($path) {
+ if(is_dir($path) === true) {
+ $files = array_diff(scandir($path), array('.', '..'));
+ foreach($files as $file) {
+ rrmdir(realpath($path) . '/' . $file);
+ }
+ return rmdir($path);
+ }
+ elseif(is_file($path) === true) {
+ return unlink($path);
+ }
+
+ return false;
+}
+
+
/**
* @brief Function to check if request was an AJAX (xmlhttprequest) request.
*