[Pkg-owncloud-commits] [php-sabredav] 31/42: Making all the tableName properties public

David Prévot taffit at moszumanska.debian.org
Wed Oct 29 20:52: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 e807c8dcc94ebdf199fbf857870a071ab6dabcd1
Author: Evert Pot <me at evertpot.com>
Date:   Thu Oct 23 20:18:46 2014 -0400

    Making all the tableName properties public
    
    We're deprecating the constructor arguments, as they are growing a bit
    too large. The arguments will be removed in a future version.
---
 ChangeLog.md                        |  4 ++++
 lib/CalDAV/Backend/PDO.php          | 13 +++++++------
 lib/CardDAV/Backend/PDO.php         |  9 ++++++---
 lib/DAV/Auth/Backend/PDO.php        |  4 +++-
 lib/DAV/Locks/Backend/PDO.php       | 14 ++++++++------
 lib/DAVACL/PrincipalBackend/PDO.php | 18 ++++++++++--------
 6 files changed, 38 insertions(+), 24 deletions(-)

diff --git a/ChangeLog.md b/ChangeLog.md
index 03a9dd7..c71404c 100644
--- a/ChangeLog.md
+++ b/ChangeLog.md
@@ -15,6 +15,10 @@ ChangeLog
 * #538: Added `calendarObjectChange` event.
 * Scheduling speedups.
 * #539: added `afterResponse` event. (@joserobleda)
+* Deprecated: All the "tableName" constructor arguments for all the PDO
+  backends are now deprecated. They still work, but will be removed in the
+  next major sabredav version. Every argument that is now deprecated can now
+  be accessed as a public property on the respective backends.
 
 2.1.0-alpha1 (2014-09-23)
 -------------------------
diff --git a/lib/CalDAV/Backend/PDO.php b/lib/CalDAV/Backend/PDO.php
index f177cd4..9d6e539 100644
--- a/lib/CalDAV/Backend/PDO.php
+++ b/lib/CalDAV/Backend/PDO.php
@@ -42,35 +42,35 @@ class PDO extends AbstractBackend implements SyncSupport, SubscriptionSupport, S
      *
      * @var string
      */
-    protected $calendarTableName;
+    public $calendarTableName = 'calendars';
 
     /**
      * The table name that will be used for calendar objects
      *
      * @var string
      */
-    protected $calendarObjectTableName;
+    public $calendarObjectTableName = 'calendarobjects';
 
     /**
      * The table name that will be used for tracking changes in calendars.
      *
      * @var string
      */
-    protected $calendarChangesTableName;
+    public $calendarChangesTableName = 'calendarchanges';
 
     /**
      * The table name that will be used inbox items.
      *
      * @var string
      */
-    protected $schedulingObjectTableName;
+    public $schedulingObjectTableName = 'calendarsubscriptions';
 
     /**
      * The table name that will be used for calendar subscriptions.
      *
      * @var string
      */
-    protected $calendarSubscriptionsTableName;
+    public $calendarSubscriptionsTableName = 'schedulingobjects';
 
     /**
      * List of CalDAV properties, and how they map to database fieldnames
@@ -112,7 +112,8 @@ class PDO extends AbstractBackend implements SyncSupport, SubscriptionSupport, S
      * @param string $calendarChangesTable
      * @param string $schedulingObjectTable
      * @param string $calendarSubscriptionsTableName
-     * @todo we have to do something about this signature. It's bullshit.
+     * @deprecated We are going to remove all the 'tableName' arguments and
+     *             move to public properties for those. Stop relying on them!
      */
     function __construct(\PDO $pdo, $calendarTableName = 'calendars', $calendarObjectTableName = 'calendarobjects', $calendarChangesTableName = 'calendarchanges', $calendarSubscriptionsTableName = "calendarsubscriptions", $schedulingObjectTableName = "schedulingobjects") {
 
diff --git a/lib/CardDAV/Backend/PDO.php b/lib/CardDAV/Backend/PDO.php
index b114248..13fdfeb 100644
--- a/lib/CardDAV/Backend/PDO.php
+++ b/lib/CardDAV/Backend/PDO.php
@@ -26,19 +26,19 @@ class PDO extends AbstractBackend implements SyncSupport {
     /**
      * The PDO table name used to store addressbooks
      */
-    protected $addressBooksTableName;
+    public $addressBooksTableName = 'addressbooks';
 
     /**
      * The PDO table name used to store cards
      */
-    protected $cardsTableName;
+    public $cardsTableName = 'cards';
 
     /**
      * The table name that will be used for tracking changes in address books.
      *
      * @var string
      */
-    protected $addressBookChangesTableName;
+    public $addressBookChangesTableName = 'addressbookchanges';
 
     /**
      * Sets up the object
@@ -46,6 +46,9 @@ class PDO extends AbstractBackend implements SyncSupport {
      * @param \PDO $pdo
      * @param string $addressBooksTableName
      * @param string $cardsTableName
+     * @deprecated We are going to remove all the tableName arguments in a
+     *             future version, and rely on the public properties instead.
+     *             Stop relying on them!
      */
     function __construct(\PDO $pdo, $addressBooksTableName = 'addressbooks', $cardsTableName = 'cards', $addressBookChangesTableName = 'addressbookchanges') {
 
diff --git a/lib/DAV/Auth/Backend/PDO.php b/lib/DAV/Auth/Backend/PDO.php
index d5b32b6..f7183d5 100644
--- a/lib/DAV/Auth/Backend/PDO.php
+++ b/lib/DAV/Auth/Backend/PDO.php
@@ -23,7 +23,7 @@ class PDO extends AbstractDigest {
      *
      * @var string
      */
-    protected $tableName;
+    public $tableName = 'users';
 
 
     /**
@@ -33,6 +33,8 @@ class PDO extends AbstractDigest {
      *
      * @param PDO $pdo
      * @param string $tableName The PDO table name to use
+     * @deprecated The tableName argument will be removed from a future version
+     *             of sabredav. Use the public property instead.
      */
     function __construct(\PDO $pdo, $tableName = 'users') {
 
diff --git a/lib/DAV/Locks/Backend/PDO.php b/lib/DAV/Locks/Backend/PDO.php
index 8062a17..bb6828e 100644
--- a/lib/DAV/Locks/Backend/PDO.php
+++ b/lib/DAV/Locks/Backend/PDO.php
@@ -17,24 +17,26 @@ use Sabre\DAV\Locks\LockInfo;
 class PDO extends AbstractBackend {
 
     /**
-     * The PDO connection object
+     * The PDO tablename this backend uses.
      *
-     * @var pdo
+     * @var string
      */
-    private $pdo;
+    public $tableName = 'locks';
 
     /**
-     * The PDO tablename this backend uses.
+     * The PDO connection object
      *
-     * @var string
+     * @var pdo
      */
-    protected $tableName;
+    protected $pdo;
 
     /**
      * Constructor
      *
      * @param PDO $pdo
      * @param string $tableName
+     * @deprecated We are removing the tableName property in a future version
+     *             of sabredav. Use the public property instead.
      */
     function __construct(\PDO $pdo, $tableName = 'locks') {
 
diff --git a/lib/DAVACL/PrincipalBackend/PDO.php b/lib/DAVACL/PrincipalBackend/PDO.php
index 61598a6..7456835 100644
--- a/lib/DAVACL/PrincipalBackend/PDO.php
+++ b/lib/DAVACL/PrincipalBackend/PDO.php
@@ -21,25 +21,25 @@ use
 class PDO extends AbstractBackend {
 
     /**
-     * pdo
+     * PDO table name for 'principals'
      *
-     * @var PDO
+     * @var string
      */
-    protected $pdo;
+    public $tableName = 'principals';
 
     /**
-     * PDO table name for 'principals'
+     * PDO table name for 'group members'
      *
      * @var string
      */
-    protected $tableName;
+    public $groupMembersTableName = 'groupmembers';
 
     /**
-     * PDO table name for 'group members'
+     * pdo
      *
-     * @var string
+     * @var PDO
      */
-    protected $groupMembersTableName;
+    protected $pdo;
 
     /**
      * A list of additional fields to support
@@ -80,6 +80,8 @@ class PDO extends AbstractBackend {
      * @param PDO $pdo
      * @param string $tableName
      * @param string $groupMembersTableName
+     * @deprecated We are removing the tableName arguments in a future version
+     *             of sabredav. Use the public properties instead.
      */
     function __construct(\PDO $pdo, $tableName = 'principals', $groupMembersTableName = 'groupmembers') {
 

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