[Pkg-owncloud-commits] [php-sabredav] 89/275: CalendarRootNode -> CalendarRoot. UserCalendars -> CalendarHome.

David Prévot taffit at moszumanska.debian.org
Thu Sep 25 14:55:55 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 b819545613c81fd955390c9ecf511002e9617503
Author: Evert Pot <me at evertpot.com>
Date:   Tue Jul 15 13:47:55 2014 -0400

    CalendarRootNode -> CalendarRoot. UserCalendars -> CalendarHome.
    
    This is a better naming scheme and improves consistency.
---
 examples/addressbookserver.php                                   | 2 +-
 examples/calendarserver.php                                      | 2 +-
 examples/groupwareserver.php                                     | 2 +-
 lib/CalDAV/Backend/SchedulingSupport.php                         | 4 ++--
 lib/CalDAV/{UserCalendars.php => CalendarHome.php}               | 9 +++++++--
 lib/CalDAV/{CalendarRootNode.php => CalendarRoot.php}            | 7 +++++--
 lib/CalDAV/Plugin.php                                            | 4 ++--
 lib/CalDAV/SharingPlugin.php                                     | 2 +-
 ...aredCalendarsTest.php => CalendarHomeSharedCalendarsTest.php} | 4 ++--
 ...rsSubscriptionsTest.php => CalendarHomeSubscriptionsTest.php} | 6 +++---
 .../Sabre/CalDAV/{UserCalendarsTest.php => CalendarHomeTest.php} | 6 +++---
 tests/Sabre/CalDAV/PluginTest.php                                | 2 +-
 tests/Sabre/CalDAV/Schedule/FreeBusyRequestTest.php              | 2 +-
 tests/Sabre/CalDAV/ValidateICalTest.php                          | 2 +-
 tests/Sabre/DAVServerTest.php                                    | 2 +-
 15 files changed, 32 insertions(+), 24 deletions(-)

diff --git a/examples/addressbookserver.php b/examples/addressbookserver.php
index dc5f7ba..66912a8 100644
--- a/examples/addressbookserver.php
+++ b/examples/addressbookserver.php
@@ -37,7 +37,7 @@ $carddavBackend   = new Sabre\CardDAV\Backend\PDO($pdo);
 // Setting up the directory tree //
 $nodes = [
     new Sabre\DAVACL\PrincipalCollection($principalBackend),
-//    new Sabre\CalDAV\CalendarRootNode($authBackend, $caldavBackend),
+//    new Sabre\CalDAV\CalendarRoot($authBackend, $caldavBackend),
     new Sabre\CardDAV\AddressBookRoot($principalBackend, $carddavBackend),
 ];
 
diff --git a/examples/calendarserver.php b/examples/calendarserver.php
index 732e147..40efb2f 100644
--- a/examples/calendarserver.php
+++ b/examples/calendarserver.php
@@ -36,7 +36,7 @@ $principalBackend = new Sabre\DAVACL\PrincipalBackend\PDO($pdo);
 // Directory structure
 $tree = [
     new Sabre\CalDAV\Principal\Collection($principalBackend),
-    new Sabre\CalDAV\CalendarRootNode($principalBackend, $calendarBackend),
+    new Sabre\CalDAV\CalendarRoot($principalBackend, $calendarBackend),
 ];
 
 $server = new Sabre\DAV\Server($tree);
diff --git a/examples/groupwareserver.php b/examples/groupwareserver.php
index 83e72f5..668b92b 100644
--- a/examples/groupwareserver.php
+++ b/examples/groupwareserver.php
@@ -71,7 +71,7 @@ $nodes = [
     // /principals
     new \Sabre\CalDAV\Principal\Collection($principalBackend),
     // /calendars
-    new \Sabre\CalDAV\CalendarRootNode($principalBackend, $caldavBackend),
+    new \Sabre\CalDAV\CalendarRoot($principalBackend, $caldavBackend),
     // /addressbook
     new \Sabre\CardDAV\AddressBookRoot($principalBackend, $carddavBackend),
 ];
diff --git a/lib/CalDAV/Backend/SchedulingSupport.php b/lib/CalDAV/Backend/SchedulingSupport.php
index 43c0cb0..d4aca5b 100644
--- a/lib/CalDAV/Backend/SchedulingSupport.php
+++ b/lib/CalDAV/Backend/SchedulingSupport.php
@@ -13,7 +13,7 @@ namespace Sabre\CalDAV\Backend;
 interface SchedulingSupport extends BackendInterface {
 
     /**
-     * Returns a single scheduling object.
+     * Returns a single scheduling object for the inbox collection.
      *
      * The returned array should contain the following elements:
      *   * uri - A unique basename for the object. This will be used to
@@ -44,7 +44,7 @@ interface SchedulingSupport extends BackendInterface {
     public function getSchedulingObjects($principalUri);
 
     /**
-     * Deletes a scheduling object
+     * Deletes a scheduling object from the inbox collection.
      *
      * @param string $principalUri
      * @param string $objectUri
diff --git a/lib/CalDAV/UserCalendars.php b/lib/CalDAV/CalendarHome.php
similarity index 96%
rename from lib/CalDAV/UserCalendars.php
rename to lib/CalDAV/CalendarHome.php
index e1034af..6d07a49 100644
--- a/lib/CalDAV/UserCalendars.php
+++ b/lib/CalDAV/CalendarHome.php
@@ -8,13 +8,18 @@ use
     Sabre\HTTP\URLUtil;
 
 /**
- * The UserCalendars class contains all calendars associated to one user
+ * The CalendarHome represents a node that is usually in a users'
+ * calendar-homeset.
+ *
+ * It contains all the users' calendars, and can optionally contain a
+ * notifications collection, calendar subscriptions, a users' inbox, and a
+ * users' outbox.
  *
  * @copyright Copyright (C) 2007-2014 fruux GmbH (https://fruux.com/).
  * @author Evert Pot (http://evertpot.com/)
  * @license http://sabre.io/license/ Modified BSD License
  */
-class UserCalendars implements DAV\IExtendedCollection, DAVACL\IACL {
+class CalendarHome implements DAV\IExtendedCollection, DAVACL\IACL {
 
     /**
      * CalDAV backend
diff --git a/lib/CalDAV/CalendarRootNode.php b/lib/CalDAV/CalendarRoot.php
similarity index 88%
rename from lib/CalDAV/CalendarRootNode.php
rename to lib/CalDAV/CalendarRoot.php
index 4f72ad4..94f98cb 100644
--- a/lib/CalDAV/CalendarRootNode.php
+++ b/lib/CalDAV/CalendarRoot.php
@@ -10,11 +10,14 @@ use Sabre\DAVACL\PrincipalBackend;
  * This object is responsible for generating a list of calendar-homes for each
  * user.
  *
+ * This is the top-most node for the calendars tree. In most servers this class
+ * represents the "/calendars" path.
+ *
  * @copyright Copyright (C) 2007-2014 fruux GmbH (https://fruux.com/).
  * @author Evert Pot (http://evertpot.com/)
  * @license http://sabre.io/license/ Modified BSD License
  */
-class CalendarRootNode extends \Sabre\DAVACL\AbstractPrincipalCollection {
+class CalendarRoot extends \Sabre\DAVACL\AbstractPrincipalCollection {
 
     /**
      * CalDAV backend
@@ -70,7 +73,7 @@ class CalendarRootNode extends \Sabre\DAVACL\AbstractPrincipalCollection {
      */
     public function getChildForPrincipal(array $principal) {
 
-        return new UserCalendars($this->caldavBackend, $principal);
+        return new CalendarHome($this->caldavBackend, $principal);
 
     }
 
diff --git a/lib/CalDAV/Plugin.php b/lib/CalDAV/Plugin.php
index b1b6576..03e7331 100644
--- a/lib/CalDAV/Plugin.php
+++ b/lib/CalDAV/Plugin.php
@@ -142,7 +142,7 @@ class Plugin extends DAV\ServerPlugin {
         // iCal has a bug where it assumes that sync support is enabled, only
         // if we say we support it on the calendar-home, even though this is
         // not actually the case.
-        if ($node instanceof UserCalendars && $this->server->getPlugin('sync')) {
+        if ($node instanceof CalendarHome && $this->server->getPlugin('sync')) {
             $reports[] = '{DAV:}sync-collection';
         }
         return $reports;
@@ -869,7 +869,7 @@ class Plugin extends DAV\ServerPlugin {
      */
     public function htmlActionsPanel(DAV\INode $node, &$output) {
 
-        if (!$node instanceof UserCalendars)
+        if (!$node instanceof CalendarHome)
             return;
 
         $output.= '<tr><td colspan="2"><form method="post" action="">
diff --git a/lib/CalDAV/SharingPlugin.php b/lib/CalDAV/SharingPlugin.php
index 3a47d3e..ac1ea52 100644
--- a/lib/CalDAV/SharingPlugin.php
+++ b/lib/CalDAV/SharingPlugin.php
@@ -302,7 +302,7 @@ class SharingPlugin extends DAV\ServerPlugin {
             case '{'. Plugin::NS_CALENDARSERVER.'}invite-reply' :
 
                 // This only works on the calendar-home-root node.
-                if (!$node instanceof UserCalendars) {
+                if (!$node instanceof CalendarHome) {
                     return;
                 }
                 $this->server->transactionType = 'post-invite-reply';
diff --git a/tests/Sabre/CalDAV/UserCalendarsSharedCalendarsTest.php b/tests/Sabre/CalDAV/CalendarHomeSharedCalendarsTest.php
similarity index 94%
rename from tests/Sabre/CalDAV/UserCalendarsSharedCalendarsTest.php
rename to tests/Sabre/CalDAV/CalendarHomeSharedCalendarsTest.php
index 1bc6ff0..e2f20d4 100644
--- a/tests/Sabre/CalDAV/UserCalendarsSharedCalendarsTest.php
+++ b/tests/Sabre/CalDAV/CalendarHomeSharedCalendarsTest.php
@@ -8,7 +8,7 @@ require_once 'Sabre/CalDAV/TestUtil.php';
 
 /**
  */
-class UserCalendarsSharedCalendarsTest extends \PHPUnit_Framework_TestCase {
+class CalendarHomeSharedCalendarsTest extends \PHPUnit_Framework_TestCase {
 
     protected $backend;
 
@@ -34,7 +34,7 @@ class UserCalendarsSharedCalendarsTest extends \PHPUnit_Framework_TestCase {
             array()
         );
 
-        return new UserCalendars($this->backend, array(
+        return new CalendarHome($this->backend, array(
             'uri' => 'principals/user1'
         ));
 
diff --git a/tests/Sabre/CalDAV/UserCalendarsSubscriptionsTest.php b/tests/Sabre/CalDAV/CalendarHomeSubscriptionsTest.php
similarity index 91%
rename from tests/Sabre/CalDAV/UserCalendarsSubscriptionsTest.php
rename to tests/Sabre/CalDAV/CalendarHomeSubscriptionsTest.php
index a1eea2e..4087d6a 100644
--- a/tests/Sabre/CalDAV/UserCalendarsSubscriptionsTest.php
+++ b/tests/Sabre/CalDAV/CalendarHomeSubscriptionsTest.php
@@ -4,7 +4,7 @@ namespace Sabre\CalDAV;
 
 use Sabre\DAVACL;
 
-class UserCalendarsSubscriptionsTest extends \PHPUnit_Framework_TestCase {
+class CalendarHomeSubscriptionsTest extends \PHPUnit_Framework_TestCase {
 
     protected $backend;
 
@@ -20,7 +20,7 @@ class UserCalendarsSubscriptionsTest extends \PHPUnit_Framework_TestCase {
         $this->backend = new Backend\MockSubscriptionSupport([], []);
         $this->backend->createSubscription('principals/user1', 'uri', $props);
 
-        return new UserCalendars($this->backend, $principal);
+        return new CalendarHome($this->backend, $principal);
 
     }
 
@@ -70,7 +70,7 @@ class UserCalendarsSubscriptionsTest extends \PHPUnit_Framework_TestCase {
             'uri' => 'principals/user1'
         ];
         $backend = new Backend\Mock([], []);
-        $uC = new UserCalendars($backend, $principal);
+        $uC = new CalendarHome($backend, $principal);
 
         $rt = ['{DAV:}collection', '{http://calendarserver.org/ns/}subscribed'];
 
diff --git a/tests/Sabre/CalDAV/UserCalendarsTest.php b/tests/Sabre/CalDAV/CalendarHomeTest.php
similarity index 96%
rename from tests/Sabre/CalDAV/UserCalendarsTest.php
rename to tests/Sabre/CalDAV/CalendarHomeTest.php
index 4e16566..dd21129 100644
--- a/tests/Sabre/CalDAV/UserCalendarsTest.php
+++ b/tests/Sabre/CalDAV/CalendarHomeTest.php
@@ -8,10 +8,10 @@ require_once 'Sabre/CalDAV/TestUtil.php';
 
 /**
  */
-class UserCalendarsTest extends \PHPUnit_Framework_TestCase {
+class CalendarHomeTest extends \PHPUnit_Framework_TestCase {
 
     /**
-     * @var Sabre\CalDAV\UserCalendars
+     * @var Sabre\CalDAV\CalendarHome
      */
     protected $usercalendars;
     /**
@@ -23,7 +23,7 @@ class UserCalendarsTest extends \PHPUnit_Framework_TestCase {
 
         if (!SABRE_HASSQLITE) $this->markTestSkipped('SQLite driver is not available');
         $this->backend = TestUtil::getBackend();
-        $this->usercalendars = new UserCalendars($this->backend, array(
+        $this->usercalendars = new CalendarHome($this->backend, array(
             'uri' => 'principals/user1'
         ));
 
diff --git a/tests/Sabre/CalDAV/PluginTest.php b/tests/Sabre/CalDAV/PluginTest.php
index 30d18c5..6905ace 100644
--- a/tests/Sabre/CalDAV/PluginTest.php
+++ b/tests/Sabre/CalDAV/PluginTest.php
@@ -64,7 +64,7 @@ class PluginTest extends \PHPUnit_Framework_TestCase {
             'uri' => 'principals/admin/calendar-proxy-write',
         ));
 
-        $calendars = new CalendarRootNode($principalBackend,$this->caldavBackend);
+        $calendars = new CalendarRoot($principalBackend,$this->caldavBackend);
         $principals = new Principal\Collection($principalBackend);
 
         $root = new DAV\SimpleCollection('root');
diff --git a/tests/Sabre/CalDAV/Schedule/FreeBusyRequestTest.php b/tests/Sabre/CalDAV/Schedule/FreeBusyRequestTest.php
index 4495e0d..eb860fd 100644
--- a/tests/Sabre/CalDAV/Schedule/FreeBusyRequestTest.php
+++ b/tests/Sabre/CalDAV/Schedule/FreeBusyRequestTest.php
@@ -44,7 +44,7 @@ END:VCALENDAR',
 
         $tree = array(
             new DAVACL\PrincipalCollection($principalBackend),
-            new CalDAV\CalendarRootNode($principalBackend, $caldavBackend),
+            new CalDAV\CalendarRoot($principalBackend, $caldavBackend),
         );
 
         $this->request = HTTP\Sapi::createFromServerArray([
diff --git a/tests/Sabre/CalDAV/ValidateICalTest.php b/tests/Sabre/CalDAV/ValidateICalTest.php
index 02d28d5..1aee90e 100644
--- a/tests/Sabre/CalDAV/ValidateICalTest.php
+++ b/tests/Sabre/CalDAV/ValidateICalTest.php
@@ -40,7 +40,7 @@ class ValidateICalTest extends \PHPUnit_Framework_TestCase {
         $principalBackend = new DAVACL\PrincipalBackend\Mock();
 
         $tree = array(
-            new CalendarRootNode($principalBackend, $this->calBackend),
+            new CalendarRoot($principalBackend, $this->calBackend),
         );
 
         $this->server = new DAV\Server($tree);
diff --git a/tests/Sabre/DAVServerTest.php b/tests/Sabre/DAVServerTest.php
index 0cf567c..d42121b 100644
--- a/tests/Sabre/DAVServerTest.php
+++ b/tests/Sabre/DAVServerTest.php
@@ -152,7 +152,7 @@ abstract class DAVServerTest extends \PHPUnit_Framework_TestCase {
     function setUpTree() {
 
         if ($this->setupCalDAV) {
-            $this->tree[] = new CalDAV\CalendarRootNode(
+            $this->tree[] = new CalDAV\CalendarRoot(
                 $this->principalBackend,
                 $this->caldavBackend
             );

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