diff options
author | Mario Vavti <mario@mariovavti.com> | 2016-05-28 17:46:24 +0200 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2016-05-28 17:46:24 +0200 |
commit | 66effbfe0827fc61fff6d248797a894213ad20d6 (patch) | |
tree | 0fbb5ca644e1140e5b3b44b1adc874043790c388 /vendor/sabre/dav/lib/CardDAV/Backend | |
parent | ac4688eac087854bf8cb0c893d7a79052ad63a20 (diff) | |
download | volse-hubzilla-66effbfe0827fc61fff6d248797a894213ad20d6.tar.gz volse-hubzilla-66effbfe0827fc61fff6d248797a894213ad20d6.tar.bz2 volse-hubzilla-66effbfe0827fc61fff6d248797a894213ad20d6.zip |
upgrade to sabre32
Diffstat (limited to 'vendor/sabre/dav/lib/CardDAV/Backend')
-rw-r--r-- | vendor/sabre/dav/lib/CardDAV/Backend/BackendInterface.php | 7 | ||||
-rw-r--r-- | vendor/sabre/dav/lib/CardDAV/Backend/PDO.php | 9 |
2 files changed, 12 insertions, 4 deletions
diff --git a/vendor/sabre/dav/lib/CardDAV/Backend/BackendInterface.php b/vendor/sabre/dav/lib/CardDAV/Backend/BackendInterface.php index b9691b906..54e42b899 100644 --- a/vendor/sabre/dav/lib/CardDAV/Backend/BackendInterface.php +++ b/vendor/sabre/dav/lib/CardDAV/Backend/BackendInterface.php @@ -55,12 +55,15 @@ interface BackendInterface { function updateAddressBook($addressBookId, \Sabre\DAV\PropPatch $propPatch); /** - * Creates a new address book + * Creates a new address book. + * + * This method should return the id of the new address book. The id can be + * in any format, including ints, strings, arrays or objects. * * @param string $principalUri * @param string $url Just the 'basename' of the url. * @param array $properties - * @return void + * @return mixed */ function createAddressBook($principalUri, $url, array $properties); diff --git a/vendor/sabre/dav/lib/CardDAV/Backend/PDO.php b/vendor/sabre/dav/lib/CardDAV/Backend/PDO.php index 5509ddc02..7c3feff93 100644 --- a/vendor/sabre/dav/lib/CardDAV/Backend/PDO.php +++ b/vendor/sabre/dav/lib/CardDAV/Backend/PDO.php @@ -128,7 +128,7 @@ class PDO extends AbstractBackend implements SyncSupport { } else { $query .= ', '; } - $query .= ' `' . $key . '` = :' . $key . ' '; + $query .= ' ' . $key . ' = :' . $key . ' '; } $query .= ' WHERE id = :addressbookid'; @@ -180,7 +180,9 @@ class PDO extends AbstractBackend implements SyncSupport { $query = 'INSERT INTO ' . $this->addressBooksTableName . ' (uri, displayname, description, principaluri, synctoken) VALUES (:uri, :displayname, :description, :principaluri, 1)'; $stmt = $this->pdo->prepare($query); $stmt->execute($values); - return $this->pdo->lastInsertId(); + return $this->pdo->lastInsertId( + $this->addressBooksTableName . '_id_seq' + ); } @@ -230,6 +232,7 @@ class PDO extends AbstractBackend implements SyncSupport { $result = []; while ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) { $row['etag'] = '"' . $row['etag'] . '"'; + $row['lastmodified'] = (int)$row['lastmodified']; $result[] = $row; } return $result; @@ -258,6 +261,7 @@ class PDO extends AbstractBackend implements SyncSupport { if (!$result) return false; $result['etag'] = '"' . $result['etag'] . '"'; + $result['lastmodified'] = (int)$result['lastmodified']; return $result; } @@ -286,6 +290,7 @@ class PDO extends AbstractBackend implements SyncSupport { $result = []; while ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) { $row['etag'] = '"' . $row['etag'] . '"'; + $row['lastmodified'] = (int)$row['lastmodified']; $result[] = $row; } return $result; |