Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch '1.8'

Conflicts:
	composer.json
	lib/Sabre/CalDAV/Version.php
	lib/Sabre/CardDAV/Version.php
  • Loading branch information...
commit 7d1f5f6f8aa609d799a86df14361e9d588a6151b 2 parents 9bb38ca + 5dac5a2
@evert evert authored
View
2  bin/migrateto17.php
@@ -248,7 +248,7 @@ function getDenormalizedData($calendarData) {
$endDate = clone $component->DTSTART->getDateTime();
$endDate->add(\Sabre\VObject\DateTimeParser::parse($component->DURATION->value));
$lastOccurence = $endDate->getTimeStamp();
- } elseif ($component->DTSTART->getDateType()===\Sabre\VObject\Property\DateTime::DATE) {
+ } elseif (!$component->DTSTART->hasTime()) {
$endDate = clone $component->DTSTART->getDateTime();
$endDate->modify('+1 day');
$lastOccurence = $endDate->getTimeStamp();
View
2  composer.json
@@ -15,7 +15,7 @@
],
"require": {
"php": ">=5.4.1",
- "sabre/vobject" : "2.0.*@dev",
+ "sabre/vobject" : "3.0.*@dev",
"ext-dom": "*",
"ext-pcre": "*",
"ext-spl": "*",
View
4 lib/Sabre/CalDAV/Backend/BackendInterface.php
@@ -136,9 +136,11 @@ public function getCalendarObjects($calendarId);
* 'calendardata' object is required here though, while it's not required
* for getCalendarObjects.
*
+ * This method must return null if the object did not exist.
+ *
* @param mixed $calendarId
* @param string $objectUri
- * @return array
+ * @return array|null
*/
public function getCalendarObject($calendarId,$objectUri);
View
8 lib/Sabre/CalDAV/Backend/PDO.php
@@ -413,9 +413,11 @@ public function getCalendarObjects($calendarId) {
* 'calendardata' object is required here though, while it's not required
* for getCalendarObjects.
*
+ * This method must return null if the object did not exist.
+ *
* @param string $calendarId
* @param string $objectUri
- * @return array
+ * @return array|null
*/
public function getCalendarObject($calendarId,$objectUri) {
@@ -587,9 +589,9 @@ protected function getDenormalizedData($calendarData) {
$lastOccurence = $component->DTEND->getDateTime()->getTimeStamp();
} elseif (isset($component->DURATION)) {
$endDate = clone $component->DTSTART->getDateTime();
- $endDate->add(VObject\DateTimeParser::parse($component->DURATION->value));
+ $endDate->add(VObject\DateTimeParser::parse($component->DURATION->getValue()));
$lastOccurence = $endDate->getTimeStamp();
- } elseif ($component->DTSTART->getDateType()===VObject\Property\DateTime::DATE) {
+ } elseif (!$component->DTSTART->hasTime()) {
$endDate = clone $component->DTSTART->getDateTime();
$endDate->modify('+1 day');
$lastOccurence = $endDate->getTimeStamp();
View
2  lib/Sabre/CalDAV/ICSExportPlugin.php
@@ -86,7 +86,7 @@ public function beforeMethod($method, $uri) {
*/
public function generateICS(array $nodes) {
- $calendar = new VObject\Component('vcalendar');
+ $calendar = new VObject\Component\VCalendar();
$calendar->version = '2.0';
if (DAV\Server::$exposeVersion) {
$calendar->prodid = '-//SabreDAV//SabreDAV ' . DAV\Version::VERSION . '//EN';
View
2  lib/Sabre/CalDAV/Plugin.php
@@ -1309,7 +1309,7 @@ protected function getFreeBusyForEmail($email, \DateTime $start, \DateTime $end,
}
- $vcalendar = VObject\Component::create('VCALENDAR');
+ $vcalendar = new VObject\Component\VCalendar();
$vcalendar->VERSION = '2.0';
$vcalendar->METHOD = 'REPLY';
$vcalendar->CALSCALE = 'GREGORIAN';
View
4 lib/Sabre/CardDAV/Plugin.php
@@ -496,7 +496,7 @@ public function validateFilters($vcardData, array $filters, $test) {
if ($filter['text-matches']) {
$texts = array();
foreach($vProperties as $vProperty)
- $texts[] = $vProperty->value;
+ $texts[] = $vProperty->getValue();
$results[] = $this->validateTextMatches($texts, $filter['text-matches'], $filter['test']);
}
@@ -572,7 +572,7 @@ protected function validateParamFilters(array $vProperties, array $filters, $tes
foreach($vProperties as $vProperty) {
// If we got all the way here, we'll need to validate the
// text-match filter.
- $success = DAV\StringUtil::textMatch($vProperty[$filter['name']]->value, $filter['text-match']['value'], $filter['text-match']['collation'], $filter['text-match']['match-type']);
+ $success = DAV\StringUtil::textMatch($vProperty[$filter['name']]->getValue(), $filter['text-match']['value'], $filter['text-match']['collation'], $filter['text-match']['match-type']);
if ($success) break;
}
if ($filter['text-match']['negate-condition']) {
View
4 tests/Sabre/CalDAV/Backend/AbstractPDOTest.php
@@ -561,8 +561,8 @@ function testCalendarQueryTimeRange() {
$backend = new PDO($this->pdo);
$backend->createCalendarObject(1, "todo", "BEGIN:VCALENDAR\r\nBEGIN:VTODO\r\nEND:VTODO\r\nEND:VCALENDAR\r\n");
- $backend->createCalendarObject(1, "event", "BEGIN:VCALENDAR\r\nBEGIN:VEVENT\r\nDTSTART:20120101\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n");
- $backend->createCalendarObject(1, "event2", "BEGIN:VCALENDAR\r\nBEGIN:VEVENT\r\nDTSTART:20120103\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n");
+ $backend->createCalendarObject(1, "event", "BEGIN:VCALENDAR\r\nBEGIN:VEVENT\r\nDTSTART;VALUE=DATE:20120101\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n");
+ $backend->createCalendarObject(1, "event2", "BEGIN:VCALENDAR\r\nBEGIN:VEVENT\r\nDTSTART;VALUE=DATE:20120103\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n");
$filters = array(
'name' => 'VCALENDAR',
View
21 tests/Sabre/CalDAV/CalendarQueryVAlarmTest.php
@@ -12,16 +12,18 @@ class CalendarQueryVAlarmTest extends \PHPUnit_Framework_TestCase {
*/
function testValarm() {
- $vevent = VObject\Component::create('VEVENT');
+ $vcalendar = new VObject\Component\VCalendar();
+
+ $vevent = $vcalendar->createComponent('VEVENT');
$vevent->RRULE = 'FREQ=MONTHLY';
$vevent->DTSTART = '20120101T120000Z';
$vevent->UID = 'bla';
- $valarm = VObject\Component::create('VALARM');
+ $valarm = $vcalendar->createComponent('VALARM');
$valarm->TRIGGER = '-P15D';
$vevent->add($valarm);
- $vcalendar = VObject\Component::create('VCALENDAR');
+
$vcalendar->add($vevent);
$filter = array(
@@ -54,18 +56,18 @@ function testValarm() {
$validator = new CalendarQueryValidator();
$this->assertTrue($validator->validate($vcalendar, $filter));
+ $vcalendar = new VObject\Component\VCalendar();
// A limited recurrence rule, should return false
- $vevent = VObject\Component::create('VEVENT');
+ $vevent = $vcalendar->createComponent('VEVENT');
$vevent->RRULE = 'FREQ=MONTHLY;COUNT=1';
$vevent->DTSTART = '20120101T120000Z';
$vevent->UID = 'bla';
- $valarm = VObject\Component::create('VALARM');
+ $valarm = $vcalendar->createComponent('VALARM');
$valarm->TRIGGER = '-P15D';
$vevent->add($valarm);
- $vcalendar = VObject\Component::create('VCALENDAR');
$vcalendar->add($vevent);
$this->assertFalse($validator->validate($vcalendar, $filter));
@@ -73,15 +75,16 @@ function testValarm() {
function testAlarmWayBefore() {
- $vevent = VObject\Component::create('VEVENT');
+ $vcalendar = new VObject\Component\VCalendar();
+
+ $vevent = $vcalendar->createComponent('VEVENT');
$vevent->DTSTART = '20120101T120000Z';
$vevent->UID = 'bla';
- $valarm = VObject\Component::create('VALARM');
+ $valarm = $vcalendar->createComponent('VALARM');
$valarm->TRIGGER = '-P2W1D';
$vevent->add($valarm);
- $vcalendar = VObject\Component::create('VCALENDAR');
$vcalendar->add($vevent);
$filter = array(
View
4 tests/Sabre/CalDAV/ExpandEventsDTSTARTandDTENDTest.php
@@ -97,10 +97,10 @@ function testExpand() {
if ($child->name == 'DTSTART') {
// DTSTART has to be one of three valid values
- $this->assertContains($child->value, array('20120207T171500Z', '20120208T171500Z', '20120209T171500Z'), 'DTSTART is not a valid value: '.$child->value);
+ $this->assertContains($child->getValue(), array('20120207T171500Z', '20120208T171500Z', '20120209T171500Z'), 'DTSTART is not a valid value: '.$child->getValue());
} elseif ($child->name == 'DTEND') {
// DTEND has to be one of three valid values
- $this->assertContains($child->value, array('20120207T181500Z', '20120208T181500Z', '20120209T181500Z'), 'DTEND is not a valid value: '.$child->value);
+ $this->assertContains($child->getValue(), array('20120207T181500Z', '20120208T181500Z', '20120209T181500Z'), 'DTEND is not a valid value: '.$child->getValue());
}
}
}
View
4 tests/Sabre/CalDAV/ExpandEventsDTSTARTandDTENDbyDayTest.php
@@ -91,10 +91,10 @@ function testExpandRecurringByDayEvent() {
if ($child->name == 'DTSTART') {
// DTSTART has to be one of two valid values
- $this->assertContains($child->value, array('20120214T171500Z', '20120216T171500Z'), 'DTSTART is not a valid value: '.$child->value);
+ $this->assertContains($child->getValue(), array('20120214T171500Z', '20120216T171500Z'), 'DTSTART is not a valid value: '.$child->getValue());
} elseif ($child->name == 'DTEND') {
// DTEND has to be one of two valid values
- $this->assertContains($child->value, array('20120214T181500Z', '20120216T181500Z'), 'DTEND is not a valid value: '.$child->value);
+ $this->assertContains($child->getValue(), array('20120214T181500Z', '20120216T181500Z'), 'DTEND is not a valid value: '.$child->getValue());
}
}
}
View
2  tests/Sabre/CalDAV/Issue203Test.php
@@ -123,7 +123,7 @@ function testIssue203() {
/** @var $child Sabre\VObject\Property */
if (isset($expectedEvent[$child->name])) {
- if ($expectedEvent[$child->name] != $child->value) {
+ if ($expectedEvent[$child->name] != $child->getValue()) {
continue 2;
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.