diff --git a/bin/migrateto20.php b/bin/migrateto20.php index fb24fe599d..195e3749c6 100755 --- a/bin/migrateto20.php +++ b/bin/migrateto20.php @@ -256,7 +256,7 @@ striptodos TINYINT(1) NULL, stripalarms TINYINT(1) NULL, stripattachments TINYINT(1) NULL, - lastmodified INT(11) UNSIGNED, + lastmodified BIGINT(11) UNSIGNED, UNIQUE(principaluri, uri) ); "); @@ -360,7 +360,7 @@ addressbookid INT(11) UNSIGNED NOT NULL, carddata MEDIUMBLOB, uri VARCHAR(200), - lastmodified INT(11) UNSIGNED, + lastmodified BIGINT(11) UNSIGNED, etag VARBINARY(32), size INT(11) UNSIGNED NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; diff --git a/bin/migrateto21.php b/bin/migrateto21.php index 2c15b0a217..9ba81d0d9d 100755 --- a/bin/migrateto21.php +++ b/bin/migrateto21.php @@ -140,7 +140,7 @@ principaluri VARCHAR(255), calendardata MEDIUMBLOB, uri VARCHAR(200), - lastmodified INT(11) UNSIGNED, + lastmodified BIGINT(11) UNSIGNED, etag VARCHAR(32), size INT(11) UNSIGNED NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; diff --git a/examples/addressbookserver.php b/examples/addressbookserver.php index 48f1e91702..cf77b625a0 100644 --- a/examples/addressbookserver.php +++ b/examples/addressbookserver.php @@ -1,11 +1,8 @@ setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); // Autoloader @@ -27,6 +25,7 @@ $principalBackend = new Sabre\DAVACL\PrincipalBackend\PDO($pdo); $carddavBackend = new Sabre\CardDAV\Backend\PDO($pdo); //$caldavBackend = new Sabre\CalDAV\Backend\PDO($pdo); +$authBackend->setRealm('SabreDAV'); // Setting up the directory tree // $nodes = [ @@ -48,4 +47,4 @@ $server->addPlugin(new Sabre\DAV\Sync\Plugin()); // And off we go! -$server->start(); +$server->exec(); diff --git a/examples/calendarserver.php b/examples/calendarserver.php index 88ea961145..ac79cbe31b 100644 --- a/examples/calendarserver.php +++ b/examples/calendarserver.php @@ -1,11 +1,8 @@ setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); // Files we need @@ -26,6 +24,7 @@ $authBackend = new Sabre\DAV\Auth\Backend\PDO($pdo); $calendarBackend = new Sabre\CalDAV\Backend\PDO($pdo); $principalBackend = new Sabre\DAVACL\PrincipalBackend\PDO($pdo); +$authBackend->setRealm('SabreDAV'); // Directory structure $tree = [ @@ -72,4 +71,4 @@ $server->addPlugin($browser); // And off we go! -$server->start(); +$server->exec(); diff --git a/examples/sql/mysql.addressbooks.sql b/examples/sql/mysql.addressbooks.sql index 9ec88babec..f1df4da164 100644 --- a/examples/sql/mysql.addressbooks.sql +++ b/examples/sql/mysql.addressbooks.sql @@ -13,7 +13,7 @@ CREATE TABLE cards ( addressbookid INT(11) UNSIGNED NOT NULL, carddata MEDIUMBLOB, uri VARBINARY(200), - lastmodified INT(11) UNSIGNED, + lastmodified BIGINT(11) UNSIGNED, etag VARBINARY(32), size INT(11) UNSIGNED NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; diff --git a/examples/sql/mysql.calendars.sql b/examples/sql/mysql.calendars.sql index 21c5bcb443..d89a350229 100644 --- a/examples/sql/mysql.calendars.sql +++ b/examples/sql/mysql.calendars.sql @@ -3,12 +3,12 @@ CREATE TABLE calendarobjects ( calendardata MEDIUMBLOB, uri VARBINARY(200), calendarid INTEGER UNSIGNED NOT NULL, - lastmodified INT(11) UNSIGNED, + lastmodified BIGINT(11) UNSIGNED, etag VARBINARY(32), size INT(11) UNSIGNED NOT NULL, componenttype VARBINARY(8), - firstoccurence INT(11) UNSIGNED, - lastoccurence INT(11) UNSIGNED, + firstoccurence BIGINT(11) UNSIGNED, + lastoccurence BIGINT(11) UNSIGNED, uid VARBINARY(200), UNIQUE(calendarid, uri), INDEX calendarid_time (calendarid, firstoccurence) @@ -61,7 +61,7 @@ CREATE TABLE calendarsubscriptions ( striptodos TINYINT(1) NULL, stripalarms TINYINT(1) NULL, stripattachments TINYINT(1) NULL, - lastmodified INT(11) UNSIGNED, + lastmodified BIGINT(11) UNSIGNED, UNIQUE(principaluri, uri) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; @@ -70,7 +70,7 @@ CREATE TABLE schedulingobjects ( principaluri VARBINARY(255), calendardata MEDIUMBLOB, uri VARBINARY(200), - lastmodified INT(11) UNSIGNED, + lastmodified BIGINT(11) UNSIGNED, etag VARBINARY(32), size INT(11) UNSIGNED NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; diff --git a/examples/sql/pgsql.addressbooks.sql b/examples/sql/pgsql.addressbooks.sql index 98f414f42e..ffbcbc1827 100644 --- a/examples/sql/pgsql.addressbooks.sql +++ b/examples/sql/pgsql.addressbooks.sql @@ -18,7 +18,7 @@ CREATE TABLE cards ( addressbookid INTEGER NOT NULL, carddata BYTEA, uri VARCHAR(200), - lastmodified INTEGER, + lastmodified BIGINT, etag VARCHAR(32), size INTEGER NOT NULL ); diff --git a/examples/sql/pgsql.calendars.sql b/examples/sql/pgsql.calendars.sql index caaaa888d2..a84605b2b8 100644 --- a/examples/sql/pgsql.calendars.sql +++ b/examples/sql/pgsql.calendars.sql @@ -3,12 +3,12 @@ CREATE TABLE calendarobjects ( calendardata BYTEA, uri VARCHAR(200), calendarid INTEGER NOT NULL, - lastmodified INTEGER, + lastmodified BIGINT, etag VARCHAR(32), size INTEGER NOT NULL, componenttype VARCHAR(8), - firstoccurence INTEGER, - lastoccurence INTEGER, + firstoccurence BIGINT, + lastoccurence BIGINT, uid VARCHAR(200) ); @@ -71,7 +71,7 @@ CREATE TABLE calendarsubscriptions ( striptodos SMALLINT NULL, stripalarms SMALLINT NULL, stripattachments SMALLINT NULL, - lastmodified INTEGER + lastmodified BIGINT ); ALTER TABLE ONLY calendarsubscriptions @@ -99,7 +99,7 @@ CREATE TABLE schedulingobjects ( principaluri VARCHAR(255), calendardata BYTEA, uri VARCHAR(200), - lastmodified INTEGER, + lastmodified BIGINT, etag VARCHAR(32), size INTEGER NOT NULL ); diff --git a/lib/CalDAV/Backend/PDO.php b/lib/CalDAV/Backend/PDO.php index 2767896434..0c3d8ab4be 100644 --- a/lib/CalDAV/Backend/PDO.php +++ b/lib/CalDAV/Backend/PDO.php @@ -31,7 +31,8 @@ class PDO extends AbstractBackend implements SyncSupport, SubscriptionSupport, S * in 2038-01-19 to avoid problems when the date is converted * to a unix timestamp. */ - const MAX_DATE = '2038-01-01'; + //2026-MAR-22 buckaroo-labs increase maximum date on 64-bit system (see MAX_DATE usage below). + const MAX_DATE = '2038-01-01'; /** * pdo. @@ -662,7 +663,11 @@ protected function getDenormalizedData($calendarData) } } else { $it = new VObject\Recur\EventIterator($vObject, (string) $component->UID); - $maxDate = new \DateTime(self::MAX_DATE); + + //2026-MAR-22 buckaroo-labs increase MAX_DATE on 64-bit system. + if (PHP_INT_SIZE<8) $maxDate = new \DateTime(self::MAX_DATE); + else $maxDate = new \DateTime('5000-01-01'); + if ($it->isInfinite()) { $lastOccurence = $maxDate->getTimeStamp(); } else {