[Pkg-owncloud-commits] [owncloud] 92/199: remove unneeded delTree

David Prévot taffit at moszumanska.debian.org
Sun Jun 1 18:53:13 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository owncloud.

commit e83b41493fe28eca612f3993a5a1cc3e44e9c145
Author: Robin Appelman <icewind at owncloud.com>
Date:   Mon Jul 1 17:41:49 2013 +0200

    remove unneeded delTree
---
 lib/private/files/storage/local.php | 26 +-------------------------
 1 file changed, 1 insertion(+), 25 deletions(-)

diff --git a/lib/private/files/storage/local.php b/lib/private/files/storage/local.php
index de940fc..aaa9f3c 100644
--- a/lib/private/files/storage/local.php
+++ b/lib/private/files/storage/local.php
@@ -164,7 +164,7 @@ if (\OC_Util::runningOnWindows()) {
 		}
 
 		public function unlink($path) {
-			return $this->delTree($path);
+			return unlink($this->datadir . $path);
 		}
 
 		public function rename($path1, $path2) {
@@ -213,30 +213,6 @@ if (\OC_Util::runningOnWindows()) {
 		}
 
 		/**
-		 * @param string $dir
-		 */
-		private function delTree($dir) {
-			$dirRelative = $dir;
-			$dir = $this->datadir . $dir;
-			if (!file_exists($dir)) return true;
-			if (!is_dir($dir) || is_link($dir)) return unlink($dir);
-			foreach (scandir($dir) as $item) {
-				if ($item == '.' || $item == '..') continue;
-				if (is_file($dir . '/' . $item)) {
-					if (unlink($dir . '/' . $item)) {
-					}
-				} elseif (is_dir($dir . '/' . $item)) {
-					if (!$this->delTree($dirRelative . "/" . $item)) {
-						return false;
-					};
-				}
-			}
-			if ($return = rmdir($dir)) {
-			}
-			return $return;
-		}
-
-		/**
 		 * @param string $fullPath
 		 */
 		private static function getFileSizeFromOS($fullPath) {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list