]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - install/install_functions.php
fix #1154
[github/wallabag/wallabag.git] / install / install_functions.php
index 3cfe13fb49a341d89b669124115e162bac44e875..a40db3738d89811977b851e3fcf81a67c9f1fcad 100644 (file)
@@ -78,10 +78,12 @@ function pdoDrivers() {
  * Here in case of .gitignore files
  */
 
-function delTree($dir, $withdirectory="true") {
-    $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);