]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - install/install_functions.php
remove a console.log() call
[github/wallabag/wallabag.git] / install / install_functions.php
index a483056952392af012be926dabbb551b2604ed5e..a3bf366195ecf34af6c18204277fe4ac004f17ed 100644 (file)
@@ -78,12 +78,18 @@ function pdoDrivers() {
  * Here in case of .gitignore files
  */
 
-function delTree($dir) {
-    $files = array_diff(scandir($dir), array('.','..'));
-    foreach ($files as $file) {
-      (is_dir("$dir/$file")) ? delTree("$dir/$file") : unlink("$dir/$file");
+function delTree($dir, $withdirectory=true, $hiddenfiles = true) {
+    if ($hiddenfiles) {
+        $files = array_diff(scandir($dir), array('.','..'));
+        foreach ($files as $file) {
+            (is_dir("$dir/$file")) ? delTree("$dir/$file") : unlink("$dir/$file");
+        }
+    }
+    if ($withdirectory) {
+        return rmdir($dir);
+    } else {
+        return true;
     }
-    return rmdir($dir);
   }
 
 function generate_salt() {
@@ -104,4 +110,4 @@ function executeQuery($handle, $sql, $params) {
     }
 }
 
-?>
\ No newline at end of file
+?>