summaryrefslogtreecommitdiffstats
path: root/lib/private/helper.php
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2014-10-17 15:05:59 +0200
committerMorris Jobke <hey@morrisjobke.de>2014-10-17 15:05:59 +0200
commit7bf401e48ad8b5959edbf7c128a289f5967e5cd2 (patch)
treed80c7334c20ccc9cdbc0432f641ee7ac57266343 /lib/private/helper.php
parent439b33ec380df147f6d3435bfd54f908ad13dfe2 (diff)
parent93b0f1a3bff98f3b9aa9f2e0ca2db4bc23ca3746 (diff)
downloadnextcloud-server-7bf401e48ad8b5959edbf7c128a289f5967e5cd2.tar.gz
nextcloud-server-7bf401e48ad8b5959edbf7c128a289f5967e5cd2.zip
Merge pull request #11430 from owncloud/minify-js-css-master
adding cssmin and jssmin(minify)
Diffstat (limited to 'lib/private/helper.php')
-rw-r--r--lib/private/helper.php17
1 files changed, 11 insertions, 6 deletions
diff --git a/lib/private/helper.php b/lib/private/helper.php
index ea91cc57516..823e82ceeb1 100644
--- a/lib/private/helper.php
+++ b/lib/private/helper.php
@@ -402,9 +402,10 @@ class OC_Helper {
/**
* Recursive deletion of folders
* @param string $dir path to the folder
+ * @param bool $deleteSelf if set to false only the content of the folder will be deleted
* @return bool
*/
- static function rmdirr($dir) {
+ static function rmdirr($dir, $deleteSelf = true) {
if (is_dir($dir)) {
$files = new RecursiveIteratorIterator(
new RecursiveDirectoryIterator($dir, RecursiveDirectoryIterator::SKIP_DOTS),
@@ -419,15 +420,19 @@ class OC_Helper {
unlink($fileInfo->getRealPath());
}
}
- rmdir($dir);
+ if ($deleteSelf) {
+ rmdir($dir);
+ }
} elseif (file_exists($dir)) {
- unlink($dir);
+ if ($deleteSelf) {
+ unlink($dir);
+ }
}
- if (file_exists($dir)) {
- return false;
- } else {
+ if (!$deleteSelf) {
return true;
}
+
+ return !file_exists($dir);
}
/**