[Pkg-owncloud-commits] [php-sabredav] 24/31: Automatically populate getctag with the sync-token, if available.

David Prévot taffit at moszumanska.debian.org
Wed Aug 27 22:33:07 UTC 2014


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

taffit pushed a commit to branch master
in repository php-sabredav.

commit feb7c3dde02f1b4d1767964571e102175cff2f3f
Author: Evert Pot <evert at rooftopsolutions.nl>
Date:   Wed Aug 27 16:22:53 2014 +0200

    Automatically populate getctag with the sync-token, if available.
---
 lib/DAV/CorePlugin.php | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/lib/DAV/CorePlugin.php b/lib/DAV/CorePlugin.php
index 09b8ff0..baba1aa 100644
--- a/lib/DAV/CorePlugin.php
+++ b/lib/DAV/CorePlugin.php
@@ -47,6 +47,7 @@ class CorePlugin extends ServerPlugin {
         $server->on('propPatch', [$this, 'propPatchNodeUpdate'], 200);
         $server->on('propFind',  [$this, 'propFind']);
         $server->on('propFind',  [$this, 'propFindNode'], 120);
+        $server->on('propFind',  [$this, 'propFindLate'], 200);
 
     }
 
@@ -848,4 +849,23 @@ class CorePlugin extends ServerPlugin {
 
     }
 
+    /**
+     * This method is called when properties are retrieved.
+     *
+     * This specific handler is called very late in the process, because we
+     * want other systems to first have a chance to handle the properties.
+     *
+     * @param PropFind $propFind
+     * @param INode $node
+     * @return void
+     */
+    public function propFindLate(PropFind $propFind, INode $node) {
+
+        $propFind->handle('{http://calendarserver.org/ns/}getctag', function() use ($propFind) {
+
+            return $propFind->get('{http://sabredav.org/ns}sync-token');
+
+        });
+
+    }
 }

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