move some functions to more appropriate places

This commit is contained in:
zotlabs
2017-02-23 14:52:36 -08:00
parent c866c48252
commit 3e992604c7
3 changed files with 233 additions and 236 deletions
+18
View File
@@ -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.
*