missed some files

This commit is contained in:
Mario Vavti 2016-05-29 00:33:28 +02:00
parent 66effbfe08
commit aab9766c53
38 changed files with 2663 additions and 1276 deletions

2311
vendor/CHANGELOG.md vendored Normal file

File diff suppressed because it is too large Load Diff

27
vendor/LICENSE vendored Normal file
View File

@ -0,0 +1,27 @@
Copyright (C) 2007-2016 fruux GmbH (https://fruux.com/).
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of SabreDAV nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.

36
vendor/README.md vendored Normal file
View File

@ -0,0 +1,36 @@
![sabre's logo](http://sabre.io/img/logo.png) sabre/dav
=======================================================
Introduction
------------
sabre/dav is the most popular WebDAV framework for PHP. Use it to create WebDAV, CalDAV and CardDAV servers.
Full documentation can be found on the website:
http://sabre.io/
Build status
------------
| branch | status | minimum PHP version |
| ------------ | ------ | ------------------- |
| master | [![Build Status](https://travis-ci.org/fruux/sabre-dav.svg?branch=master)](https://travis-ci.org/fruux/sabre-dav) | PHP 5.5 |
| 3.1 | [![Build Status](https://travis-ci.org/fruux/sabre-dav.svg?branch=3.0)](https://travis-ci.org/fruux/sabre-dav) | PHP 5.5 |
| 3.0 | [![Build Status](https://travis-ci.org/fruux/sabre-dav.svg?branch=3.0)](https://travis-ci.org/fruux/sabre-dav) | PHP 5.4 |
| 2.1 | [![Build Status](https://travis-ci.org/fruux/sabre-dav.svg?branch=2.1)](https://travis-ci.org/fruux/sabre-dav) | PHP 5.4 |
| 2.0 | [![Build Status](https://travis-ci.org/fruux/sabre-dav.svg?branch=2.0)](https://travis-ci.org/fruux/sabre-dav) | PHP 5.4 |
| 1.8 | [![Build Status](https://travis-ci.org/fruux/sabre-dav.svg?branch=1.8)](https://travis-ci.org/fruux/sabre-dav) | PHP 5.3 |
| 1.7 | [![Build Status](https://travis-ci.org/fruux/sabre-dav.svg?branch=1.7)](https://travis-ci.org/fruux/sabre-dav) | PHP 5.3 |
| 1.6 | [![Build Status](https://travis-ci.org/fruux/sabre-dav.svg?branch=1.6)](https://travis-ci.org/fruux/sabre-dav) | PHP 5.3 |
Documentation
-------------
* [Introduction](http://sabre.io/dav/).
* [Installation](http://sabre.io/dav/install/).
Made at fruux
-------------
SabreDAV is being developed by [fruux](https://fruux.com/). Drop us a line for commercial services or enterprise support.

76
vendor/examples/calendarserver.php vendored Normal file
View File

@ -0,0 +1,76 @@
<?php
/*
CalendarServer example
This server features CalDAV support
*/
// settings
date_default_timezone_set('Canada/Eastern');
// If you want to run the SabreDAV server in a custom location (using mod_rewrite for instance)
// You can override the baseUri here.
// $baseUri = '/';
/* Database */
$pdo = new PDO('sqlite:data/db.sqlite');
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
//Mapping PHP errors to exceptions
function exception_error_handler($errno, $errstr, $errfile, $errline) {
throw new ErrorException($errstr, 0, $errno, $errfile, $errline);
}
set_error_handler("exception_error_handler");
// Files we need
require_once 'vendor/autoload.php';
// Backends
$authBackend = new Sabre\DAV\Auth\Backend\PDO($pdo);
$calendarBackend = new Sabre\CalDAV\Backend\PDO($pdo);
$principalBackend = new Sabre\DAVACL\PrincipalBackend\PDO($pdo);
// Directory structure
$tree = [
new Sabre\CalDAV\Principal\Collection($principalBackend),
new Sabre\CalDAV\CalendarRoot($principalBackend, $calendarBackend),
];
$server = new Sabre\DAV\Server($tree);
if (isset($baseUri))
$server->setBaseUri($baseUri);
/* Server Plugins */
$authPlugin = new Sabre\DAV\Auth\Plugin($authBackend);
$server->addPlugin($authPlugin);
$aclPlugin = new Sabre\DAVACL\Plugin();
$server->addPlugin($aclPlugin);
/* CalDAV support */
$caldavPlugin = new Sabre\CalDAV\Plugin();
$server->addPlugin($caldavPlugin);
/* Calendar subscription support */
$server->addPlugin(
new Sabre\CalDAV\Subscriptions\Plugin()
);
/* Calendar scheduling support */
$server->addPlugin(
new Sabre\CalDAV\Schedule\Plugin()
);
/* WebDAV-Sync plugin */
$server->addPlugin(new Sabre\DAV\Sync\Plugin());
// Support for html frontend
$browser = new Sabre\DAV\Browser\Plugin();
$server->addPlugin($browser);
// And off we go!
$server->exec();

56
vendor/examples/fileserver.php vendored Normal file
View File

@ -0,0 +1,56 @@
<?php
/*
This is the best starting point if you're just interested in setting up a fileserver.
Make sure that the 'public' and 'tmpdata' exists, with write permissions
for your server.
*/
// settings
date_default_timezone_set('Canada/Eastern');
$publicDir = 'public';
$tmpDir = 'tmpdata';
// If you want to run the SabreDAV server in a custom location (using mod_rewrite for instance)
// You can override the baseUri here.
// $baseUri = '/';
// Files we need
require_once 'vendor/autoload.php';
// Create the root node
$root = new \Sabre\DAV\FS\Directory($publicDir);
// The rootnode needs in turn to be passed to the server class
$server = new \Sabre\DAV\Server($root);
if (isset($baseUri))
$server->setBaseUri($baseUri);
// Support for LOCK and UNLOCK
$lockBackend = new \Sabre\DAV\Locks\Backend\File($tmpDir . '/locksdb');
$lockPlugin = new \Sabre\DAV\Locks\Plugin($lockBackend);
$server->addPlugin($lockPlugin);
// Support for html frontend
$browser = new \Sabre\DAV\Browser\Plugin();
$server->addPlugin($browser);
// Automatically guess (some) contenttypes, based on extesion
$server->addPlugin(new \Sabre\DAV\Browser\GuessContentType());
// Authentication backend
$authBackend = new \Sabre\DAV\Auth\Backend\File('.htdigest');
$auth = new \Sabre\DAV\Auth\Plugin($authBackend);
$server->addPlugin($auth);
// Temporary file filter
$tempFF = new \Sabre\DAV\TemporaryFileFilterPlugin($tmpDir);
$server->addPlugin($tempFF);
// And off we go!
$server->exec();

101
vendor/examples/groupwareserver.php vendored Normal file
View File

@ -0,0 +1,101 @@
<?php
/**
* This server combines both CardDAV and CalDAV functionality into a single
* server. It is assumed that the server runs at the root of a HTTP domain (be
* that a domainname-based vhost or a specific TCP port.
*
* This example also assumes that you're using SQLite and the database has
* already been setup (along with the database tables).
*
* You may choose to use MySQL instead, just change the PDO connection
* statement.
*/
/**
* UTC or GMT is easy to work with, and usually recommended for any
* application.
*/
date_default_timezone_set('UTC');
/**
* Make sure this setting is turned on and reflect the root url for your WebDAV
* server.
*
* This can be for example the root / or a complete path to your server script.
*/
// $baseUri = '/';
/**
* Database
*
* Feel free to switch this to MySQL, it will definitely be better for higher
* concurrency.
*/
$pdo = new \PDO('sqlite:data/db.sqlite');
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
/**
* Mapping PHP errors to exceptions.
*
* While this is not strictly needed, it makes a lot of sense to do so. If an
* E_NOTICE or anything appears in your code, this allows SabreDAV to intercept
* the issue and send a proper response back to the client (HTTP/1.1 500).
*/
function exception_error_handler($errno, $errstr, $errfile, $errline) {
throw new ErrorException($errstr, 0, $errno, $errfile, $errline);
}
set_error_handler("exception_error_handler");
// Autoloader
require_once 'vendor/autoload.php';
/**
* The backends. Yes we do really need all of them.
*
* This allows any developer to subclass just any of them and hook into their
* own backend systems.
*/
$authBackend = new \Sabre\DAV\Auth\Backend\PDO($pdo);
$principalBackend = new \Sabre\DAVACL\PrincipalBackend\PDO($pdo);
$carddavBackend = new \Sabre\CardDAV\Backend\PDO($pdo);
$caldavBackend = new \Sabre\CalDAV\Backend\PDO($pdo);
/**
* The directory tree
*
* Basically this is an array which contains the 'top-level' directories in the
* WebDAV server.
*/
$nodes = [
// /principals
new \Sabre\CalDAV\Principal\Collection($principalBackend),
// /calendars
new \Sabre\CalDAV\CalendarRoot($principalBackend, $caldavBackend),
// /addressbook
new \Sabre\CardDAV\AddressBookRoot($principalBackend, $carddavBackend),
];
// The object tree needs in turn to be passed to the server class
$server = new \Sabre\DAV\Server($nodes);
if (isset($baseUri)) $server->setBaseUri($baseUri);
// Plugins
$server->addPlugin(new \Sabre\DAV\Auth\Plugin($authBackend));
$server->addPlugin(new \Sabre\DAV\Browser\Plugin());
$server->addPlugin(new \Sabre\DAV\Sync\Plugin());
$server->addPlugin(new \Sabre\DAV\Sharing\Plugin());
$server->addPlugin(new \Sabre\DAVACL\Plugin());
// CalDAV plugins
$server->addPlugin(new \Sabre\CalDAV\Plugin());
$server->addPlugin(new \Sabre\CalDAV\Schedule\Plugin());
$server->addPlugin(new \Sabre\CalDAV\SharingPlugin());
$server->addPlugin(new \Sabre\CalDAV\ICSExportPlugin());
// CardDAV plugins
$server->addPlugin(new \Sabre\CardDAV\Plugin());
$server->addPlugin(new \Sabre\CardDAV\VCFExportPlugin());
// And off we go!
$server->exec();

20
vendor/examples/minimal.php vendored Normal file
View File

@ -0,0 +1,20 @@
<?php
/**
* This example shows the smallest possible sabre/dav server.
*/
include 'vendor/autoload.php';
$server = new Sabre\DAV\Server([
new Sabre\DAV\FS\Directory(__DIR__)
]);
/**
* Ok. Perhaps not the smallest possible. The browser plugin is 100% optional,
* but it really helps understanding the server.
*/
$server->addPlugin(
new Sabre\DAV\Browser\Plugin()
);
$server->exec();

View File

@ -6,7 +6,7 @@ CREATE TABLE addressbooks (
description TEXT,
synctoken INT(11) UNSIGNED NOT NULL DEFAULT '1',
UNIQUE(principaluri(100), uri(100))
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE cards (
id INT(11) UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
@ -16,7 +16,7 @@ CREATE TABLE cards (
lastmodified INT(11) UNSIGNED,
etag VARBINARY(32),
size INT(11) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE addressbookchanges (
id INT(11) UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
@ -25,4 +25,4 @@ CREATE TABLE addressbookchanges (
addressbookid INT(11) UNSIGNED NOT NULL,
operation TINYINT(1) NOT NULL,
INDEX addressbookid_synctoken (addressbookid, synctoken)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

View File

@ -0,0 +1,9 @@
CREATE TABLE propertystorage (
id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
path VARBINARY(1024) NOT NULL,
name VARBINARY(100) NOT NULL,
valuetype INT UNSIGNED,
value MEDIUMBLOB
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE UNIQUE INDEX path_property ON propertystorage (path(600), name(100));

View File

@ -16,7 +16,7 @@ CREATE UNIQUE INDEX addressbooks_ukey
CREATE TABLE cards (
id SERIAL NOT NULL,
addressbookid INTEGER NOT NULL,
carddata TEXT,
carddata BYTEA,
uri VARCHAR(200),
lastmodified INTEGER,
etag VARCHAR(32),
@ -29,10 +29,6 @@ ALTER TABLE ONLY cards
CREATE UNIQUE INDEX cards_ukey
ON cards USING btree (addressbookid, uri);
ALTER TABLE ONLY cards
ADD CONSTRAINT cards_addressbookid_fkey FOREIGN KEY (addressbookid) REFERENCES addressbooks(id)
ON DELETE CASCADE;
CREATE TABLE addressbookchanges (
id SERIAL NOT NULL,
uri VARCHAR(200) NOT NULL,
@ -46,7 +42,3 @@ ALTER TABLE ONLY addressbookchanges
CREATE INDEX addressbookchanges_addressbookid_synctoken_ix
ON addressbookchanges USING btree (addressbookid, synctoken);
ALTER TABLE ONLY addressbookchanges
ADD CONSTRAINT addressbookchanges_addressbookid_fkey FOREIGN KEY (addressbookid) REFERENCES addressbooks(id)
ON DELETE CASCADE;

View File

@ -0,0 +1,13 @@
CREATE TABLE propertystorage (
id SERIAL NOT NULL,
path VARCHAR(1024) NOT NULL,
name VARCHAR(100) NOT NULL,
valuetype INT,
value BYTEA
);
ALTER TABLE ONLY propertystorage
ADD CONSTRAINT propertystorage_pkey PRIMARY KEY (id);
CREATE UNIQUE INDEX propertystorage_ukey
ON propertystorage (path, name);

View File

@ -0,0 +1,10 @@
CREATE TABLE propertystorage (
id integer primary key asc NOT NULL,
path text NOT NULL,
name text NOT NULL,
valuetype integer NOT NULL,
value string
);
CREATE UNIQUE INDEX path_property ON propertystorage (path, name);

View File

@ -1,284 +0,0 @@
#!/usr/bin/env php
<?php
echo "SabreDAV migrate script for version 1.7\n";
if ($argc<2) {
echo <<<HELLO
This script help you migrate from a pre-1.7 database to 1.7 and later\n
Both the 'calendarobjects' and 'calendars' tables will be upgraded.
If you do not have this table, or don't use the default PDO CalDAV backend
it's pointless to run this script.
Keep in mind that some processing will be done on every single record of this
table and in addition, ALTER TABLE commands will be executed.
If you have a large calendarobjects table, this may mean that this process
takes a while.
Usage:
php {$argv[0]} [pdo-dsn] [username] [password]
For example:
php {$argv[0]} "mysql:host=localhost;dbname=sabredav" root password
php {$argv[0]} sqlite:data/sabredav.db
HELLO;
exit();
}
// There's a bunch of places where the autoloader could be, so we'll try all of
// them.
$paths = array(
__DIR__ . '/../vendor/autoload.php',
__DIR__ . '/../../../autoload.php',
);
foreach($paths as $path) {
if (file_exists($path)) {
include $path;
break;
}
}
$dsn = $argv[1];
$user = isset($argv[2])?$argv[2]:null;
$pass = isset($argv[3])?$argv[3]:null;
echo "Connecting to database: " . $dsn . "\n";
$pdo = new PDO($dsn, $user, $pass);
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$pdo->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC);
echo "Validating existing table layout\n";
// The only cross-db way to do this, is to just fetch a single record.
$row = $pdo->query("SELECT * FROM calendarobjects LIMIT 1")->fetch();
if (!$row) {
echo "Error: This database did not have any records in the calendarobjects table, you should just recreate the table.\n";
exit(-1);
}
$requiredFields = array(
'id',
'calendardata',
'uri',
'calendarid',
'lastmodified',
);
foreach($requiredFields as $requiredField) {
if (!array_key_exists($requiredField,$row)) {
echo "Error: The current 'calendarobjects' table was missing a field we expected to exist.\n";
echo "For safety reasons, this process is stopped.\n";
exit(-1);
}
}
$fields17 = array(
'etag',
'size',
'componenttype',
'firstoccurence',
'lastoccurence',
);
$found = 0;
foreach($fields17 as $field) {
if (array_key_exists($field, $row)) {
$found++;
}
}
if ($found === 0) {
echo "The database had the 1.6 schema. Table will now be altered.\n";
echo "This may take some time for large tables\n";
switch($pdo->getAttribute(PDO::ATTR_DRIVER_NAME)) {
case 'mysql' :
$pdo->exec(<<<SQL
ALTER TABLE calendarobjects
ADD etag VARCHAR(32),
ADD size INT(11) UNSIGNED,
ADD componenttype VARCHAR(8),
ADD firstoccurence INT(11) UNSIGNED,
ADD lastoccurence INT(11) UNSIGNED
SQL
);
break;
case 'sqlite' :
$pdo->exec('ALTER TABLE calendarobjects ADD etag text');
$pdo->exec('ALTER TABLE calendarobjects ADD size integer');
$pdo->exec('ALTER TABLE calendarobjects ADD componenttype TEXT');
$pdo->exec('ALTER TABLE calendarobjects ADD firstoccurence integer');
$pdo->exec('ALTER TABLE calendarobjects ADD lastoccurence integer');
break;
default :
die('This upgrade script does not support this driver (' . $pdo->getAttribute(PDO::ATTR_DRIVER_NAME) . ")\n");
}
echo "Database schema upgraded.\n";
} elseif ($found === 5) {
echo "Database already had the 1.7 schema\n";
} else {
echo "The database had $found out of 5 from the changes for 1.7. This is scary and unusual, so we have to abort.\n";
echo "You can manually try to upgrade the schema, and then run this script again.\n";
exit(-1);
}
echo "Now, we need to parse every record and pull out some information.\n";
$result = $pdo->query('SELECT id, calendardata FROM calendarobjects');
$stmt = $pdo->prepare('UPDATE calendarobjects SET etag = ?, size = ?, componenttype = ?, firstoccurence = ?, lastoccurence = ? WHERE id = ?');
echo "Total records found: " . $result->rowCount() . "\n";
$done = 0;
$total = $result->rowCount();
while($row = $result->fetch()) {
try {
$newData = getDenormalizedData($row['calendardata']);
} catch (Exception $e) {
echo "===\nException caught will trying to parser calendarobject.\n";
echo "Error message: " . $e->getMessage() . "\n";
echo "Record id: " . $row['id'] . "\n";
echo "This record is ignored, you should inspect it to see if there's anything wrong.\n===\n";
continue;
}
$stmt->execute(array(
$newData['etag'],
$newData['size'],
$newData['componentType'],
$newData['firstOccurence'],
$newData['lastOccurence'],
$row['id'],
));
$done++;
if ($done % 500 === 0) {
echo "Completed: $done / $total\n";
}
}
echo "Completed: $done / $total\n";
echo "Checking the calendars table needs changes.\n";
$row = $pdo->query("SELECT * FROM calendars LIMIT 1")->fetch();
if (array_key_exists('transparent', $row)) {
echo "The calendars table is already up to date\n";
} else {
echo "Adding the 'transparent' field to the calendars table\n";
switch($pdo->getAttribute(PDO::ATTR_DRIVER_NAME)) {
case 'mysql' :
$pdo->exec("ALTER TABLE calendars ADD transparent TINYINT(1) NOT NULL DEFAULT '0'");
break;
case 'sqlite' :
$pdo->exec("ALTER TABLE calendars ADD transparent bool");
break;
default :
die('This upgrade script does not support this driver (' . $pdo->getAttribute(PDO::ATTR_DRIVER_NAME) . ")\n");
}
}
echo "Process completed!\n";
/**
* Parses some information from calendar objects, used for optimized
* calendar-queries.
*
* Blantently copied from Sabre\CalDAV\Backend\PDO
*
* Returns an array with the following keys:
* * etag
* * size
* * componentType
* * firstOccurence
* * lastOccurence
*
* @param string $calendarData
* @return array
*/
function getDenormalizedData($calendarData) {
$vObject = \Sabre\VObject\Reader::read($calendarData);
$componentType = null;
$component = null;
$firstOccurence = null;
$lastOccurence = null;
foreach($vObject->getComponents() as $component) {
if ($component->name!=='VTIMEZONE') {
$componentType = $component->name;
break;
}
}
if (!$componentType) {
throw new \Sabre\DAV\Exception\BadRequest('Calendar objects must have a VJOURNAL, VEVENT or VTODO component');
}
if ($componentType === 'VEVENT') {
$firstOccurence = $component->DTSTART->getDateTime()->getTimeStamp();
// Finding the last occurence is a bit harder
if (!isset($component->RRULE)) {
if (isset($component->DTEND)) {
$lastOccurence = $component->DTEND->getDateTime()->getTimeStamp();
} elseif (isset($component->DURATION)) {
$endDate = clone $component->DTSTART->getDateTime();
$endDate->add(\Sabre\VObject\DateTimeParser::parse($component->DURATION->value));
$lastOccurence = $endDate->getTimeStamp();
} elseif (!$component->DTSTART->hasTime()) {
$endDate = clone $component->DTSTART->getDateTime();
$endDate->modify('+1 day');
$lastOccurence = $endDate->getTimeStamp();
} else {
$lastOccurence = $firstOccurence;
}
} else {
$it = new \Sabre\VObject\Recur\EventIterator($vObject, (string)$component->UID);
$maxDate = new DateTime(\Sabre\CalDAV\Backend\PDO::MAX_DATE);
if ($it->isInfinite()) {
$lastOccurence = $maxDate->getTimeStamp();
} else {
$end = $it->getDtEnd();
while($it->valid() && $end < $maxDate) {
$end = $it->getDtEnd();
$it->next();
}
$lastOccurence = $end->getTimeStamp();
}
}
}
return array(
'etag' => md5($calendarData),
'size' => strlen($calendarData),
'componentType' => $componentType,
'firstOccurence' => $firstOccurence,
'lastOccurence' => $lastOccurence,
);
}

View File

@ -1,48 +0,0 @@
<?php
namespace Sabre\CalDAV;
/**
* This interface represents a Calendar that can be shared with other users.
*
* @copyright Copyright (C) 2007-2015 fruux GmbH (https://fruux.com/).
* @author Evert Pot (http://evertpot.com/)
* @license http://sabre.io/license/ Modified BSD License
*/
interface IShareableCalendar extends ICalendar {
/**
* Updates the list of shares.
*
* The first array is a list of people that are to be added to the
* calendar.
*
* Every element in the add array has the following properties:
* * href - A url. Usually a mailto: address
* * commonName - Usually a first and last name, or false
* * summary - A description of the share, can also be false
* * readOnly - A boolean value
*
* Every element in the remove array is just the address string.
*
* @param array $add
* @param array $remove
* @return void
*/
function updateShares(array $add, array $remove);
/**
* Returns the list of people whom this calendar is shared with.
*
* Every element in this array should have the following properties:
* * href - Often a mailto: address
* * commonName - Optional, for example a first + last name
* * status - See the Sabre\CalDAV\SharingPlugin::STATUS_ constants.
* * readOnly - boolean
* * summary - Optional, a description for the share
*
* @return array
*/
function getShares();
}

View File

@ -1,72 +0,0 @@
<?php
namespace Sabre\CalDAV;
/**
* This object represents a CalDAV calendar that can be shared with other
* users.
*
* @copyright Copyright (C) 2007-2015 fruux GmbH (https://fruux.com/).
* @author Evert Pot (http://evertpot.com/)
* @license http://sabre.io/license/ Modified BSD License
*/
class ShareableCalendar extends Calendar implements IShareableCalendar {
/**
* Updates the list of shares.
*
* The first array is a list of people that are to be added to the
* calendar.
*
* Every element in the add array has the following properties:
* * href - A url. Usually a mailto: address
* * commonName - Usually a first and last name, or false
* * summary - A description of the share, can also be false
* * readOnly - A boolean value
*
* Every element in the remove array is just the address string.
*
* @param array $add
* @param array $remove
* @return void
*/
function updateShares(array $add, array $remove) {
$this->caldavBackend->updateShares($this->calendarInfo['id'], $add, $remove);
}
/**
* Returns the list of people whom this calendar is shared with.
*
* Every element in this array should have the following properties:
* * href - Often a mailto: address
* * commonName - Optional, for example a first + last name
* * status - See the Sabre\CalDAV\SharingPlugin::STATUS_ constants.
* * readOnly - boolean
* * summary - Optional, a description for the share
*
* @return array
*/
function getShares() {
return $this->caldavBackend->getShares($this->calendarInfo['id']);
}
/**
* Marks this calendar as published.
*
* Publishing a calendar should automatically create a read-only, public,
* subscribable calendar.
*
* @param bool $value
* @return void
*/
function setPublishStatus($value) {
$this->caldavBackend->setPublishStatus($this->calendarInfo['id'], $value);
}
}

View File

@ -1,60 +0,0 @@
<?php
namespace Sabre\CalDAV;
use Sabre\DAVACL;
class ShareableCalendarTest extends \PHPUnit_Framework_TestCase {
protected $backend;
protected $instance;
function setUp() {
$props = array(
'id' => 1,
);
$this->backend = new Backend\MockSharing(
array($props)
);
$this->backend->updateShares(1, array(
array(
'href' => 'mailto:removeme@example.org',
'commonName' => 'To be removed',
'readOnly' => true,
),
), array());
$this->instance = new ShareableCalendar($this->backend, $props);
}
function testUpdateShares() {
$this->instance->updateShares(array(
array(
'href' => 'mailto:test@example.org',
'commonName' => 'Foo Bar',
'summary' => 'Booh',
'readOnly' => false,
),
), array('mailto:removeme@example.org'));
$this->assertEquals(array(array(
'href' => 'mailto:test@example.org',
'commonName' => 'Foo Bar',
'summary' => 'Booh',
'readOnly' => false,
'status' => SharingPlugin::STATUS_NORESPONSE,
)), $this->instance->getShares());
}
function testPublish() {
$this->assertNull($this->instance->setPublishStatus(true));
$this->assertNull($this->instance->setPublishStatus(false));
}
}

View File

@ -1,40 +0,0 @@
<phpunit
colors="true"
bootstrap="bootstrap.php"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
strict="true"
>
<testsuite name="sabre-vobject">
<directory>../vendor/sabre/vobject/tests/VObject</directory>
</testsuite>
<testsuite name="sabre-event">
<directory>../vendor/sabre/event/tests/</directory>
</testsuite>
<testsuite name="sabre-http">
<directory>../vendor/sabre/http/tests/HTTP</directory>
</testsuite>
<testsuite name="sabre-dav">
<directory>Sabre/DAV</directory>
</testsuite>
<testsuite name="sabre-davacl">
<directory>Sabre/DAVACL</directory>
</testsuite>
<testsuite name="sabre-caldav">
<directory>Sabre/CalDAV</directory>
</testsuite>
<testsuite name="sabre-carddav">
<directory>Sabre/CardDAV</directory>
</testsuite>
<filter>
<whitelist addUncoveredFilesFromWhitelist="true">
<directory suffix=".php">../lib/</directory>
<exclude>
<file>../lib/Sabre/autoload.php</file>
<file>../lib/Sabre/VObject/includes.php</file>
</exclude>
</whitelist>
</filter>
</phpunit>

View File

@ -1,563 +0,0 @@
ChangeLog
=========
3.4.5 (2015-06-02)
------------------
* #229: Converting vcards from 3.0 to 4.0 that contained a `LANG` property
would throw an error.
3.4.4 (2015-05-27)
------------------
* #228: Fixed a 'party crasher' bug in the iTip broker. This would break
scheduling in some cases.
3.4.3 (2015-05-19)
------------------
* #219: Corrected validation of `EXDATE` properties with more than one value.
* #212: `BYSETPOS` with values below `-1` was broken and could cause infinite
loops.
* #211: Fix `BYDAY=-5TH` in recurrence iterator. (@lindquist)
* #216: `ENCODING` parameter is now validated for all document types.
* #217: Initializing vCard `DATE` objects with a PHP DateTime object will now
work correctly. (@thomascube)
3.4.2 (2015-02-25)
------------------
* #210: iTip: Replying to an event without a master event was broken.
3.4.1 (2015-02-24)
------------------
* A minor change to ensure that unittests work correctly in the sabre/dav
test-suite.
3.4.0 (2015-02-23)
------------------
* #196: Made parsing recurrence rules a lot faster on big calendars.
* Updated windows timezone mappings to latest unicode version.
* #202: Support for parsing and validating `VAVAILABILITY` components. (@Hywan)
* #195: PHP 5.3 compatibility in 'generatevcards' script. (@rickdenhaan)
* #205: Improving handling of multiple `EXDATE` when processing iTip changes.
(@armin-hackmann)
* #187: Fixed validator rules for `LAST-MODIFIED` properties.
* #188: Retain floating times when generating instances using
`Recur\EventIterator`.
* #203: Skip tests for timezones that are not supported on older PHP versions,
instead of a hard fail.
* #204: Dealing a bit better with vCard date-time values that contained
milliseconds. (which is normally invalid). (@armin-hackmann)
3.3.5 (2015-01-09)
------------------
* #168: Expanding calendars now removes objects with recurrence rules that
don't have a valid recurrence instance.
* #177: SCHEDULE-STATUS should not contain a reason phrase, only a status
code.
* #175: Parser can now read and skip the UTF-8 BOM.
* #179: Added `isFloating` to `DATE-TIME` properties.
* #179: Fixed jCal serialization of floating `DATE-TIME` properties.
* #173: vCard converter failed for `X-ABDATE` properties that had no
`X-ABLABEL`.
* #180: Added `PROFILE_CALDAV` and `PROFILE_CARDDAV` to enable validation rules
specific for CalDAV/CardDAV servers.
* #176: A missing `UID` is no longer an error, but a warning for the vCard
validator, unless `PROFILE_CARDDAV` is specified.
3.3.4 (2014-11-19)
------------------
* #154: Converting `ANNIVERSARY` to `X-ANNIVERSARY` and `X-ABDATE` and
vice-versa when converting to/from vCard 4.
* #154: It's now possible to easily select all vCard properties belonging to
a single group with `$vcard->{'ITEM1.'}` syntax. (@armin-hackmann)
* #156: Simpler way to check if a string is UTF-8. (@Hywan)
* Unittest improvements.
* #159: The recurrence iterator, freebusy generator and iCalendar DATE and
DATE-TIME properties can now all accept a reference timezone when working
floating times or all-day events.
* #159: Master events will no longer get a `RECURRENCE-ID` when expanding.
* #159: `RECURRENCE-ID` for all-day events will now be correct when expanding.
* #163: Added a `getTimeZone()` method to `VTIMEZONE` components.
3.3.3 (2014-10-09)
------------------
* #142: `CANCEL` and `REPLY` messages now include the `DTSTART` from the
original event.
* #143: `SCHEDULE-AGENT` on the `ORGANIZER` property is respected.
* #144: `PARTSTAT=NEEDS-ACTION` is now set for new invites, if no `PARTSTAT` is
set to support the inbox feature of iOS.
* #147: Bugs related to scheduling all-day events.
* #148: Ignore events that have attendees but no organizer.
* #149: Avoiding logging errors during timezone detection. This is a workaround
for a PHP bug.
* Support for "Line Islands Standard Time" windows timezone.
* #154: Correctly work around vCard parameters that have a value but no name.
3.3.2 (2014-09-19)
------------------
* Changed: iTip broker now sets RSVP status to false when replies are received.
* #118: iTip Message now has a `getScheduleStatus()` method.
* #119: Support for detecting 'significant changes'.
* #120: Support for `SCHEDULE-FORCE-SEND`.
* #121: iCal demands parameters containing the + sign to be quoted.
* #122: Don't generate REPLY messages for events that have been cancelled.
* #123: Added `SUMMARY` to iTip messages.
* #130: Incorrect validation rules for `RELATED` (should be `RELATED-TO`).
* #128: `ATTACH` in iCalendar is `URI` by default, not `BINARY`.
* #131: RRULE that doesn't provide a single valid instance now throws an
exception.
* #136: Validator rejects *all* control characters. We were missing a few.
* #133: Splitter objects will throw exceptions when receiving incompatible
objects.
* #127: Attendees who delete recurring event instances events they had already
declined earlier will no longer generate another reply.
* #125: Send CANCEL messages when ORGANIZER property gets deleted.
3.3.1 (2014-08-18)
------------------
* Changed: It's now possible to pass DateTime objects when using the magic
setters on properties. (`$event->DTSTART = new DateTime('now')`).
* #111: iTip Broker does not process attendee adding events to EXDATE.
* #112: EventIterator now sets TZID on RECURRENCE-ID.
* #113: Timezone support during creation of iTip REPLY messages.
* #114: VTIMEZONE is retained when generating new REQUEST objects.
* #114: Support for 'MAILTO:' style email addresses (in uppercase) in the iTip
broker. This improves evolution support.
* #115: Using REQUEST-STATUS from REPLY messages and now propegating that into
SCHEDULE-STATUS.
3.3.0 (2014-08-07)
------------------
* We now use PSR-4 for the directory structure. This means that everything
that was used to be in the `lib/Sabre/VObject` directory is now moved to
`lib/`. If you use composer to load this library, you shouldn't have to do
anything about that though.
* VEVENT now get populated with a DTSTAMP and UID property by default.
* BC Break: Removed the 'includes.php' file. Use composer instead.
* #103: Added support for processing [iTip][iTip] messages. This allows a user
to parse incoming iTip messages and apply the result on existing calendars,
or automatically generate invites/replies/cancellations based on changes that
a user made on objects.
* #75, #58, #18: Fixes related to overriding the first event in recurrences.
* Added: VCalendar::getBaseComponent to find the 'master' component in a
calendar.
* #51: Support for iterating RDATE properties.
* Fixed: Issue #101: RecurrenceIterator::nextMonthly() shows events that are
excluded events with wrong time
3.2.4 (2014-07-14)
------------------
* Added: Issue #98. The VCardConverter now takes `X-APPLE-OMIT-YEAR` into
consideration when converting between vCard 3 and 4.
* Fixed: Issue #96. Some support for Yahoo's broken vcards.
* Fixed: PHP 5.3 support was broken in the cli tool.
3.2.3 (2014-06-12)
------------------
* Validator now checks if DUE and DTSTART are of the same type in VTODO, and
ensures that DUE is always after DTSTART.
* Removed documentation from source repository, to http://sabre.io/vobject/
* Expanded the vobject cli tool validation output to make it easier to find
issues.
* Fixed: vobject repair. It was not working for iCalendar objects.
3.2.2 (2014-05-07)
------------------
* Minor tweak in unittests to make it run on PHP 5.5.12. Json-prettifying
slightly changed which caused the test to fail.
3.2.1 (2014-05-03)
------------------
* Minor tweak to make the unittests run with the latest hhvm on travis.
* Updated timezone definitions.
* Updated copyright links to point to http://sabre.io/
3.2.0 (2014-04-02)
------------------
* Now hhvm compatible!
* The validator can now detect a _lot_ more problems. Many rules for both
iCalendar and vCard were added.
* Added: bin/generate_vcards, a utility to generate random vcards for testing
purposes. Patches are welcome to add more data.
* Updated: Windows timezone mapping to latest version from unicode.org
* Changed: The timezone maps are now loaded in from external files, in
lib/Sabre/VObject/timezonedata.
* Added: Fixing badly encoded URL's from google contacts vcards.
* Fixed: Issue #68. Couldn't decode properties ending in a colon.
* Fixed: Issue #72. RecurrenceIterator should respect timezone in the UNTIL
clause.
* Fixed: Issue #67. BYMONTH limit on DAILY recurrences.
* Fixed: Issue #26. Return a more descriptive error when coming across broken
BYDAY rules.
* Fixed: Issue #28. Incorrect timezone detection for some timezones.
* Fixed: Issue #70. Casting a parameter with a null value to string would fail.
* Added: Support for rfc6715 and rfc6474.
* Added: Support for DateTime objects in the VCard DATE-AND-OR-TIME property.
* Added: UUIDUtil, for easily creating unique identifiers.
* Fixed: Issue #83. Creating new VALUE=DATE objects using php's DateTime.
* Fixed: Issue #86. Don't go into an infinite loop when php errors are
disabled and an invalid file is read.
3.1.4 (2014-03-30)
------------------
* Fixed: Issue #87: Several compatibility fixes related to timezone handling
changes in PHP 5.5.10.
3.1.3 (2013-10-02)
------------------
* Fixed: Support from properties from draft-daboo-valarm-extensions-04. Issue
#56.
* Fixed: Issue #54. Parsing a stream of multiple vcards separated by more than
one newline. Thanks @Vedmak for the patch.
* Fixed: Serializing vcard 2.1 parameters with no name caused a literal '1' to
be inserted.
* Added: VCardConverter removed properties that are no longer supported in vCard
4.0.
* Added: vCards with a minimum number of values (such as N), but don't have that
many, are now automatically padded with empty components.
* Added: The vCard validator now also checks for a minimum number of components,
and has the ability to repair these.
* Added: Some support for vCard 2.1 in the VCard converter, to upgrade to vCard
3.0 or 4.0.
* Fixed: Issue 60 Use Document::$componentMap when instantiating the top-level
VCalendar and VCard components.
* Fixed: Issue 62: Parsing iCalendar parameters with no value.
* Added: --forgiving option to vobject utility.
* Fixed: Compound properties such as ADR were not correctly split up in vCard
2.1 quoted printable-encoded properties.
* Fixed: Issue 64: Encoding of binary properties of converted vCards. Thanks
@DominikTo for the patch.
3.1.2 (2013-08-13)
------------------
* Fixed: Setting correct property group on VCard conversion
3.1.1 (2013-08-02)
------------------
* Fixed: Issue #53. A regression in RecurrenceIterator.
3.1.0 (2013-07-27)
------------------
* Added: bad-ass new cli debugging utility (in bin/vobject).
* Added: jCal and jCard parser.
* Fixed: URI properties should not escape ; and ,.
* Fixed: VCard 4 documents now correctly use URI as a default value-type for
PHOTO and others. BINARY no longer exists in vCard 4.
* Added: Utility to convert between 2.1, 3.0 and 4.0 vCards.
* Added: You can now add() multiple parameters to a property in one call.
* Added: Parameter::has() for easily checking if a parameter value exists.
* Added: VCard::preferred() to find a preferred email, phone number, etc for a
contact.
* Changed: All $duration properties are now public.
* Added: A few validators for iCalendar documents.
* Fixed: Issue #50. RecurrenceIterator gives incorrect result when exception
events are out of order in the iCalendar file.
* Fixed: Issue #48. Overridden events in the recurrence iterator that were past
the UNTIL date were ignored.
* Added: getDuration for DURATION values such as TRIGGER. Thanks to
@SimonSimCity.
* Fixed: Issue #52. vCard 2.1 parameters with no name may lose values if there's
more than 1. Thanks to @Vedmak.
3.0.0 (2013-06-21)
------------------
* Fixed: includes.php file was still broken. Our tool to generate it had some
bugs.
3.0.0-beta4 (2013-06-21)
------------------------
* Fixed: includes.php was no longer up to date.
3.0.0-beta3 (2013-06-17)
------------------------
* Added: OPTION_FORGIVING now also allows slashes in property names.
* Fixed: DateTimeParser no longer fails on dates with years < 1000 & > 4999
* Fixed: Issue 36: Workaround for the recurrenceiterator and caldav events with
a missing base event.
* Fixed: jCard encoding of TIME properties.
* Fixed: jCal encoding of REQUEST-STATUS, GEO and PERIOD values.
3.0.0-beta2 (2013-06-10)
------------------------
* Fixed: Corrected includes.php file.
* Fixed: vCard date-time parser supported extended-format dates as well.
* Changed: Properties have been moved to an ICalendar or VCard directory.
* Fixed: Couldn't parse vCard 3 extended format dates and times.
* Fixed: Couldn't export jCard DATE values correctly.
* Fixed: Recursive loop in ICalendar\DateTime property.
3.0.0-beta1 (2013-06-07)
------------------------
* Added: jsonSerialize() for creating jCal and jCard documents.
* Added: helper method to parse vCard dates and times.
* Added: Specialized classes for FLOAT, LANGUAGE-TAG, TIME, TIMESTAMP,
DATE-AND-OR-TIME, CAL-ADDRESS, UNKNOWN and UTC-OFFSET properties.
* Removed: CommaSeparatedText property. Now included into Text.
* Fixed: Multiple parameters with the same name are now correctly encoded.
* Fixed: Parameter values containing a comma are now enclosed in double-quotes.
* Fixed: Iterating parameter values should now fully work as expected.
* Fixed: Support for vCard 2.1 nameless parameters.
* Changed: $valueMap, $componentMap and $propertyMap now all use fully-qualified
class names, so they are actually overridable.
* Fixed: Updating DATE-TIME to DATE values now behaves like expected.
3.0.0-alpha4 (2013-05-31)
-------------------------
* Added: It's now possible to send parser options to the splitter classes.
* Added: A few tweaks to improve component and property creation.
3.0.0-alpha3 (2013-05-13)
-------------------------
* Changed: propertyMap, valueMap and componentMap are now static properties.
* Changed: Component::remove() will throw an exception when trying to a node
that's not a child of said component.
* Added: Splitter objects are now faster, line numbers are accurately reported
and use less memory.
* Added: MimeDir parser can now continue parsing with the same stream buffer.
* Fixed: vobjectvalidate.php is operational again.
* Fixed: \r is properly stripped in text values.
* Fixed: QUOTED-PRINTABLE is now correctly encoded as well as encoded, for
vCards 2.1.
* Fixed: Parser assumes vCard 2.1, if no version was supplied.
3.0.0-alpha2 (2013-05-22)
-------------------------
* Fixed: vCard URL properties were referencing a non-existant class.
3.0.0-alpha1 (2013-05-21)
-------------------------
* Fixed: Now correctly dealing with escaping of properties. This solves the
problem with double-backslashes where they don't belong.
* Added: Easy support for properties with more than one value, using setParts
and getParts.
* Added: Support for broken 2.1 vCards produced by microsoft.
* Added: Automatically decoding quoted-printable values.
* Added: Automatically decoding base64 values.
* Added: Decoding RFC6868 parameter values (uses ^ as an escape character).
* Added: Fancy new MimeDir parser that can also parse streams.
* Added: Automatically mapping many, many properties to a property-class with
specialized API's.
* Added: remove() method for easily removing properties and sub-components
components.
* Changed: Components, Properties and Parameters can no longer be created with
Component::create, Property::create and Parameter::create. They must instead
be created through the root component. (A VCalendar or VCard object).
* Changed: API for DateTime properties has slightly changed.
* Changed: the ->value property is now protected everywhere. Use getParts() and
getValue() instead.
* BC Break: No support for mac newlines (\r). Never came across these anyway.
* Added: add() method to the Property class.
* Added: It's now possible to easy set multi-value properties as arrays.
* Added: When setting date-time properties you can just pass PHP's DateTime
object.
* Added: New components automatically get a bunch of default properties, such as
VERSION and CALSCALE.
* Added: You can add new sub-components much quicker with the magic setters, and
add() method.
2.1.7 (2015-01-21)
------------------
* Fixed: Issue #94, a workaround for bad escaping of ; and , in compound
properties. It's not a full solution, but it's an improvement for those
stuck in the 2.1 versions.
2.1.6 (2014-12-10)
------------------
* Fixed: Minor change to make sure that unittests succeed on every PHP version.
2.1.5 (2014-06-03)
------------------
* Fixed: #94: Better parameter escaping.
* Changed: Documentation cleanups.
2.1.4 (2014-03-30)
------------------
* Fixed: Issue #87: Several compatibility fixes related to timezone handling
changes in PHP 5.5.10.
2.1.3 (2013-10-02)
------------------
* Fixed: Issue #55. \r must be stripped from property values.
* Fixed: Issue #65. Putting quotes around parameter values that contain a colon.
2.1.2 (2013-08-02)
------------------
* Fixed: Issue #53. A regression in RecurrenceIterator.
2.1.1 (2013-07-27)
------------------
* Fixed: Issue #50. RecurrenceIterator gives incorrect result when exception
events are out of order in the iCalendar file.
* Fixed: Issue #48. Overridden events in the recurrence iterator that were past
the UNTIL date were ignored.
2.1.0 (2013-06-17)
------------------
* This version is fully backwards compatible with 2.0.\*. However, it contains a
few new API's that mimic the VObject 3 API. This allows it to be used a
'bridge' version. Specifically, this new version exists so SabreDAV 1.7 and
1.8 can run with both the 2 and 3 versions of this library.
* Added: Property\DateTime::hasTime().
* Added: Property\MultiDateTime::hasTime().
* Added: Property::getValue().
* Added: Document class.
* Added: Document::createComponent and Document::createProperty.
* Added: Parameter::getValue().
2.0.7 (2013-03-05)
------------------
* Fixed: Microsoft re-uses their magic numbers for different timezones,
specifically id 2 for both Sarajevo and Lisbon). A workaround was added to
deal with this.
2.0.6 (2013-02-17)
------------------
* Fixed: The reader now properly parses parameters without a value.
2.0.5 (2012-11-05)
------------------
* Fixed: The FreeBusyGenerator is now properly using the factory methods for
creation of components and properties.
2.0.4 (2012-11-02)
------------------
* Added: Known Lotus Notes / Domino timezone id's.
2.0.3 (2012-10-29)
------------------
* Added: Support for 'GMT+????' format in TZID's.
* Added: Support for formats like SystemV/EST5EDT in TZID's.
* Fixed: RecurrenceIterator now repairs recurrence rules where UNTIL < DTSTART.
* Added: Support for BYHOUR in FREQ=DAILY (@hollodk).
* Added: Support for BYHOUR and BYDAY in FREQ=WEEKLY.
2.0.2 (2012-10-06)
------------------
* Added: includes.php file, to load the entire library in one go.
* Fixed: A problem with determining alarm triggers for TODO's.
2.0.1 (2012-09-22)
------------------
* Removed: Element class. It wasn't used.
* Added: Basic validation and repair methods for broken input data.
* Fixed: RecurrenceIterator could infinitely loop when an INTERVAL of 0 was
specified.
* Added: A cli script that can validate and automatically repair vcards and
iCalendar objects.
* Added: A new 'Compound' property, that can automatically split up parts for
properties such as N, ADR, ORG and CATEGORIES.
* Added: Splitter classes, that can split up large objects (such as exports)
into individual objects (thanks @DominikTO and @armin-hackmann).
* Added: VFREEBUSY component, which allows easily checking wether timeslots are
available.
* Added: The Reader class now has a 'FORGIVING' option, which allows it to parse
properties with incorrect characters in the name (at this time, it just allows
underscores).
* Added: Also added the 'IGNORE_INVALID_LINES' option, to completely disregard
any invalid lines.
* Fixed: A bug in Windows timezone-id mappings for times created in Greenlands
timezone (sorry Greenlanders! I do care!).
* Fixed: DTEND was not generated correctly for VFREEBUSY reports.
* Fixed: Parser is at least 25% faster with real-world data.
2.0.0 (2012-08-08)
------------------
* VObject is now a separate project from SabreDAV. See the SabreDAV changelog
for version information before 2.0.
* New: VObject library now uses PHP 5.3 namespaces.
* New: It's possible to specify lists of parameters when constructing
properties.
* New: made it easier to construct the FreeBusyGenerator.
[iTip]: http://tools.ietf.org/html/rfc5546

View File

@ -1,104 +0,0 @@
<?php
namespace Sabre\VObject\Property;
use
Sabre\VObject\Property;
/**
* Float property
*
* This object represents FLOAT values. These can be 1 or more floating-point
* numbers.
*
* @copyright Copyright (C) 2011-2015 fruux GmbH (https://fruux.com/).
* @author Evert Pot (http://evertpot.com/)
* @license http://sabre.io/license/ Modified BSD License
*/
class Float extends Property {
/**
* In case this is a multi-value property. This string will be used as a
* delimiter.
*
* @var string|null
*/
public $delimiter = ';';
/**
* Sets a raw value coming from a mimedir (iCalendar/vCard) file.
*
* This has been 'unfolded', so only 1 line will be passed. Unescaping is
* not yet done, but parameters are not included.
*
* @param string $val
* @return void
*/
public function setRawMimeDirValue($val) {
$val = explode($this->delimiter, $val);
foreach($val as &$item) {
$item = (float)$item;
}
$this->setParts($val);
}
/**
* Returns a raw mime-dir representation of the value.
*
* @return string
*/
public function getRawMimeDirValue() {
return implode(
$this->delimiter,
$this->getParts()
);
}
/**
* Returns the type of value.
*
* This corresponds to the VALUE= parameter. Every property also has a
* 'default' valueType.
*
* @return string
*/
public function getValueType() {
return "FLOAT";
}
/**
* Returns the value, in the format it should be encoded for json.
*
* This method must always return an array.
*
* @return array
*/
public function getJsonValue() {
$val = array_map(
function($item) {
return (float)$item;
},
$this->getParts()
);
// Special-casing the GEO property.
//
// See:
// http://tools.ietf.org/html/draft-ietf-jcardcal-jcal-04#section-3.4.1.2
if ($this->name==='GEO') {
return array($val);
} else {
return $val;
}
}
}

View File

@ -1,72 +0,0 @@
<?php
namespace Sabre\VObject\Property;
use
Sabre\VObject\Property;
/**
* Integer property
*
* This object represents INTEGER values. These are always a single integer.
* They may be preceeded by either + or -.
*
* @copyright Copyright (C) 2011-2015 fruux GmbH (https://fruux.com/).
* @author Evert Pot (http://evertpot.com/)
* @license http://sabre.io/license/ Modified BSD License
*/
class Integer extends Property {
/**
* Sets a raw value coming from a mimedir (iCalendar/vCard) file.
*
* This has been 'unfolded', so only 1 line will be passed. Unescaping is
* not yet done, but parameters are not included.
*
* @param string $val
* @return void
*/
public function setRawMimeDirValue($val) {
$this->setValue((int)$val);
}
/**
* Returns a raw mime-dir representation of the value.
*
* @return string
*/
public function getRawMimeDirValue() {
return $this->value;
}
/**
* Returns the type of value.
*
* This corresponds to the VALUE= parameter. Every property also has a
* 'default' valueType.
*
* @return string
*/
public function getValueType() {
return "INTEGER";
}
/**
* Returns the value, in the format it should be encoded for json.
*
* This method must always return an array.
*
* @return array
*/
public function getJsonValue() {
return array((int)$this->getValue());
}
}

View File

@ -1,21 +0,0 @@
<?php
namespace Sabre\VObject;
use Sabre\VObject\Recur\EventIterator;
/**
* RecurrenceIterator
*
* This class is deprecated. Use Sabre\VObject\Recur\EventIterator instead.
* This class will be removed from a future version.
*
* @copyright Copyright (C) 2011-2015 fruux GmbH (https://fruux.com/).
* @author Evert Pot (http://evertpot.com/)
* @deprecated
* @license http://sabre.io/license Modified BSD License
*/
class RecurrenceIterator extends EventIterator {
}