[Pkg-owncloud-commits] [php-sabredav] 21/275: A few tweaks and renamed schedulingmessages to schedulingobjects everywhere.
David Prévot
taffit at moszumanska.debian.org
Thu Sep 25 14:55:46 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 8b4a4368d60c891914673642d403255b728d7f3f
Author: Evert Pot <evert at rooftopsolutions.nl>
Date: Tue Sep 17 21:33:55 2013 +0100
A few tweaks and renamed schedulingmessages to schedulingobjects
everywhere.
---
examples/sql/mysql.calendars.sql | 2 +-
examples/sql/sqlite.calendars.sql | 10 ++++++++
lib/Sabre/CalDAV/Backend/PDO.php | 28 +++++++++++-----------
lib/Sabre/CalDAV/Schedule/Inbox.php | 4 ++--
...{SchedulingMessage.php => SchedulingObject.php} | 10 ++++----
lib/Sabre/CalDAV/UserCalendars.php | 0
tests/Sabre/CalDAV/Backend/PDOMySQLTest.php | 2 +-
7 files changed, 33 insertions(+), 23 deletions(-)
diff --git a/examples/sql/mysql.calendars.sql b/examples/sql/mysql.calendars.sql
index 53bb1b9..1d85f6f 100755
--- a/examples/sql/mysql.calendars.sql
+++ b/examples/sql/mysql.calendars.sql
@@ -52,7 +52,7 @@ CREATE TABLE calendarsubscriptions (
UNIQUE(principaluri, uri)
);
-CREATE TABLE schedulingmessages (
+CREATE TABLE schedulingobjects (
id INT(11) UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
principaluri VARCHAR(255),
calendardata MEDIUMBLOB,
diff --git a/examples/sql/sqlite.calendars.sql b/examples/sql/sqlite.calendars.sql
index cde6f50..e4b24c8 100644
--- a/examples/sql/sqlite.calendars.sql
+++ b/examples/sql/sqlite.calendars.sql
@@ -50,4 +50,14 @@ CREATE TABLE calendarsubscriptions (
lastmodified int
);
+CREATE TABLE schedulingobjects (
+ id integer primary key asc,
+ principaluri text,
+ calendardata blob,
+ uri text,
+ lastmodified integer,
+ etag text,
+ size integer
+);
+
CREATE INDEX principaluri_uri ON calendarsubscriptions (principaluri, uri);
diff --git a/lib/Sabre/CalDAV/Backend/PDO.php b/lib/Sabre/CalDAV/Backend/PDO.php
index c64a90d..615cc30 100755
--- a/lib/Sabre/CalDAV/Backend/PDO.php
+++ b/lib/Sabre/CalDAV/Backend/PDO.php
@@ -57,13 +57,13 @@ class PDO extends AbstractBackend implements SyncSupport, SubscriptionSupport {
* @var string
*/
protected $calendarChangesTableName;
-
+
/**
- * The table name that will be used for holding inbox scheduling messages.
+ * The table name that will be used inbox items.
*
* @var string
*/
- protected $schedulingMessageTableName;
+ protected $schedulingObjectTableName;
/**
* List of CalDAV properties, and how they map to database fieldnames
@@ -103,13 +103,13 @@ class PDO extends AbstractBackend implements SyncSupport, SubscriptionSupport {
* @param string $calendarTableName
* @param string $calendarObjectTableName
*/
- public function __construct(\PDO $pdo, $calendarTableName = 'calendars', $calendarObjectTableName = 'calendarobjects', $calendarChangesTableName = 'calendarchanges', $schedulingMessageTableName = "schedulingmessages") {
+ public function __construct(\PDO $pdo, $calendarTableName = 'calendars', $calendarObjectTableName = 'calendarobjects', $calendarChangesTableName = 'calendarchanges', $schedulingObjectTableName = "schedulingobjects") {
$this->pdo = $pdo;
$this->calendarTableName = $calendarTableName;
$this->calendarObjectTableName = $calendarObjectTableName;
$this->calendarChangesTableName = $calendarChangesTableName;
- $this->schedulingMessageTableName = $schedulingMessageTableName;
+ $this->schedulingObjectTableName = $schedulingObjectTableName;
}
@@ -1158,15 +1158,15 @@ class PDO extends AbstractBackend implements SyncSupport, SubscriptionSupport {
}
/**
- * Gets a single scheduling message
+ * Returns a single scheduling object.
*
* @param string $principalUri
* @param string $objectUri
* @return array
*/
- public function getSchedulingMessage($principalUri, $objectUri) {
+ public function getSchedulingObject($principalUri, $objectUri) {
- $stmt = $this->pdo->prepare('SELECT id, calendardata, lastmodified, etag, size FROM '.$this->schedulingMessageTableName.' WHERE principaluri = ? AND uri = ?');
+ $stmt = $this->pdo->prepare('SELECT id, calendardata, lastmodified, etag, size FROM '.$this->schedulingObjectTableName.' WHERE principaluri = ? AND uri = ?');
$stmt->execute([$principalUri, $objectUri]);
$row = $stmt->fetch(\PDO::FETCH_ASSOC);
@@ -1183,14 +1183,14 @@ class PDO extends AbstractBackend implements SyncSupport, SubscriptionSupport {
}
/**
- * Gets scheduling messages for the inbox collection
+ * Returns all scheduling objects for the inbox collection.
*
* @param string $principalUri
* @return array
*/
- public function getSchedulingMessages($principalUri) {
+ public function getSchedulingObjects($principalUri) {
- $stmt = $this->pdo->prepare('SELECT id, calendardata, uri, lastmodified, etag, size FROM '.$this->schedulingMessageTableName.' WHERE principaluri = ?');
+ $stmt = $this->pdo->prepare('SELECT id, calendardata, uri, lastmodified, etag, size FROM '.$this->schedulingObjectTableName.' WHERE principaluri = ?');
$stmt->execute([$principalUri]);
$result = [];
@@ -1210,15 +1210,15 @@ class PDO extends AbstractBackend implements SyncSupport, SubscriptionSupport {
}
/**
- * Deletes a scheduling message
+ * Deletes a scheduling object
*
* @param string $principalUri
* @param string $objectUri
* @return void
*/
- public function deleteSchedulingMessage($principalUri, $objectUri) {
+ public function deleteSchedulingObject($principalUri, $objectUri) {
- $stmt = $this->pdo->prepare('DELETE FROM '.$this->schedulingMessageTableName.' WHERE principaluri = ? AND uri = ?');
+ $stmt = $this->pdo->prepare('DELETE FROM '.$this->schedulingObjectTableName.' WHERE principaluri = ? AND uri = ?');
$stmt->execute([$principalUri, $objectUri]);
}
diff --git a/lib/Sabre/CalDAV/Schedule/Inbox.php b/lib/Sabre/CalDAV/Schedule/Inbox.php
old mode 100755
new mode 100644
index f7490ca..3150c26
--- a/lib/Sabre/CalDAV/Schedule/Inbox.php
+++ b/lib/Sabre/CalDAV/Schedule/Inbox.php
@@ -63,11 +63,11 @@ class Inbox extends DAV\Collection implements IInbox {
*/
public function getChildren() {
- $objs = $this->caldavBackend->getSchedulingMessages($this->principalUri);
+ $objs = $this->caldavBackend->getSchedulingObjects($this->principalUri);
$children = [];
foreach($objs as $obj) {
$obj['acl'] = $this->getACL();
- $children[] = new SchedulingMessage($this->caldavBackend,$this->calendarInfo,$obj);
+ $children[] = new SchedulingObject($this->caldavBackend,$this->calendarInfo,$obj);
}
return $children;
diff --git a/lib/Sabre/CalDAV/Schedule/SchedulingMessage.php b/lib/Sabre/CalDAV/Schedule/SchedulingObject.php
old mode 100755
new mode 100644
similarity index 93%
rename from lib/Sabre/CalDAV/Schedule/SchedulingMessage.php
rename to lib/Sabre/CalDAV/Schedule/SchedulingObject.php
index fa28a54..4ef3933
--- a/lib/Sabre/CalDAV/Schedule/SchedulingMessage.php
+++ b/lib/Sabre/CalDAV/Schedule/SchedulingObject.php
@@ -3,12 +3,12 @@
namespace Sabre\CalDAV;
/**
- * The Scheduling Message represents a scheduling object in the Inbox collection
+ * The SchedulingObject represents a scheduling object in the Inbox collection
*
* @author Brett (https://github.com/bretten)
* @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
*/
-class SchedulingMessage extends \Sabre\DAV\File implements ISchedulingMessage, \Sabre\DAVACL\IACL {
+class SchedulingObject extends \Sabre\DAV\File implements ISchedulingObject, \Sabre\DAVACL\IACL {
/**
* Sabre\CalDAV\Backend\BackendInterface
@@ -18,7 +18,7 @@ class SchedulingMessage extends \Sabre\DAV\File implements ISchedulingMessage, \
protected $caldavBackend;
/**
- * Array with information about this SchedulingMessage
+ * Array with information about this SchedulingObject
*
* @var array
*/
@@ -82,7 +82,7 @@ class SchedulingMessage extends \Sabre\DAV\File implements ISchedulingMessage, \
// Pre-populating the 'calendardata' is optional, if we don't have it
// already we fetch it from the backend.
if (!isset($this->objectData['calendardata'])) {
- $this->objectData = $this->caldavBackend->getSchedulingMessage($this->calendarInfo['principaluri'], $this->objectData['uri']);
+ $this->objectData = $this->caldavBackend->getSchedulingObject($this->calendarInfo['principaluri'], $this->objectData['uri']);
}
return $this->objectData['calendardata'];
@@ -105,7 +105,7 @@ class SchedulingMessage extends \Sabre\DAV\File implements ISchedulingMessage, \
*/
public function delete() {
- $this->caldavBackend->deleteSchedulingMessage($this->calendarInfo['principaluri'],$this->objectData['uri']);
+ $this->caldavBackend->deleteSchedulingObject($this->calendarInfo['principaluri'],$this->objectData['uri']);
}
diff --git a/lib/Sabre/CalDAV/UserCalendars.php b/lib/Sabre/CalDAV/UserCalendars.php
old mode 100755
new mode 100644
diff --git a/tests/Sabre/CalDAV/Backend/PDOMySQLTest.php b/tests/Sabre/CalDAV/Backend/PDOMySQLTest.php
index 4fd0e01..fafb151 100644
--- a/tests/Sabre/CalDAV/Backend/PDOMySQLTest.php
+++ b/tests/Sabre/CalDAV/Backend/PDOMySQLTest.php
@@ -14,7 +14,7 @@ class PDOMySQLTest extends AbstractPDOTest {
$pdo = \Sabre\TestUtil::getMySQLDB();
if (!$pdo) $this->markTestSkipped('Could not connect to mysql database');
- $pdo->query('DROP TABLE IF EXISTS calendarobjects, calendars, calendarchanges, calendarsubscriptions, schedulingmessages');
+ $pdo->query('DROP TABLE IF EXISTS calendarobjects, calendars, calendarchanges, calendarsubscriptions, schedulingobjects');
$queries = explode(
';',
--
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