[Pkg-owncloud-commits] [owncloud] 188/215: Use moveFromStorage instead of streamCopy when restoring version

David Prévot taffit at moszumanska.debian.org
Tue May 5 01:01:48 UTC 2015


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

taffit pushed a commit to branch stable8
in repository owncloud.

commit 972e18960597f1412490db8a36c91d4b306b526e
Author: Vincent Petry <pvince81 at owncloud.com>
Date:   Thu Apr 30 16:14:29 2015 +0200

    Use moveFromStorage instead of streamCopy when restoring version
---
 apps/files_versions/lib/storage.php | 15 +--------------
 1 file changed, 1 insertion(+), 14 deletions(-)

diff --git a/apps/files_versions/lib/storage.php b/apps/files_versions/lib/storage.php
index 6da22d6..4a5b47d 100644
--- a/apps/files_versions/lib/storage.php
+++ b/apps/files_versions/lib/storage.php
@@ -312,20 +312,7 @@ class Storage {
 		list($storage1, $internalPath1) = $view->resolvePath($path1);
 		list($storage2, $internalPath2) = $view->resolvePath($path2);
 
-		if ($storage1 === $storage2) {
-			return $storage1->rename($internalPath1, $internalPath2);
-		}
-		$source = $storage1->fopen($internalPath1, 'r');
-		$target = $storage2->fopen($internalPath2, 'w');
-		// FIXME: might need to use part file to avoid concurrent writes
-		// (this would be an issue anyway when renaming/restoring cross-storage)
-		list(, $result) = \OC_Helper::streamCopy($source, $target);
-		fclose($source);
-		fclose($target);
-
-		if ($result !== false) {
-			$storage1->unlink($internalPath1);
-		}
+		$result = $storage2->moveFromStorage($storage1, $internalPath1, $internalPath2);
 
 		return ($result !== false);
 	}

-- 
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