[Pkg-owncloud-commits] [php-sabredav] 199/275: Merge branch '2.0'

David Prévot taffit at moszumanska.debian.org
Thu Sep 25 14:56:08 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 7ecbcaec44de1b10c4610345cbafd21cb9427f16
Merge: abf450a b9afaca
Author: Evert Pot <evert at rooftopsolutions.nl>
Date:   Wed Aug 27 18:32:08 2014 +0200

    Merge branch '2.0'
    
    Conflicts:
    	ChangeLog.md
    	composer.json
    	lib/CardDAV/Backend/PDO.php
    	lib/DAV/CorePlugin.php
    	tests/Sabre/CardDAV/Backend/AbstractPDOTest.php

 ChangeLog.md                                    |   6 +-
 lib/CalDAV/Backend/PDO.php                      |   6 +-
 lib/CalDAV/Backend/SyncSupport.php              |   8 +-
 lib/CalDAV/Calendar.php                         |   6 ++
 lib/CalDAV/ICSExportPlugin.php                  |   2 +-
 lib/CardDAV/AddressBook.php                     |   6 ++
 lib/CardDAV/Backend/PDO.php                     |   6 +-
 lib/CardDAV/Backend/SyncSupport.php             |   8 +-
 lib/DAV/CorePlugin.php                          |  50 ++++++++++++
 lib/DAV/Server.php                              |   9 +++
 lib/DAV/Sync/Plugin.php                         |   2 +-
 tests/Sabre/CalDAV/CalendarTest.php             |  10 ++-
 tests/Sabre/CardDAV/AddressBookTest.php         |   9 ++-
 tests/Sabre/CardDAV/Backend/AbstractPDOTest.php |  12 +--
 tests/Sabre/DAV/SyncTokenPropertyTest.php       | 100 ++++++++++++++++++++++++
 15 files changed, 215 insertions(+), 25 deletions(-)

diff --cc ChangeLog.md
index 2bee92e,e568ea2..9bf2a9e
--- a/ChangeLog.md
+++ b/ChangeLog.md
@@@ -1,68 -1,16 +1,72 @@@
  ChangeLog
  =========
  
 +2.1.0-alpha1 (2014-??-??)
 +-------------------------
 +
 +* Added: Support for [rfc6638][rfc6638], also known as CalDAV Scheduling.
 +* Added: Automatically converting between vCard 3, 4 and jCard using the
 +  `Accept:` header, in CardDAV reports, and automatically converting from
 +  jCard to vCard upon `PUT`. It's important to note that your backends _may_
 +  now recieve both vCard 3.0 and 4.0.
 +* Changed: PropertyStorage backends now have a `move` method.
 +* Added: `beforeMove`, and `afterMove` events.
 +* Changed: A few database changes for the CalDAV PDO backend. Make sure you
 +  run `bin/migrate21.php` to upgrade your database schema.
 +* Changed: CalDAV backends have a new method: `getCalendarObjectByUID`. This
 +  method MUST be implemented by all backends, but the `AbstractBackend` has a
 +  simple default implementation for this.
 +* Changed: `Sabre\CalDAV\UserCalendars` has been renamed to
 +  `Sabre\CalDAV\CalendarHome`.
 +* Changed: `Sabre\CalDAV\CalendarRootNode` has been renamed to
 +  `Sabre\CalDAV\CalendarRoot`.
 +* Changed: The IMipHandler has been completely removed. With CalDAV scheduling
 +  support, it is no longer needed. It's functionality has been replaced by
 +  `Sabre\CalDAV\Schedule\IMipPlugin`, which can now send emails for clients
 +  other than iCal.
 +* Added: Support for the `{http://calendarserver.org/ns/}email-address-set`
 +  property.
 +* #460: PropertyStorage must move properties during `MOVE` requests.
 +* Changed: Restructured the zip distribution to be a little bit more lean
 +  and consistent.
 +* #472: Always returning lock tokens in the lockdiscovery property.
 +* Directory entries in the Browser plugin are sorted by type and name.
 +  (@aklomp)
 +* #486: It's now possible to return additional properties when an 'allprop'
 +  PROPFIND request is being done. (@aklomp)
 +* Changed: Now return HTTP errors when an addressbook-query REPORT is done
 +  on a uri that's not a vcard. This should help with debugging this common
 +  mistake.
 +* Changed: `PUT` requests with a `Content-Range` header now emit a 400 status
 +  instead of 501, as per RFC7231.
 +* Added: Browser plugin can now display the contents of the
 +  `{DAV:}supported-privilege-set` property.
 +* Added: Now reporting `CALDAV:max-resource-size`, but we're not actively
 +  restricting it yet.
 +* Changed: CalDAV plugin is now responsible for reporting
 +  `CALDAV:supported-collation-set` and `CALDAV:supported-calendar-data`
 +  properties.
 +* Added: Now reporting `CARDDAV:max-resource-size`, but we're not actively
 +  restricting it yet.
 +* Added: Support for `CARDDAV:supported-collation-set`.
 +* Changed: CardDAV plugin is now responsible for reporting
 +  `CARDDAV:supported-address-data`. This functionality has been removed from
 +  the CardDAV PDO backend.
 +* When a REPORT is not supported, we now emit HTTP error 415, instead of 403.
 +* `HEAD` requests now work wherever `GET` also works.
 +
 +
- 2.0.4 (????-??-??)
+ 2.0.4 (2014-08-27)
  ------------------
  
  * #483: typo in calendars creation for PostgreSQL.
  * #487: Locks are now automatically removed after a node has been deleted.
+ * #496: Improve CalDAV and CardDAV sync when there is no webdav-sync support.
+ * Added: Automatically mapping internal sync-tokens to getctag.
+ * The zip release ships with [sabre/vobject 3.3.1][vobj],
+   [sabre/http 2.0.4][http], and [sabre/event 1.0.1][evnt].
  
 +
  2.0.3 (2014-07-14)
  ------------------
  
diff --cc lib/CalDAV/Backend/PDO.php
index 1037fa0,21d77f4..153c3d6
mode 100755,100644..100755
--- a/lib/CalDAV/Backend/PDO.php
+++ b/lib/CalDAV/Backend/PDO.php
diff --cc lib/CardDAV/Backend/PDO.php
index a40598a,d8e39b9..81f3355
--- a/lib/CardDAV/Backend/PDO.php
+++ b/lib/CardDAV/Backend/PDO.php
@@@ -78,8 -78,10 +78,8 @@@ class PDO extends AbstractBackend imple
                  '{DAV:}displayname' => $row['displayname'],
                  '{' . CardDAV\Plugin::NS_CARDDAV . '}addressbook-description' => $row['description'],
                  '{http://calendarserver.org/ns/}getctag' => $row['synctoken'],
-                 '{DAV:}sync-token' => $row['synctoken']?$row['synctoken']:'0',
 -                '{' . CardDAV\Plugin::NS_CARDDAV . '}supported-address-data' =>
 -                    new CardDAV\Property\SupportedAddressData(),
+                 '{http://sabredav.org/ns}sync-token' => $row['synctoken']?$row['synctoken']:'0',
 -            );
 +            ];
  
          }
  
diff --cc lib/DAV/CorePlugin.php
index 7fb9e34,97c587d..8547c3e
--- a/lib/DAV/CorePlugin.php
+++ b/lib/DAV/CorePlugin.php
@@@ -43,10 -43,11 +43,11 @@@ class CorePlugin extends ServerPlugin 
          $server->on('method:COPY',      [$this, 'httpCopy']);
          $server->on('method:REPORT',    [$this, 'httpReport']);
  
 -        $server->on('propPatch', [$this, 'propPatchProtectedPropertyCheck'], 90);
 -        $server->on('propPatch', [$this, 'propPatchNodeUpdate'], 200);
 -        $server->on('propFind',  [$this, 'propFind']);
 -        $server->on('propFind',  [$this, 'propFindNode'], 120);
 -        $server->on('propFind',  [$this, 'propFindLate'], 200);
 +        $server->on('propPatch',        [$this, 'propPatchProtectedPropertyCheck'], 90);
 +        $server->on('propPatch',        [$this, 'propPatchNodeUpdate'], 200);
 +        $server->on('propFind',         [$this, 'propFind']);
 +        $server->on('propFind',         [$this, 'propFindNode'], 120);
++        $server->on('propFind',         [$this, 'propFindLate'], 200);
  
      }
  
@@@ -841,4 -849,53 +842,53 @@@
  
      }
  
+     /**
+      * 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) {
++    function propFindLate(PropFind $propFind, INode $node) {
+ 
+         $propFind->handle('{http://calendarserver.org/ns/}getctag', function() use ($propFind) {
+ 
+             // If we already have a sync-token from the current propFind
+             // request, we can re-use that.
+             $val = $propFind->get('{http://sabredav.org/ns}sync-token');
+             if ($val) return $val;
+ 
+             $val = $propFind->get('{DAV:}sync-token');
+             if ($val && is_scalar($val)) {
+                 return $val;
+             }
+             if ($val && $val instanceof Property\IHref) {
+                 return substr($val->getHref(), strlen(Sync\Plugin::SYNCTOKEN_PREFIX));
+             }
+ 
+             // If we got here, the earlier two properties may simply not have
+             // been part of the earlier request. We're going to fetch them.
+             $result = $this->server->getProperties($propFind->getPath(), [
+                 '{http://sabredav.org/ns}sync-token',
+                 '{DAV:}sync-token',
+             ]);
+ 
+             if (isset($result['{http://sabredav.org/ns}sync-token'])) {
+                 return $result['{http://sabredav.org/ns}sync-token'];
+             }
+             if (isset($result['{DAV:}sync-token'])) {
+                 $val = $result['{DAV:}sync-token'];
+                 if (is_scalar($val)) {
+                     return $val;
+                 } elseif ($val instanceof Property\IHref) {
+                     return substr($val->getHref(), strlen(Sync\Plugin::SYNCTOKEN_PREFIX));
+                 }
+             }
+ 
+         });
+ 
+     }
  }
diff --cc tests/Sabre/CardDAV/Backend/AbstractPDOTest.php
index a026351,3a786f8..2537745
--- a/tests/Sabre/CardDAV/Backend/AbstractPDOTest.php
+++ b/tests/Sabre/CardDAV/Backend/AbstractPDOTest.php
@@@ -39,7 -39,8 +39,7 @@@ abstract class AbstractPDOTest extends 
                  '{DAV:}displayname' => 'book1',
                  '{' . CardDAV\Plugin::NS_CARDDAV . '}addressbook-description' => 'addressbook 1',
                  '{http://calendarserver.org/ns/}getctag' => 1,
-                 '{DAV:}sync-token' => 1
 -                '{' . CardDAV\Plugin::NS_CARDDAV . '}supported-address-data' => new CardDAV\Property\SupportedAddressData(),
+                 '{http://sabredav.org/ns}sync-token' => "1"
              )
          );
  
@@@ -70,7 -71,8 +70,7 @@@
                  '{DAV:}displayname' => 'book1',
                  '{' . CardDAV\Plugin::NS_CARDDAV . '}addressbook-description' => 'addressbook 1',
                  '{http://calendarserver.org/ns/}getctag' => 1,
-                 '{DAV:}sync-token' => 1
 -                '{' . CardDAV\Plugin::NS_CARDDAV . '}supported-address-data' => new CardDAV\Property\SupportedAddressData(),
+                 '{http://sabredav.org/ns}sync-token' => 1
              )
          );
  
@@@ -97,7 -99,8 +97,7 @@@
                  '{DAV:}displayname' => 'book1',
                  '{' . CardDAV\Plugin::NS_CARDDAV . '}addressbook-description' => 'addressbook 1',
                  '{http://calendarserver.org/ns/}getctag' => 1,
-                 '{DAV:}sync-token' => 1
 -                '{' . CardDAV\Plugin::NS_CARDDAV . '}supported-address-data' => new CardDAV\Property\SupportedAddressData(),
+                 '{http://sabredav.org/ns}sync-token' => 1
              )
          );
  
@@@ -128,7 -131,8 +128,7 @@@
                  '{DAV:}displayname' => 'updated',
                  '{' . CardDAV\Plugin::NS_CARDDAV . '}addressbook-description' => 'updated',
                  '{http://calendarserver.org/ns/}getctag' => 2,
-                 '{DAV:}sync-token' => 2
 -                '{' . CardDAV\Plugin::NS_CARDDAV . '}supported-address-data' => new CardDAV\Property\SupportedAddressData(),
+                 '{http://sabredav.org/ns}sync-token' => 2
              )
          );
  
@@@ -171,7 -175,8 +171,7 @@@
                  '{DAV:}displayname' => 'book1',
                  '{' . CardDAV\Plugin::NS_CARDDAV . '}addressbook-description' => 'addressbook 1',
                  '{http://calendarserver.org/ns/}getctag' => 1,
-                 '{DAV:}sync-token' => 1,
 -                '{' . CardDAV\Plugin::NS_CARDDAV . '}supported-address-data' => new CardDAV\Property\SupportedAddressData(),
+                 '{http://sabredav.org/ns}sync-token' => 1,
              ),
              array(
                  'id' => 2,
@@@ -180,7 -185,8 +180,7 @@@
                  '{DAV:}displayname' => 'book2',
                  '{' . CardDAV\Plugin::NS_CARDDAV . '}addressbook-description' => 'addressbook 2',
                  '{http://calendarserver.org/ns/}getctag' => 1,
-                 '{DAV:}sync-token' => 1,
 -                '{' . CardDAV\Plugin::NS_CARDDAV . '}supported-address-data' => new CardDAV\Property\SupportedAddressData(),
+                 '{http://sabredav.org/ns}sync-token' => 1,
              )
          );
          $result = $this->backend->getAddressBooksForUser('principals/user1');

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