[Pkg-owncloud-commits] [php-sabredav] 24/64: Removed dead code.

David Prévot taffit at moszumanska.debian.org
Thu Dec 11 15:13:24 UTC 2014


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

taffit pushed a commit to tag 2.2.0alpha1
in repository php-sabredav.

commit 05e86f89091d77f3bd1b32e689c929968cd6d79e
Author: Evert Pot <evert at rooftopsolutions.nl>
Date:   Wed Nov 19 23:39:36 2014 -0500

    Removed dead code.
---
 lib/DAV/PartialUpdate/Plugin.php | 18 ++----------------
 1 file changed, 2 insertions(+), 16 deletions(-)

diff --git a/lib/DAV/PartialUpdate/Plugin.php b/lib/DAV/PartialUpdate/Plugin.php
index 22a7128..a784ee3 100644
--- a/lib/DAV/PartialUpdate/Plugin.php
+++ b/lib/DAV/PartialUpdate/Plugin.php
@@ -119,7 +119,7 @@ class Plugin extends DAV\ServerPlugin {
 
         // Get the node. Will throw a 404 if not found
         $node = $this->server->tree->getNodeForPath($path);
-        if (!$node instanceof IFile && !$node instanceof IPatchSupport) {
+        if (!$node instanceof IPatchSupport) {
             throw new DAV\Exception\MethodNotAllowed('The target resource does not support the PATCH method.');
         }
 
@@ -162,21 +162,7 @@ class Plugin extends DAV\ServerPlugin {
         $body = $this->server->httpRequest->getBody();
 
 
-        if ($node instanceof IPatchSupport) {
-            $etag = $node->patch($body, $range[0], isset($range[1])?$range[1]:null);
-        } else {
-            // The old interface
-            switch($range[0]) {
-                case self::RANGE_APPEND :
-                    throw new DAV\Exception\NotImplemented('This node does not support the append syntax. Please upgrade it to IPatchSupport');
-                case self::RANGE_START :
-                    $etag = $node->putRange($body, $range[1]);
-                    break;
-                case self::RANGE_END :
-                    throw new DAV\Exception\NotImplemented('This node does not support the end-range syntax. Please upgrade it to IPatchSupport');
-                    break;
-            }
-        }
+        $etag = $node->patch($body, $range[0], isset($range[1])?$range[1]:null);
 
         $this->server->emit('afterWriteContent', [$path, $node]);
 

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



More information about the Pkg-owncloud-commits mailing list