diff options
author | Morris Jobke <hey@morrisjobke.de> | 2014-10-17 15:05:59 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2014-10-17 15:05:59 +0200 |
commit | 7bf401e48ad8b5959edbf7c128a289f5967e5cd2 (patch) | |
tree | d80c7334c20ccc9cdbc0432f641ee7ac57266343 /lib/private/helper.php | |
parent | 439b33ec380df147f6d3435bfd54f908ad13dfe2 (diff) | |
parent | 93b0f1a3bff98f3b9aa9f2e0ca2db4bc23ca3746 (diff) | |
download | nextcloud-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.php | 17 |
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); } /** |