diff options
author | zotlabs <mike@macgirvin.com> | 2017-02-23 14:52:36 -0800 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2017-02-23 14:52:36 -0800 |
commit | 3e992604c711b64232075215e2fec734f7084377 (patch) | |
tree | d4d34809ec64b71123f703fdb34e262e3f456864 /boot.php | |
parent | c866c482520e786b23e870f4548dd944921ed43e (diff) | |
download | volse-hubzilla-3e992604c711b64232075215e2fec734f7084377.tar.gz volse-hubzilla-3e992604c711b64232075215e2fec734f7084377.tar.bz2 volse-hubzilla-3e992604c711b64232075215e2fec734f7084377.zip |
move some functions to more appropriate places
Diffstat (limited to 'boot.php')
-rwxr-xr-x | boot.php | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -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. * |