Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge

This commit is contained in:
zotlabs 2017-05-04 19:20:29 -07:00
commit e308c3d34a
184 changed files with 918 additions and 2697 deletions

View File

@ -318,6 +318,7 @@ class Import extends \Zotlabs\Web\Controller {
unset($abook['abconfig']);
unset($abook['abook_their_perms']);
unset($abook['abook_my_perms']);
unset($abook['abook_not_here']);
$abook['abook_account'] = $account_id;
$abook['abook_channel'] = $channel['channel_id'];
@ -347,7 +348,7 @@ class Import extends \Zotlabs\Web\Controller {
continue;
}
create_table_from_array('abook',$abook);
abook_store_lowlevel($abook);
$friends ++;
if(intval($abook['abook_feed']))

View File

@ -49,10 +49,10 @@ require_once('include/hubloc.php');
define ( 'PLATFORM_NAME', 'hubzilla' );
define ( 'STD_VERSION', '2.3.5' );
define ( 'STD_VERSION', '2.5' );
define ( 'ZOT_REVISION', '1.2' );
define ( 'DB_UPDATE_VERSION', 1190 );
define ( 'DB_UPDATE_VERSION', 1191 );
define ( 'PROJECT_BASE', __DIR__ );

View File

@ -33,7 +33,7 @@
"pixel418/markdownify": "^2.2",
"bshaffer/oauth2-server-php": "^1.9",
"ezyang/htmlpurifier": "^4.9",
"simplepie/simplepie": ">=1.4.4 || dev-master"
"simplepie/simplepie": "~1.5"
},
"require-dev" : {
"php" : ">=7.0",

29
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"content-hash": "62261cde663585403a8dd8fda5b85a95",
"content-hash": "21511c39f481ecdc20210f885d840787",
"packages": [
{
"name": "bshaffer/oauth2-server-php",
@ -265,16 +265,16 @@
},
{
"name": "sabre/dav",
"version": "3.2.0",
"version": "3.2.2",
"source": {
"type": "git",
"url": "https://github.com/fruux/sabre-dav.git",
"reference": "5b9737cc2f0182e368d14c80df7f6b2d77dc1457"
"reference": "e987775e619728f12205606c9cc3ee565ffb1516"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/fruux/sabre-dav/zipball/5b9737cc2f0182e368d14c80df7f6b2d77dc1457",
"reference": "5b9737cc2f0182e368d14c80df7f6b2d77dc1457",
"url": "https://api.github.com/repos/fruux/sabre-dav/zipball/e987775e619728f12205606c9cc3ee565ffb1516",
"reference": "e987775e619728f12205606c9cc3ee565ffb1516",
"shasum": ""
},
"require": {
@ -298,8 +298,8 @@
"require-dev": {
"evert/phpdoc-md": "~0.1.0",
"monolog/monolog": "^1.18",
"phpunit/phpunit": "> 4.8, <=6.0.0",
"sabre/cs": "~0.0.5"
"phpunit/phpunit": "> 4.8, <6.0.0",
"sabre/cs": "^1.0.0"
},
"suggest": {
"ext-curl": "*",
@ -344,7 +344,7 @@
"framework",
"iCalendar"
],
"time": "2016-06-28T02:44:05+00:00"
"time": "2017-02-15T03:06:08+00:00"
},
{
"name": "sabre/event",
@ -671,16 +671,16 @@
},
{
"name": "simplepie/simplepie",
"version": "dev-master",
"version": "1.5",
"source": {
"type": "git",
"url": "https://github.com/simplepie/simplepie.git",
"reference": "59e7204610d3a8989822eba1c0cbf1d1680bd10d"
"reference": "5de5551953f95feef12cf355a7a26a70f94aa3ab"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/simplepie/simplepie/zipball/59e7204610d3a8989822eba1c0cbf1d1680bd10d",
"reference": "59e7204610d3a8989822eba1c0cbf1d1680bd10d",
"url": "https://api.github.com/repos/simplepie/simplepie/zipball/5de5551953f95feef12cf355a7a26a70f94aa3ab",
"reference": "5de5551953f95feef12cf355a7a26a70f94aa3ab",
"shasum": ""
},
"require": {
@ -727,10 +727,10 @@
"rss"
],
"support": {
"source": "https://github.com/simplepie/simplepie/tree/master",
"source": "https://github.com/simplepie/simplepie/tree/1.5",
"issues": "https://github.com/simplepie/simplepie/issues"
},
"time": "2017-04-06 03:36:48"
"time": "2017-04-17T07:29:31+00:00"
}
],
"packages-dev": [
@ -3675,7 +3675,6 @@
"aliases": [],
"minimum-stability": "stable",
"stability-flags": {
"simplepie/simplepie": 20,
"behat/behat": 0,
"behat/mink-extension": 0,
"behat/mink-goutte-driver": 0

View File

@ -182,4 +182,5 @@ even if we have had our occasional disagreements.
[li]Simó Albert i Beltran[/li]
[li]Manuel Reva[/li]
[li]Manuel Jiménez Friaza[/li]
[/list]
[li]Gustav Wall aka "neue medienordnung plus"[/li]
[/list]

View File

@ -23,6 +23,7 @@ function abook_store_lowlevel($arr) {
'abook_unconnected' => ((array_key_exists('abook_unconnected',$arr)) ? $arr['abook_unconnected'] : 0),
'abook_self' => ((array_key_exists('abook_self',$arr)) ? $arr['abook_self'] : 0),
'abook_feed' => ((array_key_exists('abook_feed',$arr)) ? $arr['abook_feed'] : 0),
'abook_not_here' => ((array_key_exists('abook_not_here',$arr)) ? $arr['abook_not_here'] : 0),
'abook_profile' => ((array_key_exists('abook_profile',$arr)) ? $arr['abook_profile'] : ''),
'abook_incl' => ((array_key_exists('abook_incl',$arr)) ? $arr['abook_incl'] : ''),
'abook_excl' => ((array_key_exists('abook_excl',$arr)) ? $arr['abook_excl'] : ''),

View File

@ -3226,12 +3226,10 @@ function process_channel_sync_delivery($sender, $arr, $deliveries) {
}
$disallowed = array('abook_id','abook_account','abook_channel','abook_rating','abook_rating_text');
$disallowed = array('abook_id','abook_account','abook_channel','abook_rating','abook_rating_text','abook_not_here');
foreach($arr['abook'] as $abook) {
$abconfig = null;
if(array_key_exists('abconfig',$abook) && is_array($abook['abconfig']) && count($abook['abconfig']))

View File

@ -34,6 +34,7 @@ CREATE TABLE IF NOT EXISTS `abook` (
`abook_unconnected` tinyint(4) NOT NULL DEFAULT '0',
`abook_self` tinyint(4) NOT NULL DEFAULT '0',
`abook_feed` tinyint(4) NOT NULL DEFAULT '0',
`abook_not_here` tinyint(4) NOT NULL DEFAULT '0',
`abook_profile` char(64) NOT NULL DEFAULT '',
`abook_incl` TEXT NOT NULL DEFAULT '',
`abook_excl` TEXT NOT NULL DEFAULT '',
@ -58,6 +59,7 @@ CREATE TABLE IF NOT EXISTS `abook` (
KEY `abook_pending` (`abook_pending`),
KEY `abook_unconnected` (`abook_unconnected`),
KEY `abook_self` (`abook_self`),
KEY `abook_not_here` (`abook_not_here`),
KEY `abook_feed` (`abook_feed`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

View File

@ -32,6 +32,7 @@ CREATE TABLE "abook" (
"abook_unconnected" smallint NOT NULL DEFAULT '0',
"abook_self" smallint NOT NULL DEFAULT '0',
"abook_feed" smallint NOT NULL DEFAULT '0',
"abook_not_here" smallint NOT NULL DEFAULT '0',
"abook_profile" char(64) NOT NULL DEFAULT '',
"abook_incl" TEXT NOT NULL DEFAULT '',
"abook_excl" TEXT NOT NULL DEFAULT '',
@ -55,6 +56,7 @@ CREATE TABLE "abook" (
create index "abook_unconnected" on abook ("abook_unconnected");
create index "abook_self" on abook ("abook_self");
create index "abook_feed" on abook ("abook_feed");
create index "abook_not_here" on abook ("abook_not_here");
create index "abook_profile" on abook ("abook_profile");
create index "abook_dob" on abook ("abook_dob");
create index "abook_connected" on abook ("abook_connected");

View File

@ -1,6 +1,6 @@
<?php
define( 'UPDATE_VERSION' , 1190 );
define( 'UPDATE_VERSION' , 1191 );
/**
*
@ -2532,3 +2532,12 @@ function update_r1189() {
}
function update_r1190() {
$r1 = q("alter table abook add abook_not_here int(11) not null default '0' ");
$r2 = q("create index abook_not_here on abook (abook_not_here)");
if($r1 && $r2)
return UPDATE_SUCCESS;
return UPDATE_FAILED;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -267,91 +267,6 @@
"http"
]
},
{
"name": "sabre/dav",
"version": "3.2.0",
"version_normalized": "3.2.0.0",
"source": {
"type": "git",
"url": "https://github.com/fruux/sabre-dav.git",
"reference": "5b9737cc2f0182e368d14c80df7f6b2d77dc1457"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/fruux/sabre-dav/zipball/5b9737cc2f0182e368d14c80df7f6b2d77dc1457",
"reference": "5b9737cc2f0182e368d14c80df7f6b2d77dc1457",
"shasum": ""
},
"require": {
"ext-ctype": "*",
"ext-date": "*",
"ext-dom": "*",
"ext-iconv": "*",
"ext-mbstring": "*",
"ext-pcre": "*",
"ext-simplexml": "*",
"ext-spl": "*",
"lib-libxml": ">=2.7.0",
"php": ">=5.5.0",
"psr/log": "^1.0",
"sabre/event": ">=2.0.0, <4.0.0",
"sabre/http": "^4.2.1",
"sabre/uri": "^1.0.1",
"sabre/vobject": "^4.1.0",
"sabre/xml": "^1.4.0"
},
"require-dev": {
"evert/phpdoc-md": "~0.1.0",
"monolog/monolog": "^1.18",
"phpunit/phpunit": "> 4.8, <=6.0.0",
"sabre/cs": "~0.0.5"
},
"suggest": {
"ext-curl": "*",
"ext-pdo": "*"
},
"time": "2016-06-28T02:44:05+00:00",
"bin": [
"bin/sabredav",
"bin/naturalselection"
],
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.1.0-dev"
}
},
"installation-source": "dist",
"autoload": {
"psr-4": {
"Sabre\\DAV\\": "lib/DAV/",
"Sabre\\DAVACL\\": "lib/DAVACL/",
"Sabre\\CalDAV\\": "lib/CalDAV/",
"Sabre\\CardDAV\\": "lib/CardDAV/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Evert Pot",
"email": "me@evertpot.com",
"homepage": "http://evertpot.com/",
"role": "Developer"
}
],
"description": "WebDAV Framework for PHP",
"homepage": "http://sabre.io/",
"keywords": [
"CalDAV",
"CardDAV",
"WebDAV",
"framework",
"iCalendar"
]
},
{
"name": "sabre/xml",
"version": "1.5.0",
@ -686,17 +601,17 @@
},
{
"name": "simplepie/simplepie",
"version": "dev-master",
"version_normalized": "9999999-dev",
"version": "1.5",
"version_normalized": "1.5.0.0",
"source": {
"type": "git",
"url": "https://github.com/simplepie/simplepie.git",
"reference": "59e7204610d3a8989822eba1c0cbf1d1680bd10d"
"reference": "5de5551953f95feef12cf355a7a26a70f94aa3ab"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/simplepie/simplepie/zipball/59e7204610d3a8989822eba1c0cbf1d1680bd10d",
"reference": "59e7204610d3a8989822eba1c0cbf1d1680bd10d",
"url": "https://api.github.com/repos/simplepie/simplepie/zipball/5de5551953f95feef12cf355a7a26a70f94aa3ab",
"reference": "5de5551953f95feef12cf355a7a26a70f94aa3ab",
"shasum": ""
},
"require": {
@ -708,7 +623,7 @@
"suggest": {
"mf2/mf2": "Microformat module that allows for parsing HTML for microformats"
},
"time": "2017-04-06T03:36:48+00:00",
"time": "2017-04-17T07:29:31+00:00",
"type": "library",
"installation-source": "source",
"autoload": {
@ -745,8 +660,93 @@
"rss"
],
"support": {
"source": "https://github.com/simplepie/simplepie/tree/master",
"source": "https://github.com/simplepie/simplepie/tree/1.5",
"issues": "https://github.com/simplepie/simplepie/issues"
}
},
{
"name": "sabre/dav",
"version": "3.2.2",
"version_normalized": "3.2.2.0",
"source": {
"type": "git",
"url": "https://github.com/fruux/sabre-dav.git",
"reference": "e987775e619728f12205606c9cc3ee565ffb1516"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/fruux/sabre-dav/zipball/e987775e619728f12205606c9cc3ee565ffb1516",
"reference": "e987775e619728f12205606c9cc3ee565ffb1516",
"shasum": ""
},
"require": {
"ext-ctype": "*",
"ext-date": "*",
"ext-dom": "*",
"ext-iconv": "*",
"ext-mbstring": "*",
"ext-pcre": "*",
"ext-simplexml": "*",
"ext-spl": "*",
"lib-libxml": ">=2.7.0",
"php": ">=5.5.0",
"psr/log": "^1.0",
"sabre/event": ">=2.0.0, <4.0.0",
"sabre/http": "^4.2.1",
"sabre/uri": "^1.0.1",
"sabre/vobject": "^4.1.0",
"sabre/xml": "^1.4.0"
},
"require-dev": {
"evert/phpdoc-md": "~0.1.0",
"monolog/monolog": "^1.18",
"phpunit/phpunit": "> 4.8, <6.0.0",
"sabre/cs": "^1.0.0"
},
"suggest": {
"ext-curl": "*",
"ext-pdo": "*"
},
"time": "2017-02-15T03:06:08+00:00",
"bin": [
"bin/sabredav",
"bin/naturalselection"
],
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.1.0-dev"
}
},
"installation-source": "dist",
"autoload": {
"psr-4": {
"Sabre\\DAV\\": "lib/DAV/",
"Sabre\\DAVACL\\": "lib/DAVACL/",
"Sabre\\CalDAV\\": "lib/CalDAV/",
"Sabre\\CardDAV\\": "lib/CardDAV/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Evert Pot",
"email": "me@evertpot.com",
"homepage": "http://evertpot.com/",
"role": "Developer"
}
],
"description": "WebDAV Framework for PHP",
"homepage": "http://sabre.io/",
"keywords": [
"CalDAV",
"CardDAV",
"WebDAV",
"framework",
"iCalendar"
]
}
]

View File

@ -2,7 +2,9 @@ language: php
php:
- 5.5
- 5.6
- 7
- 7.0
- 7.1
env:
matrix:
@ -19,7 +21,6 @@ before_script:
- mysql -e 'create database sabredav_test'
- psql -c "create database sabredav_test" -U postgres
- psql -c "create user sabredav with PASSWORD 'sabredav';GRANT ALL PRIVILEGES ON DATABASE sabredav_test TO sabredav" -U postgres
- phpenv config-rm xdebug.ini; true
# - composer self-update
- composer update --prefer-dist $LOWEST_DEPS
@ -28,7 +29,7 @@ before_script:
script:
- ./bin/phpunit --configuration tests/phpunit.xml.dist $TEST_DEPS
- ./bin/sabre-cs-fixer fix lib/ --dry-run --diff
- ./bin/sabre-cs-fixer fix . --dry-run --diff
cache:
directories:

View File

@ -1,6 +1,28 @@
ChangeLog
=========
3.2.2 (2017-02-14)
------------------
* #943: Fix CardDAV XML reporting bug, which was affecting several CardDAV
clients. Bug was introduced in 3.2.1.
* The zip release ships with [sabre/vobject 4.1.2][vobj],
[sabre/http 4.2.2][http], [sabre/event 3.0.0][evnt],
[sabre/uri 1.2.0][uri] and [sabre/xml 1.5.0][xml].
3.2.1 (2017-01-28)
------------------
* #877: Fix for syncing large calendars when using the Sqlite PDO backend.
(@theseer).
* #889 Added support for filtering vCard properties in the addressbook-query
REPORT (@DeepDiver1975).
* The zip release ships with [sabre/vobject 4.1.2][vobj],
[sabre/http 4.2.2][http], [sabre/event 3.0.0][evnt],
[sabre/uri 1.2.0][uri] and [sabre/xml 1.5.0][xml].
3.2.0 (2016-06-27)
------------------
@ -88,6 +110,9 @@ ChangeLog
------------------
* Fixed: Creating a new calendar on some MySQL configurations caused an error.
* #889 Added support for filtering vCard properties in the addressbook-query
REPORT (@DeepDiver1975).
3.1.4 (2016-05-28)
@ -200,6 +225,13 @@ ChangeLog
[sabre/uri 1.0.1][uri] and [sabre/xml 1.1.0][xml].
3.0.10 (2016-??-??)
------------------
* #889 Added support for filtering vCard properties in the addressbook-query
REPORT (@DeepDiver1975).
3.0.9 (2016-04-06)
------------------
@ -463,11 +495,13 @@ ChangeLog
* #193: Fix `Sabre\DAV\FSExt\Directory::getQuotaInfo()` on windows.
2.1.11 (2016-??-??)
2.1.11 (2016-10-06)
-------------------
* #805: It wasn't possible to create calendars that hold events, journals and
todos using MySQL, because the `components` column was 1 byte too small.
* The zip release ships with [sabre/vobject 3.5.3][vobj],
[sabre/http 3.0.5][http], and [sabre/event 2.0.2][evnt].
2.1.10 (2016-03-10)
@ -475,6 +509,8 @@ ChangeLog
* #784: Sync logs for address books were not correctly cleaned up after
deleting them.
* The zip release ships with [sabre/vobject 3.5.0][vobj],
[sabre/http 3.0.5][http], and [sabre/event 2.0.2][evnt].
2.1.9 (2016-01-25)
@ -627,7 +663,7 @@ ChangeLog
* Added: Automatically converting between vCard 3, 4 and jCard using the
`Accept:` header, in CardDAV reports, and automatically converting from
jCard to vCard upon `PUT`. It's important to note that your backends _may_
now recieve both vCard 3.0 and 4.0.
now receive both vCard 3.0 and 4.0.
* Added: #444. Collections can now opt-in to support high-speed `MOVE`.
* Changed: PropertyStorage backends now have a `move` method.
* Added: `beforeMove`, and `afterMove` events.
@ -812,7 +848,7 @@ ChangeLog
* Added: Support for the `{DAV:}supported-method-set` property server-wide.
* Making it easier for implementors to override how the CardDAV addressbook
home is located.
* Fixed: Issue #422 Preconditions were not being set on PUT on non-existant
* Fixed: Issue #422 Preconditions were not being set on PUT on non-existent
files. Not really a chance for data-loss, but incorrect nevertheless.
* Fixed: Issue #428: Etag check with `If:` fails if the target is a collection.
* Fixed: Issues #430, #431, #433: Locks plugin didn't not properly release
@ -1024,7 +1060,7 @@ ChangeLog
* Added: Sharee's can now also read out the list of invites for a shared
calendar.
* Added: The Proxy principal classes now both implement an interface, for
greater flexiblity.
greater flexibility.
1.7.13 (2014-07-28)
@ -1042,7 +1078,7 @@ ChangeLog
Sabre_DAV_PartialUpdate_IFile interface is now deprecated and will be removed
in a future version.
* Fixed: Restoring old setting after changing libxml_disable_entity_loader.
* Fixed: Issue #422: Preconditions were not being set on PUT on non-existant
* Fixed: Issue #422: Preconditions were not being set on PUT on non-existent
files. Not really a chance for data-loss, but incorrect nevertheless.
* Fixed: Issue #427: Now checking preconditions on DELETE requests.
* Fixed: Issue #428: Etag check with If: fails if the target is a collection.
@ -1121,7 +1157,7 @@ ChangeLog
------------------
* The zip release ships with sabre/vobject 2.0.5.
* Changed: To be compatibile with MS Office 2011 for Mac, a workaround was
* Changed: To be compatible with MS Office 2011 for Mac, a workaround was
removed that was added to support old versions of Windows XP (pre-SP3).
Indeed! We needed a crazy workaround to work with one MS product in the past,
and we can't keep that workaround to be compatible with another MS product.
@ -1129,7 +1165,7 @@ ChangeLog
* Fixed: Range requests now work for non-seekable streams. (Thanks Alfred
Klomp).
* Fixed: Changed serialization of {DAV:}getlastmodified and {DAV:}supportedlock
to improve compatiblity with MS Office 2011 for Mac.
to improve compatibility with MS Office 2011 for Mac.
* Changed: reverted the automatic translation of 'DAV:' xml namespaces to
'urn:DAV' when parsing files. Issues were reported with libxml 2.6.32, on a
relatively recent debian release, so we'll wait till 2015 to take this one out
@ -2006,7 +2042,7 @@ ChangeLog
-------------------
* Fixed: Issue 34: Invalid Lock-Token header response.
* Added: Issue 35: Addign SabreDAV version to HTTP OPTIONS responses.
* Added: Issue 35: Adding SabreDAV version to HTTP OPTIONS responses.
1.0.9 (2010-03-19)
@ -2220,7 +2256,7 @@ ChangeLog
* Added: Simple HTML directory plugin, for browser access.
* Added: Server class now sends back standard pre-condition error xml bodies.
This was new since RFC4918.
* Added: Sabre_DAV_Tree_Aggregrate, which can 'host' multiple Tree objects into
* Added: Sabre_DAV_Tree_Aggregate, which can 'host' multiple Tree objects into
one.
* Added: simple basis for HTTP REPORT method. This method is not used yet, but
can be used by plugins to add reports.
@ -2237,7 +2273,7 @@ ChangeLog
8.2.
* Fixed: TemporaryFileFilter now lets through GET's if they actually exist on
the backend. (r274)
* FIxed: Some methods didn't get passed through in the FilterTree (r283).
* Fixed: Some methods didn't get passed through in the FilterTree (r283).
* Fixed: LockManager is now slightly more complex, Tree classes slightly less.
(r287)

View File

@ -10,6 +10,7 @@ Full documentation can be found on the website:
http://sabre.io/
Build status
------------
@ -30,6 +31,7 @@ Documentation
* [Introduction](http://sabre.io/dav/).
* [Installation](http://sabre.io/dav/install/).
Made at fruux
-------------

View File

@ -32,9 +32,9 @@
"psr/log": "^1.0"
},
"require-dev" : {
"phpunit/phpunit" : "> 4.8, <=6.0.0",
"phpunit/phpunit" : "> 4.8, <6.0.0",
"evert/phpdoc-md" : "~0.1.0",
"sabre/cs" : "~0.0.5",
"sabre/cs" : "^1.0.0",
"monolog/monolog": "^1.18"
},
"suggest" : {

View File

@ -2,8 +2,8 @@
namespace Sabre\CalDAV\Backend;
use Sabre\VObject;
use Sabre\CalDAV;
use Sabre\VObject;
/**
* Abstract Calendaring backend. Extend this class to create your own backends.
@ -26,9 +26,9 @@ abstract class AbstractBackend implements BackendInterface {
* Calling the handle method is like telling the PropPatch object "I
* promise I can handle updating this property".
*
* Read the PropPatch documenation for more info and examples.
* Read the PropPatch documentation for more info and examples.
*
* @param string $path
* @param mixed $calendarId
* @param \Sabre\DAV\PropPatch $propPatch
* @return void
*/

View File

@ -49,8 +49,8 @@ interface NotificationSupport extends BackendInterface {
* If the user chose to accept the share, this method should return the
* newly created calendar url.
*
* @param string href The sharee who is replying (often a mailto: address)
* @param int status One of the SharingPlugin::STATUS_* constants
* @param string $href The sharee who is replying (often a mailto: address)
* @param int $status One of the SharingPlugin::STATUS_* constants
* @param string $calendarUri The url to the calendar thats being shared
* @param string $inReplyTo The unique id this message is a response to
* @param string $summary A description of the reply

View File

@ -5,8 +5,8 @@ namespace Sabre\CalDAV\Backend;
use Sabre\CalDAV;
use Sabre\DAV;
use Sabre\DAV\Exception\Forbidden;
use Sabre\VObject;
use Sabre\DAV\Xml\Element\Sharee;
use Sabre\VObject;
/**
* PDO CalDAV backend
@ -296,7 +296,7 @@ SQL
* Calling the handle method is like telling the PropPatch object "I
* promise I can handle updating this property".
*
* Read the PropPatch documenation for more info and examples.
* Read the PropPatch documentation for more info and examples.
*
* @param mixed $calendarId
* @param \Sabre\DAV\PropPatch $propPatch
@ -481,13 +481,13 @@ SQL
if (!$row) return null;
return [
'id' => $row['id'],
'uri' => $row['uri'],
'lastmodified' => (int)$row['lastmodified'],
'etag' => '"' . $row['etag'] . '"',
'size' => (int)$row['size'],
'calendardata' => $row['calendardata'],
'component' => strtolower($row['componenttype']),
'id' => $row['id'],
'uri' => $row['uri'],
'lastmodified' => (int)$row['lastmodified'],
'etag' => '"' . $row['etag'] . '"',
'size' => (int)$row['size'],
'calendardata' => $row['calendardata'],
'component' => strtolower($row['componenttype']),
];
}
@ -511,27 +511,29 @@ SQL
}
list($calendarId, $instanceId) = $calendarId;
$query = 'SELECT id, uri, lastmodified, etag, calendarid, size, calendardata, componenttype FROM ' . $this->calendarObjectTableName . ' WHERE calendarid = ? AND uri IN (';
// Inserting a whole bunch of question marks
$query .= implode(',', array_fill(0, count($uris), '?'));
$query .= ')';
$stmt = $this->pdo->prepare($query);
$stmt->execute(array_merge([$calendarId], $uris));
$result = [];
while ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
foreach (array_chunk($uris, 900) as $chunk) {
$query = 'SELECT id, uri, lastmodified, etag, calendarid, size, calendardata, componenttype FROM ' . $this->calendarObjectTableName . ' WHERE calendarid = ? AND uri IN (';
// Inserting a whole bunch of question marks
$query .= implode(',', array_fill(0, count($chunk), '?'));
$query .= ')';
$result[] = [
'id' => $row['id'],
'uri' => $row['uri'],
'lastmodified' => (int)$row['lastmodified'],
'etag' => '"' . $row['etag'] . '"',
'size' => (int)$row['size'],
'calendardata' => $row['calendardata'],
'component' => strtolower($row['componenttype']),
];
$stmt = $this->pdo->prepare($query);
$stmt->execute(array_merge([$calendarId], $chunk));
while ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
$result[] = [
'id' => $row['id'],
'uri' => $row['uri'],
'lastmodified' => (int)$row['lastmodified'],
'etag' => '"' . $row['etag'] . '"',
'size' => (int)$row['size'],
'calendardata' => $row['calendardata'],
'component' => strtolower($row['componenttype']),
];
}
}
return $result;
@ -686,7 +688,7 @@ SQL
}
}
// Ensure Occurence values are positive
if ($firstOccurence < 0) $firstOccurence = 0;
if ($lastOccurence < 0) $lastOccurence = 0;
@ -769,7 +771,7 @@ SQL
* Note that especially time-range-filters may be difficult to parse. A
* time-range filter specified on a VEVENT must for instance also handle
* recurrence rules correctly.
* A good example of how to interprete all these filters can also simply
* A good example of how to interpret all these filters can also simply
* be found in \Sabre\CalDAV\CalendarQueryFilter. This class is as correct
* as possible, so it gives you a good idea on what type of stuff you need
* to think of.
@ -969,7 +971,7 @@ SQL;
// Current synctoken
$stmt = $this->pdo->prepare('SELECT synctoken FROM ' . $this->calendarTableName . ' WHERE id = ?');
$stmt->execute([ $calendarId ]);
$stmt->execute([$calendarId]);
$currentToken = $stmt->fetchColumn(0);
if (is_null($currentToken)) return null;
@ -1181,7 +1183,7 @@ SQL;
* Calling the handle method is like telling the PropPatch object "I
* promise I can handle updating this property".
*
* Read the PropPatch documenation for more info and examples.
* Read the PropPatch documentation for more info and examples.
*
* @param mixed $subscriptionId
* @param \Sabre\DAV\PropPatch $propPatch
@ -1327,7 +1329,7 @@ SQL;
function createSchedulingObject($principalUri, $objectUri, $objectData) {
$stmt = $this->pdo->prepare('INSERT INTO ' . $this->schedulingObjectTableName . ' (principaluri, calendardata, uri, lastmodified, etag, size) VALUES (?, ?, ?, ?, ?, ?)');
$stmt->execute([$principalUri, $objectData, $objectUri, time(), md5($objectData), strlen($objectData) ]);
$stmt->execute([$principalUri, $objectData, $objectUri, time(), md5($objectData), strlen($objectData)]);
}
@ -1483,7 +1485,7 @@ SQL;
'inviteStatus' => (int)$row['share_invitestatus'],
'properties' =>
!empty($row['share_displayname'])
? [ '{DAV:}displayname' => $row['share_displayname'] ]
? ['{DAV:}displayname' => $row['share_displayname']]
: [],
'principal' => $row['principaluri'],
]);
@ -1502,7 +1504,7 @@ SQL;
*/
function setPublishStatus($calendarId, $value) {
throw new \Sabre\DAV\Exception\NotImplemented('Not implemented');
throw new DAV\Exception\NotImplemented('Not implemented');
}

View File

@ -11,9 +11,9 @@ namespace Sabre\CalDAV\Backend;
* 1. Return shared calendars for users.
* 2. For every calendar, return calendar-resource-uri. This strings is a URI or
* relative URI reference that must be unique for every calendar, but
* identical for every instance of the same shared calenar.
* 3. For every calenar, you must return a share-access element. This element
* should contain one of the Sabre\DAV\Sharing\Plugin:ACCESS_* contants and
* identical for every instance of the same shared calendar.
* 3. For every calendar, you must return a share-access element. This element
* should contain one of the Sabre\DAV\Sharing\Plugin:ACCESS_* constants and
* indicates the access level the user has.
*
* @copyright Copyright (C) fruux GmbH (https://fruux.com/)

View File

@ -8,7 +8,7 @@ use Sabre\DAV;
/**
* Simple PDO CalDAV backend.
*
* This class is basically the most minmum example to get a caldav backend up
* This class is basically the most minimum example to get a caldav backend up
* and running. This class uses the following schema (MySQL example):
*
* CREATE TABLE simple_calendars (
@ -209,12 +209,12 @@ class SimplePDO extends AbstractBackend {
if (!$row) return null;
return [
'id' => $row['id'],
'uri' => $row['uri'],
'etag' => '"' . md5($row['calendardata']) . '"',
'calendarid' => $calendarId,
'size' => strlen($row['calendardata']),
'calendardata' => $row['calendardata'],
'id' => $row['id'],
'uri' => $row['uri'],
'etag' => '"' . md5($row['calendardata']) . '"',
'calendarid' => $calendarId,
'size' => strlen($row['calendardata']),
'calendardata' => $row['calendardata'],
];
}

View File

@ -70,7 +70,7 @@ interface SubscriptionSupport extends BackendInterface {
* Calling the handle method is like telling the PropPatch object "I
* promise I can handle updating this property".
*
* Read the PropPatch documenation for more info and examples.
* Read the PropPatch documentation for more info and examples.
*
* @param mixed $subscriptionId
* @param \Sabre\DAV\PropPatch $propPatch

View File

@ -3,8 +3,8 @@
namespace Sabre\CalDAV;
use Sabre\DAV;
use Sabre\DAVACL;
use Sabre\DAV\PropPatch;
use Sabre\DAVACL;
/**
* This object represents a CalDAV calendar.

View File

@ -27,7 +27,7 @@ class CalendarHome implements DAV\IExtendedCollection, DAVACL\IACL {
/**
* CalDAV backend
*
* @var Sabre\CalDAV\Backend\BackendInterface
* @var Backend\BackendInterface
*/
protected $caldavBackend;
@ -42,7 +42,7 @@ class CalendarHome implements DAV\IExtendedCollection, DAVACL\IACL {
* Constructor
*
* @param Backend\BackendInterface $caldavBackend
* @param mixed $userUri
* @param array $principalInfo
*/
function __construct(Backend\BackendInterface $caldavBackend, $principalInfo) {
@ -334,8 +334,8 @@ class CalendarHome implements DAV\IExtendedCollection, DAVACL\IACL {
* This method should return the url of the newly created calendar if the
* share was accepted.
*
* @param string href The sharee who is replying (often a mailto: address)
* @param int status One of the SharingPlugin::STATUS_* constants
* @param string $href The sharee who is replying (often a mailto: address)
* @param int $status One of the SharingPlugin::STATUS_* constants
* @param string $calendarUri The url to the calendar thats being shared
* @param string $inReplyTo The unique id this message is a response to
* @param string $summary A description of the reply

View File

@ -16,7 +16,7 @@ class CalendarObject extends \Sabre\DAV\File implements ICalendarObject, \Sabre\
/**
* Sabre\CalDAV\Backend\BackendInterface
*
* @var Sabre\CalDAV\Backend\AbstractBackend
* @var Backend\AbstractBackend
*/
protected $caldavBackend;

View File

@ -2,8 +2,8 @@
namespace Sabre\CalDAV;
use Sabre\VObject;
use DateTime;
use Sabre\VObject;
/**
* CalendarQuery Validator
@ -25,7 +25,7 @@ class CalendarQueryValidator {
*
* The list of filters must be formatted as parsed by \Sabre\CalDAV\CalendarQueryParser
*
* @param VObject\Component $vObject
* @param VObject\Component\VCalendar $vObject
* @param array $filters
* @return bool
*/

View File

@ -22,7 +22,7 @@ class CalendarRoot extends \Sabre\DAVACL\AbstractPrincipalCollection {
/**
* CalDAV backend
*
* @var Sabre\CalDAV\Backend\BackendInterface
* @var Backend\BackendInterface
*/
protected $caldavBackend;

View File

@ -2,8 +2,8 @@
namespace Sabre\CalDAV\Exception;
use Sabre\DAV;
use Sabre\CalDAV;
use Sabre\DAV;
/**
* InvalidComponentType

View File

@ -2,13 +2,13 @@
namespace Sabre\CalDAV;
use DateTime;
use DateTimeZone;
use Sabre\DAV;
use Sabre\VObject;
use Sabre\DAV\Exception\BadRequest;
use Sabre\HTTP\RequestInterface;
use Sabre\HTTP\ResponseInterface;
use Sabre\DAV\Exception\BadRequest;
use DateTime;
use Sabre\VObject;
/**
* ICS Exporter

View File

@ -2,8 +2,8 @@
namespace Sabre\CalDAV\Notifications;
use Sabre\DAV;
use Sabre\CalDAV;
use Sabre\DAV;
use Sabre\DAVACL;
/**
@ -27,7 +27,7 @@ class Collection extends DAV\Collection implements ICollection, DAVACL\IACL {
/**
* The notification backend
*
* @var Sabre\CalDAV\Backend\NotificationSupport
* @var CalDAV\Backend\NotificationSupport
*/
protected $caldavBackend;

View File

@ -2,6 +2,8 @@
namespace Sabre\CalDAV\Notifications;
use Sabre\CalDAV\Xml\Notification\NotificationInterface;
/**
* This node represents a single notification.
*
@ -20,16 +22,16 @@ interface INode {
/**
* This method must return an xml element, using the
* Sabre\CalDAV\Notifications\INotificationType classes.
* Sabre\CalDAV\Xml\Notification\NotificationInterface classes.
*
* @return INotificationType
* @return NotificationInterface
*/
function getNotificationType();
/**
* Returns the etag for the notification.
*
* The etag must be surrounded by litteral double-quotes.
* The etag must be surrounded by literal double-quotes.
*
* @return string
*/

View File

@ -2,9 +2,9 @@
namespace Sabre\CalDAV\Notifications;
use Sabre\DAV;
use Sabre\CalDAV;
use Sabre\CalDAV\Xml\Notification\NotificationInterface;
use Sabre\DAV;
use Sabre\DAVACL;
/**
@ -25,14 +25,14 @@ class Node extends DAV\File implements INode, DAVACL\IACL {
/**
* The notification backend
*
* @var Sabre\CalDAV\Backend\NotificationSupport
* @var CalDAV\Backend\NotificationSupport
*/
protected $caldavBackend;
/**
* The actual notification
*
* @var Sabre\CalDAV\Notifications\INotificationType
* @var NotificationInterface
*/
protected $notification;
@ -61,7 +61,7 @@ class Node extends DAV\File implements INode, DAVACL\IACL {
/**
* Returns the path name for this notification
*
* @return id
* @return string
*/
function getName() {
@ -84,9 +84,9 @@ class Node extends DAV\File implements INode, DAVACL\IACL {
/**
* This method must return an xml element, using the
* Sabre\CalDAV\Notifications\INotificationType classes.
* Sabre\CalDAV\Xml\Notification\NotificationInterface classes.
*
* @return INotificationType
* @return NotificationInterface
*/
function getNotificationType() {

View File

@ -3,10 +3,10 @@
namespace Sabre\CalDAV\Notifications;
use Sabre\DAV;
use Sabre\DAV\PropFind;
use Sabre\DAV\INode as BaseINode;
use Sabre\DAV\ServerPlugin;
use Sabre\DAV\PropFind;
use Sabre\DAV\Server;
use Sabre\DAV\ServerPlugin;
use Sabre\DAVACL;
use Sabre\HTTP\RequestInterface;
use Sabre\HTTP\ResponseInterface;

View File

@ -9,11 +9,11 @@ use Sabre\DAV\INode;
use Sabre\DAV\MkCol;
use Sabre\DAV\Xml\Property\LocalHref;
use Sabre\DAVACL;
use Sabre\VObject;
use Sabre\HTTP;
use Sabre\Uri;
use Sabre\HTTP\RequestInterface;
use Sabre\HTTP\ResponseInterface;
use Sabre\Uri;
use Sabre\VObject;
/**
* CalDAV plugin
@ -302,8 +302,8 @@ class Plugin extends DAV\ServerPlugin {
$this->server->createCollection($path, new MkCol($resourceType, $properties));
$this->server->httpResponse->setStatus(201);
$this->server->httpResponse->setHeader('Content-Length', 0);
$response->setStatus(201);
$response->setHeader('Content-Length', 0);
// This breaks the method chain.
return false;
@ -926,7 +926,7 @@ class Plugin extends DAV\ServerPlugin {
);
}
// We use an extra variable to allow event handles to tell us wether
// We use an extra variable to allow event handles to tell us whether
// the object was modified or not.
//
// This helps us determine if we need to re-serialize the object.

View File

@ -2,8 +2,8 @@
namespace Sabre\CalDAV\Principal;
use Sabre\DAVACL;
use Sabre\DAV;
use Sabre\DAVACL;
/**
* ProxyRead principal
@ -84,8 +84,8 @@ class ProxyRead implements IProxyRead {
/**
* Renames the node
*
* @throws DAV\Exception\Forbidden
* @param string $name The new name
* @throws DAV\Exception\Forbidden
* @return void
*/
function setName($name) {

View File

@ -2,8 +2,8 @@
namespace Sabre\CalDAV\Principal;
use Sabre\DAVACL;
use Sabre\DAV;
use Sabre\DAVACL;
/**
* ProxyWrite principal
@ -84,8 +84,8 @@ class ProxyWrite implements IProxyWrite {
/**
* Renames the node
*
* @throws DAV\Exception\Forbidden
* @param string $name The new name
* @throws DAV\Exception\Forbidden
* @return void
*/
function setName($name) {

View File

@ -181,7 +181,7 @@ class IMipPlugin extends DAV\ServerPlugin {
return [
'name' => $this->getPluginName(),
'description' => 'Email delivery (rfc6037) for CalDAV scheduling',
'description' => 'Email delivery (rfc6047) for CalDAV scheduling',
'link' => 'http://sabre.io/dav/scheduling/',
];

View File

@ -2,10 +2,10 @@
namespace Sabre\CalDAV\Schedule;
use Sabre\DAV;
use Sabre\CalDAV;
use Sabre\DAVACL;
use Sabre\CalDAV\Backend;
use Sabre\DAV;
use Sabre\DAVACL;
use Sabre\VObject;
/**
@ -83,7 +83,7 @@ class Inbox extends DAV\Collection implements IInbox {
* Data will either be supplied as a stream resource, or in certain cases
* as a string. Keep in mind that you may have to support either.
*
* After succesful creation of the file, you may choose to return the ETag
* After successful creation of the file, you may choose to return the ETag
* of the new file here.
*
* The returned ETag must be surrounded by double-quotes (The quotes should

View File

@ -2,8 +2,8 @@
namespace Sabre\CalDAV\Schedule;
use Sabre\DAV;
use Sabre\CalDAV;
use Sabre\DAV;
use Sabre\DAVACL;
/**

View File

@ -3,29 +3,28 @@
namespace Sabre\CalDAV\Schedule;
use DateTimeZone;
use Sabre\DAV\Server;
use Sabre\DAV\ServerPlugin;
use Sabre\DAV\Sharing;
use Sabre\DAV\PropFind;
use Sabre\DAV\PropPatch;
use Sabre\DAV\INode;
use Sabre\DAV\Xml\Property\Href;
use Sabre\DAV\Xml\Property\LocalHref;
use Sabre\HTTP\RequestInterface;
use Sabre\HTTP\ResponseInterface;
use Sabre\VObject;
use Sabre\VObject\Reader;
use Sabre\VObject\Component\VCalendar;
use Sabre\VObject\ITip;
use Sabre\VObject\ITip\Message;
use Sabre\DAVACL;
use Sabre\CalDAV\ICalendar;
use Sabre\CalDAV\ICalendarObject;
use Sabre\CalDAV\Xml\Property\ScheduleCalendarTransp;
use Sabre\DAV\Exception\NotFound;
use Sabre\DAV\Exception\Forbidden;
use Sabre\DAV\Exception\BadRequest;
use Sabre\DAV\Exception\Forbidden;
use Sabre\DAV\Exception\NotFound;
use Sabre\DAV\Exception\NotImplemented;
use Sabre\DAV\INode;
use Sabre\DAV\PropFind;
use Sabre\DAV\PropPatch;
use Sabre\DAV\Server;
use Sabre\DAV\ServerPlugin;
use Sabre\DAV\Sharing;
use Sabre\DAV\Xml\Property\LocalHref;
use Sabre\DAVACL;
use Sabre\HTTP\RequestInterface;
use Sabre\HTTP\ResponseInterface;
use Sabre\VObject;
use Sabre\VObject\Component\VCalendar;
use Sabre\VObject\ITip;
use Sabre\VObject\ITip\Message;
use Sabre\VObject\Reader;
/**
* CalDAV scheduling plugin.
@ -377,7 +376,7 @@ class Plugin extends ServerPlugin {
/**
* This method is responsible for delivering the ITip message.
*
* @param ITip\Message $itipMessage
* @param ITip\Message $iTipMessage
* @return void
*/
function deliver(ITip\Message $iTipMessage) {
@ -890,8 +889,8 @@ class Plugin extends ServerPlugin {
* * 3.7;description
*
* @param string $email address
* @param DateTimeInterface $start
* @param DateTimeInterface $end
* @param \DateTimeInterface $start
* @param \DateTimeInterface $end
* @param VObject\Component $request
* @return array
*/
@ -1059,7 +1058,7 @@ class Plugin extends ServerPlugin {
return [
'name' => $this->getPluginName(),
'description' => 'Adds calendar-auto-schedule, as defined in rf6868',
'description' => 'Adds calendar-auto-schedule, as defined in rfc6638',
'link' => 'http://sabre.io/dav/scheduling/',
];

View File

@ -42,7 +42,7 @@ class SchedulingObject extends \Sabre\CalDAV\CalendarObject implements IScheduli
* * lastmodified - (optional) format as a unix timestamp.
* * acl - (optional) Use this to override the default ACL for the node.
*
* @param Backend\BackendInterface $caldavBackend
* @param Backend\SchedulingSupport $caldavBackend
* @param array $objectData
*/
function __construct(Backend\SchedulingSupport $caldavBackend, array $objectData) {

View File

@ -3,7 +3,6 @@
namespace Sabre\CalDAV;
use Sabre\DAV;
use Sabre\DAV\Xml\Property\Href;
use Sabre\DAV\Xml\Property\LocalHref;
use Sabre\HTTP\RequestInterface;
use Sabre\HTTP\ResponseInterface;
@ -29,7 +28,7 @@ class SharingPlugin extends DAV\ServerPlugin {
/**
* Reference to SabreDAV server object.
*
* @var Sabre\DAV\Server
* @var DAV\Server
*/
protected $server;

View File

@ -4,8 +4,8 @@ namespace Sabre\CalDAV\Subscriptions;
use Sabre\DAV\INode;
use Sabre\DAV\PropFind;
use Sabre\DAV\ServerPlugin;
use Sabre\DAV\Server;
use Sabre\DAV\ServerPlugin;
/**
* This plugin adds calendar-subscription support to your CalDAV server.

View File

@ -2,12 +2,12 @@
namespace Sabre\CalDAV\Subscriptions;
use Sabre\DAV\Collection;
use Sabre\DAV\Xml\Property\Href;
use Sabre\DAV\PropPatch;
use Sabre\DAVACL\IACL;
use Sabre\DAVACL\ACLTrait;
use Sabre\CalDAV\Backend\SubscriptionSupport;
use Sabre\DAV\Collection;
use Sabre\DAV\PropPatch;
use Sabre\DAV\Xml\Property\Href;
use Sabre\DAVACL\ACLTrait;
use Sabre\DAVACL\IACL;
/**
* Subscription Node
@ -25,7 +25,7 @@ class Subscription extends Collection implements ISubscription, IACL {
/**
* caldavBackend
*
* @var SupportsSubscriptions
* @var SubscriptionSupport
*/
protected $caldavBackend;
@ -40,7 +40,7 @@ class Subscription extends Collection implements ISubscription, IACL {
* Constructor
*
* @param SubscriptionSupport $caldavBackend
* @param array $calendarInfo
* @param array $subscriptionInfo
*/
function __construct(SubscriptionSupport $caldavBackend, array $subscriptionInfo) {
@ -104,7 +104,7 @@ class Subscription extends Collection implements ISubscription, IACL {
/**
* Returns an array with all the child nodes
*
* @return DAV\INode[]
* @return \Sabre\DAV\INode[]
*/
function getChildren() {

View File

@ -2,11 +2,11 @@
namespace Sabre\CalDAV\Xml\Filter;
use Sabre\CalDAV\Plugin;
use Sabre\DAV\Exception\BadRequest;
use Sabre\VObject\DateTimeParser;
use Sabre\Xml\Reader;
use Sabre\Xml\XmlDeserializable;
use Sabre\DAV\Exception\BadRequest;
use Sabre\CalDAV\Plugin;
use Sabre\VObject\DateTimeParser;
/**
* CalendarData parser.
@ -30,7 +30,7 @@ class CalendarData implements XmlDeserializable {
/**
* The deserialize method is called during xml parsing.
*
* This method is called statictly, this is because in theory this method
* This method is called statically, this is because in theory this method
* may be used as a type of constructor, or factory method.
*
* Often you want to return an instance of the current class, but you are

View File

@ -2,11 +2,11 @@
namespace Sabre\CalDAV\Xml\Filter;
use Sabre\CalDAV\Plugin;
use Sabre\DAV\Exception\BadRequest;
use Sabre\VObject\DateTimeParser;
use Sabre\Xml\Reader;
use Sabre\Xml\XmlDeserializable;
use Sabre\DAV\Exception\BadRequest;
use Sabre\CalDAV\Plugin;
use Sabre\VObject\DateTimeParser;
/**
* CompFilter parser.
@ -27,7 +27,7 @@ class CompFilter implements XmlDeserializable {
/**
* The deserialize method is called during xml parsing.
*
* This method is called statictly, this is because in theory this method
* This method is called statically, this is because in theory this method
* may be used as a type of constructor, or factory method.
*
* Often you want to return an instance of the current class, but you are

View File

@ -2,9 +2,9 @@
namespace Sabre\CalDAV\Xml\Filter;
use Sabre\CalDAV\Plugin;
use Sabre\Xml\Reader;
use Sabre\Xml\XmlDeserializable;
use Sabre\CalDAV\Plugin;
/**
* PropFilter parser.
@ -25,7 +25,7 @@ class ParamFilter implements XmlDeserializable {
/**
* The deserialize method is called during xml parsing.
*
* This method is called statictly, this is because in theory this method
* This method is called statically, this is because in theory this method
* may be used as a type of constructor, or factory method.
*
* Often you want to return an instance of the current class, but you are

View File

@ -2,11 +2,11 @@
namespace Sabre\CalDAV\Xml\Filter;
use Sabre\CalDAV\Plugin;
use Sabre\DAV\Exception\BadRequest;
use Sabre\VObject\DateTimeParser;
use Sabre\Xml\Reader;
use Sabre\Xml\XmlDeserializable;
use Sabre\DAV\Exception\BadRequest;
use Sabre\CalDAV\Plugin;
use Sabre\VObject\DateTimeParser;
/**
* PropFilter parser.
@ -27,7 +27,7 @@ class PropFilter implements XmlDeserializable {
/**
* The deserialize method is called during xml parsing.
*
* This method is called statictly, this is because in theory this method
* This method is called statically, this is because in theory this method
* may be used as a type of constructor, or factory method.
*
* Often you want to return an instance of the current class, but you are

View File

@ -2,10 +2,10 @@
namespace Sabre\CalDAV\Xml\Notification;
use Sabre\Xml\Writer;
use Sabre\CalDAV\SharingPlugin as SharingPlugin;
use Sabre\CalDAV;
use Sabre\CalDAV\SharingPlugin as SharingPlugin;
use Sabre\DAV;
use Sabre\Xml\Writer;
/**
* This class represents the cs:invite-notification notification element.
@ -107,7 +107,7 @@ class Invite implements NotificationInterface {
/**
* The list of supported components
*
* @var Sabre\CalDAV\Property\SupportedCalendarComponentSet
* @var CalDAV\Xml\Property\SupportedCalendarComponentSet
*/
protected $supportedComponents;
@ -166,12 +166,12 @@ class Invite implements NotificationInterface {
}
/**
* The xmlSerialize metod is called during xml writing.
* The xmlSerialize method is called during xml writing.
*
* Use the $writer argument to write its own xml serialization.
*
* An important note: do _not_ create a parent element. Any element
* implementing XmlSerializble should only ever write what's considered
* implementing XmlSerializable should only ever write what's considered
* its 'inner xml'.
*
* The parent of the current element is responsible for writing a

View File

@ -2,10 +2,10 @@
namespace Sabre\CalDAV\Xml\Notification;
use Sabre\Xml\Writer;
use Sabre\CalDAV;
use Sabre\CalDAV\SharingPlugin;
use Sabre\DAV;
use Sabre\Xml\Writer;
/**
* This class represents the cs:invite-reply notification element.
@ -117,12 +117,12 @@ class InviteReply implements NotificationInterface {
}
/**
* The xmlSerialize metod is called during xml writing.
* The xmlSerialize method is called during xml writing.
*
* Use the $writer argument to write its own xml serialization.
*
* An important note: do _not_ create a parent element. Any element
* implementing XmlSerializble should only ever write what's considered
* implementing XmlSerializable should only ever write what's considered
* its 'inner xml'.
*
* The parent of the current element is responsible for writing a

View File

@ -2,8 +2,8 @@
namespace Sabre\CalDAV\Xml\Notification;
use Sabre\Xml\XmlSerializable;
use Sabre\Xml\Writer;
use Sabre\Xml\XmlSerializable;
/**
* This interface reflects a single notification type.

View File

@ -2,8 +2,8 @@
namespace Sabre\CalDAV\Xml\Notification;
use Sabre\Xml\Writer;
use Sabre\CalDAV\Plugin;
use Sabre\Xml\Writer;
/**
* SystemStatus notification

View File

@ -2,9 +2,9 @@
namespace Sabre\CalDAV\Xml\Property;
use Sabre\Xml\XmlSerializable;
use Sabre\Xml\Writer;
use Sabre\CalDAV\Plugin;
use Sabre\Xml\Writer;
use Sabre\Xml\XmlSerializable;
/**
* AllowedSharingModes
@ -53,12 +53,12 @@ class AllowedSharingModes implements XmlSerializable {
}
/**
* The xmlSerialize metod is called during xml writing.
* The xmlSerialize method is called during xml writing.
*
* Use the $writer argument to write its own xml serialization.
*
* An important note: do _not_ create a parent element. Any element
* implementing XmlSerializble should only ever write what's considered
* implementing XmlSerializable should only ever write what's considered
* its 'inner xml'.
*
* The parent of the current element is responsible for writing a

View File

@ -49,12 +49,12 @@ class EmailAddressSet implements XmlSerializable {
}
/**
* The xmlSerialize metod is called during xml writing.
* The xmlSerialize method is called during xml writing.
*
* Use the $writer argument to write its own xml serialization.
*
* An important note: do _not_ create a parent element. Any element
* implementing XmlSerializble should only ever write what's considered
* implementing XmlSerializable should only ever write what's considered
* its 'inner xml'.
*
* The parent of the current element is responsible for writing a

View File

@ -2,10 +2,11 @@
namespace Sabre\CalDAV\Xml\Property;
use Sabre\Xml\XmlSerializable;
use Sabre\Xml\Writer;
use Sabre\CalDAV\Plugin;
use Sabre\DAV;
use Sabre\DAV\Xml\Element\Sharee;
use Sabre\Xml\Writer;
use Sabre\Xml\XmlSerializable;
/**
* Invite property
@ -51,12 +52,12 @@ class Invite implements XmlSerializable {
}
/**
* The xmlSerialize metod is called during xml writing.
* The xmlSerialize method is called during xml writing.
*
* Use the $writer argument to write its own xml serialization.
*
* An important note: do _not_ create a parent element. Any element
* implementing XmlSerializble should only ever write what's considered
* implementing XmlSerializable should only ever write what's considered
* its 'inner xml'.
*
* The parent of the current element is responsible for writing a
@ -75,7 +76,7 @@ class Invite implements XmlSerializable {
foreach ($this->sharees as $sharee) {
if ($sharee->access === \Sabre\DAV\Sharing\Plugin::ACCESS_SHAREDOWNER) {
if ($sharee->access === DAV\Sharing\Plugin::ACCESS_SHAREDOWNER) {
$writer->startElement($cs . 'organizer');
} else {
$writer->startElement($cs . 'user');
@ -109,7 +110,7 @@ class Invite implements XmlSerializable {
}
$href = new \Sabre\DAV\Xml\Property\Href($sharee->href);
$href = new DAV\Xml\Property\Href($sharee->href);
$href->xmlSerialize($writer);
if (isset($sharee->properties['{DAV:}displayname'])) {

View File

@ -2,11 +2,11 @@
namespace Sabre\CalDAV\Xml\Property;
use Sabre\CalDAV\Plugin;
use Sabre\Xml\Deserializer;
use Sabre\Xml\Element;
use Sabre\Xml\Reader;
use Sabre\Xml\Deserializer;
use Sabre\Xml\Writer;
use Sabre\CalDAV\Plugin;
/**
* schedule-calendar-transp property.
@ -62,12 +62,12 @@ class ScheduleCalendarTransp implements Element {
}
/**
* The xmlSerialize metod is called during xml writing.
* The xmlSerialize method is called during xml writing.
*
* Use the $writer argument to write its own xml serialization.
*
* An important note: do _not_ create a parent element. Any element
* implementing XmlSerializble should only ever write what's considered
* implementing XmlSerializable should only ever write what's considered
* its 'inner xml'.
*
* The parent of the current element is responsible for writing a
@ -96,7 +96,7 @@ class ScheduleCalendarTransp implements Element {
/**
* The deserialize method is called during xml parsing.
*
* This method is called statictly, this is because in theory this method
* This method is called statically, this is because in theory this method
* may be used as a type of constructor, or factory method.
*
* Often you want to return an instance of the current class, but you are

View File

@ -2,11 +2,11 @@
namespace Sabre\CalDAV\Xml\Property;
use Sabre\CalDAV\Plugin;
use Sabre\Xml\Element;
use Sabre\Xml\ParseException;
use Sabre\Xml\Reader;
use Sabre\Xml\Writer;
use Sabre\CalDAV\Plugin;
/**
* SupportedCalendarComponentSet property.
@ -55,12 +55,12 @@ class SupportedCalendarComponentSet implements Element {
}
/**
* The xmlSerialize metod is called during xml writing.
* The xmlSerialize method is called during xml writing.
*
* Use the $writer argument to write its own xml serialization.
*
* An important note: do _not_ create a parent element. Any element
* implementing XmlSerializble should only ever write what's considered
* implementing XmlSerializable should only ever write what's considered
* its 'inner xml'.
*
* The parent of the current element is responsible for writing a
@ -88,7 +88,7 @@ class SupportedCalendarComponentSet implements Element {
/**
* The deserialize method is called during xml parsing.
*
* This method is called statictly, this is because in theory this method
* This method is called statically, this is because in theory this method
* may be used as a type of constructor, or factory method.
*
* Often you want to return an instance of the current class, but you are

View File

@ -2,9 +2,9 @@
namespace Sabre\CalDAV\Xml\Property;
use Sabre\Xml\XmlSerializable;
use Sabre\Xml\Writer;
use Sabre\CalDAV\Plugin;
use Sabre\Xml\Writer;
use Sabre\Xml\XmlSerializable;
/**
* Supported-calendar-data property
@ -23,12 +23,12 @@ use Sabre\CalDAV\Plugin;
class SupportedCalendarData implements XmlSerializable {
/**
* The xmlSerialize metod is called during xml writing.
* The xmlSerialize method is called during xml writing.
*
* Use the $writer argument to write its own xml serialization.
*
* An important note: do _not_ create a parent element. Any element
* implementing XmlSerializble should only ever write what's considered
* implementing XmlSerializable should only ever write what's considered
* its 'inner xml'.
*
* The parent of the current element is responsible for writing a

View File

@ -2,9 +2,9 @@
namespace Sabre\CalDAV\Xml\Property;
use Sabre\CalDAV\Plugin;
use Sabre\Xml\Writer;
use Sabre\Xml\XmlSerializable;
use Sabre\CalDAV\Plugin;
/**
* supported-collation-set property
@ -22,12 +22,12 @@ use Sabre\CalDAV\Plugin;
class SupportedCollationSet implements XmlSerializable {
/**
* The xmlSerialize metod is called during xml writing.
* The xmlSerialize method is called during xml writing.
*
* Use the $writer argument to write its own xml serialization.
*
* An important note: do _not_ create a parent element. Any element
* implementing XmlSerializble should only ever write what's considered
* implementing XmlSerializable should only ever write what's considered
* its 'inner xml'.
*
* The parent of the current element is responsible for writing a

View File

@ -2,10 +2,10 @@
namespace Sabre\CalDAV\Xml\Request;
use Sabre\Xml\XmlDeserializable;
use Sabre\Xml\Reader;
use Sabre\CalDAV\Plugin;
use Sabre\Uri;
use Sabre\Xml\Reader;
use Sabre\Xml\XmlDeserializable;
/**
* CalendarMultiGetReport request parser.
@ -64,7 +64,7 @@ class CalendarMultiGetReport implements XmlDeserializable {
/**
* The deserialize method is called during xml parsing.
*
* This method is called statictly, this is because in theory this method
* This method is called statically, this is because in theory this method
* may be used as a type of constructor, or factory method.
*
* Often you want to return an instance of the current class, but you are

View File

@ -2,10 +2,10 @@
namespace Sabre\CalDAV\Xml\Request;
use Sabre\Xml\XmlDeserializable;
use Sabre\Xml\Reader;
use Sabre\DAV\Exception\BadRequest;
use Sabre\CalDAV\Plugin;
use Sabre\DAV\Exception\BadRequest;
use Sabre\Xml\Reader;
use Sabre\Xml\XmlDeserializable;
/**
* CalendarQueryReport request parser.
@ -64,7 +64,7 @@ class CalendarQueryReport implements XmlDeserializable {
/**
* The deserialize method is called during xml parsing.
*
* This method is called statictly, this is because in theory this method
* This method is called statically, this is because in theory this method
* may be used as a type of constructor, or factory method.
*
* Often you want to return an instance of the current class, but you are

View File

@ -38,7 +38,7 @@ class FreeBusyQueryReport implements XmlDeserializable {
/**
* The deserialize method is called during xml parsing.
*
* This method is called statictly, this is because in theory this method
* This method is called statically, this is because in theory this method
* may be used as a type of constructor, or factory method.
*
* Often you want to return an instance of the current class, but you are

View File

@ -6,9 +6,9 @@ use Sabre\CalDAV\Plugin;
use Sabre\CalDAV\SharingPlugin;
use Sabre\DAV;
use Sabre\DAV\Exception\BadRequest;
use Sabre\Xml\Element\KeyValue;
use Sabre\Xml\Reader;
use Sabre\Xml\XmlDeserializable;
use Sabre\Xml\Element\KeyValue;
/**
* Invite-reply POST request parser
@ -82,7 +82,7 @@ class InviteReply implements XmlDeserializable {
/**
* The deserialize method is called during xml parsing.
*
* This method is called statictly, this is because in theory this method
* This method is called statically, this is because in theory this method
* may be used as a type of constructor, or factory method.
*
* Often you want to return an instance of the current class, but you are

View File

@ -39,7 +39,7 @@ class MkCalendar implements XmlDeserializable {
/**
* The deserialize method is called during xml parsing.
*
* This method is called statictly, this is because in theory this method
* This method is called statically, this is because in theory this method
* may be used as a type of constructor, or factory method.
*
* Often you want to return an instance of the current class, but you are
@ -62,8 +62,8 @@ class MkCalendar implements XmlDeserializable {
$self = new self();
$elementMap = $reader->elementMap;
$elementMap['{DAV:}prop'] = 'Sabre\DAV\Xml\Element\Prop';
$elementMap['{DAV:}set'] = 'Sabre\Xml\Element\KeyValue';
$elementMap['{DAV:}prop'] = 'Sabre\DAV\Xml\Element\Prop';
$elementMap['{DAV:}set'] = 'Sabre\Xml\Element\KeyValue';
$elems = $reader->parseInnerTree($elementMap);
foreach ($elems as $elem) {

View File

@ -41,7 +41,7 @@ class Share implements XmlDeserializable {
/**
* The deserialize method is called during xml parsing.
*
* This method is called statictly, this is because in theory this method
* This method is called statically, this is because in theory this method
* may be used as a type of constructor, or factory method.
*
* Often you want to return an instance of the current class, but you are

View File

@ -60,7 +60,7 @@ class AddressBook extends DAV\Collection implements IAddressBook, DAV\IPropertie
* Returns a card
*
* @param string $name
* @return \ICard
* @return Card
*/
function getChild($name) {

View File

@ -127,7 +127,7 @@ class AddressBookHome extends DAV\Collection implements DAV\IExtendedCollection,
*
* @param string $name
* @todo needs optimizing
* @return \AddressBook
* @return AddressBook
*/
function getChild($name) {

View File

@ -18,7 +18,7 @@ class AddressBookRoot extends DAVACL\AbstractPrincipalCollection {
/**
* Principal Backend
*
* @var Sabre\DAVACL\PrincipalBackend\BackendInteface
* @var DAVACL\PrincipalBackend\BackendInterface
*/
protected $principalBackend;

View File

@ -46,7 +46,7 @@ interface BackendInterface {
* Calling the handle method is like telling the PropPatch object "I
* promise I can handle updating this property".
*
* Read the PropPatch documenation for more info and examples.
* Read the PropPatch documentation for more info and examples.
*
* @param string $addressBookId
* @param \Sabre\DAV\PropPatch $propPatch

View File

@ -93,7 +93,7 @@ class PDO extends AbstractBackend implements SyncSupport {
* Calling the handle method is like telling the PropPatch object "I
* promise I can handle updating this property".
*
* Read the PropPatch documenation for more info and examples.
* Read the PropPatch documentation for more info and examples.
*
* @param string $addressBookId
* @param \Sabre\DAV\PropPatch $propPatch
@ -240,7 +240,7 @@ class PDO extends AbstractBackend implements SyncSupport {
}
/**
* Returns a specfic card.
* Returns a specific card.
*
* The same set of properties must be returned as with getCards. The only
* exception is that 'carddata' is absolutely required.
@ -466,7 +466,7 @@ class PDO extends AbstractBackend implements SyncSupport {
// Current synctoken
$stmt = $this->pdo->prepare('SELECT synctoken FROM ' . $this->addressBooksTableName . ' WHERE id = ?');
$stmt->execute([ $addressBookId ]);
$stmt->execute([$addressBookId]);
$currentToken = $stmt->fetchColumn(0);
if (is_null($currentToken)) return null;

View File

@ -2,8 +2,8 @@
namespace Sabre\CardDAV;
use Sabre\DAVACL;
use Sabre\DAV;
use Sabre\DAVACL;
/**
* The Card object represents a single Card from an addressbook

View File

@ -43,7 +43,7 @@ class Plugin extends DAV\ServerPlugin {
/**
* Server class
*
* @var Sabre\DAV\Server
* @var DAV\Server
*/
protected $server;
@ -490,7 +490,8 @@ class Plugin extends DAV\ServerPlugin {
$props[200]['{' . self::NS_CARDDAV . '}address-data'] = $this->convertVCard(
$props[200]['{' . self::NS_CARDDAV . '}address-data'],
$vcardType
$vcardType,
$report->addressDataProperties
);
}
@ -845,14 +846,26 @@ class Plugin extends DAV\ServerPlugin {
*
* @param string|resource $data
* @param string $target
* @param array $propertiesFilter
* @return string
*/
protected function convertVCard($data, $target) {
protected function convertVCard($data, $target, array $propertiesFilter = null) {
if (is_resource($data)) {
$data = stream_get_contents($data);
}
$input = VObject\Reader::read($data);
if (!empty($propertiesFilter)) {
$propertiesFilter = array_merge(['UID', 'VERSION', 'FN'], $propertiesFilter);
$keys = array_unique(array_map(function($child) {
return $child->name;
}, $input->children()));
$keys = array_diff($keys, $propertiesFilter);
foreach ($keys as $key) {
unset($input->$key);
}
$data = $input->serialize();
}
$output = null;
try {

View File

@ -3,9 +3,9 @@
namespace Sabre\CardDAV;
use Sabre\DAV;
use Sabre\VObject;
use Sabre\HTTP\RequestInterface;
use Sabre\HTTP\ResponseInterface;
use Sabre\VObject;
/**
* VCF Exporter
@ -24,7 +24,7 @@ class VCFExportPlugin extends DAV\ServerPlugin {
/**
* Reference to Server class
*
* @var Sabre\DAV\Server
* @var DAV\Server
*/
protected $server;

View File

@ -26,7 +26,7 @@ class AddressData implements XmlDeserializable {
/**
* The deserialize method is called during xml parsing.
*
* This method is called statictly, this is because in theory this method
* This method is called statically, this is because in theory this method
* may be used as a type of constructor, or factory method.
*
* Often you want to return an instance of the current class, but you are
@ -51,7 +51,11 @@ class AddressData implements XmlDeserializable {
'version' => $reader->getAttribute('version') ?: '3.0',
];
$reader->next();
$elems = (array)$reader->parseInnerTree();
$result['addressDataProperties'] = array_map(function($element) {
return $element['attributes']['name'];
}, $elems);
return $result;
}

View File

@ -2,10 +2,10 @@
namespace Sabre\CardDAV\Xml\Filter;
use Sabre\CardDAV\Plugin;
use Sabre\DAV\Exception\BadRequest;
use Sabre\Xml\Element;
use Sabre\Xml\Reader;
use Sabre\DAV\Exception\BadRequest;
use Sabre\CardDAV\Plugin;
/**
* ParamFilter parser.
@ -26,7 +26,7 @@ abstract class ParamFilter implements Element {
/**
* The deserialize method is called during xml parsing.
*
* This method is called statictly, this is because in theory this method
* This method is called statically, this is because in theory this method
* may be used as a type of constructor, or factory method.
*
* Often you want to return an instance of the current class, but you are

View File

@ -2,10 +2,10 @@
namespace Sabre\CardDAV\Xml\Filter;
use Sabre\CardDAV\Plugin;
use Sabre\DAV\Exception\BadRequest;
use Sabre\Xml\Reader;
use Sabre\Xml\XmlDeserializable;
use Sabre\DAV\Exception\BadRequest;
use Sabre\CardDAV\Plugin;
/**
* PropFilter parser.
@ -26,7 +26,7 @@ class PropFilter implements XmlDeserializable {
/**
* The deserialize method is called during xml parsing.
*
* This method is called statictly, this is because in theory this method
* This method is called statically, this is because in theory this method
* may be used as a type of constructor, or factory method.
*
* Often you want to return an instance of the current class, but you are

View File

@ -2,9 +2,9 @@
namespace Sabre\CardDAV\Xml\Property;
use Sabre\CardDAV\Plugin;
use Sabre\Xml\Writer;
use Sabre\Xml\XmlSerializable;
use Sabre\CardDAV\Plugin;
/**
* Supported-address-data property
@ -49,12 +49,12 @@ class SupportedAddressData implements XmlSerializable {
}
/**
* The xmlSerialize metod is called during xml writing.
* The xmlSerialize method is called during xml writing.
*
* Use the $writer argument to write its own xml serialization.
*
* An important note: do _not_ create a parent element. Any element
* implementing XmlSerializble should only ever write what's considered
* implementing XmlSerializable should only ever write what's considered
* its 'inner xml'.
*
* The parent of the current element is responsible for writing a

View File

@ -18,12 +18,12 @@ use Sabre\Xml\XmlSerializable;
class SupportedCollationSet implements XmlSerializable {
/**
* The xmlSerialize metod is called during xml writing.
* The xmlSerialize method is called during xml writing.
*
* Use the $writer argument to write its own xml serialization.
*
* An important note: do _not_ create a parent element. Any element
* implementing XmlSerializble should only ever write what's considered
* implementing XmlSerializable should only ever write what's considered
* its 'inner xml'.
*
* The parent of the current element is responsible for writing a

View File

@ -54,7 +54,7 @@ class AddressBookMultiGetReport implements XmlDeserializable {
/**
* The deserialize method is called during xml parsing.
*
* This method is called statictly, this is because in theory this method
* This method is called statically, this is because in theory this method
* may be used as a type of constructor, or factory method.
*
* Often you want to return an instance of the current class, but you are

View File

@ -2,10 +2,10 @@
namespace Sabre\CardDAV\Xml\Request;
use Sabre\CardDAV\Plugin;
use Sabre\DAV\Exception\BadRequest;
use Sabre\Xml\Reader;
use Sabre\Xml\XmlDeserializable;
use Sabre\DAV\Exception\BadRequest;
use Sabre\CardDAV\Plugin;
/**
* AddressBookQueryReport request parser.
@ -28,6 +28,13 @@ class AddressBookQueryReport implements XmlDeserializable {
*/
public $properties;
/**
* An array with requested vcard properties.
*
* @var array
*/
public $addressDataProperties = [];
/**
* List of property/component filters.
*
@ -92,7 +99,7 @@ class AddressBookQueryReport implements XmlDeserializable {
/**
* The deserialize method is called during xml parsing.
*
* This method is called statictly, this is because in theory this method
* This method is called statically, this is because in theory this method
* may be used as a type of constructor, or factory method.
*
* Often you want to return an instance of the current class, but you are

View File

@ -2,8 +2,8 @@
namespace Sabre\DAV\Auth\Backend;
use Sabre\HTTP;
use Sabre\DAV;
use Sabre\HTTP;
use Sabre\HTTP\RequestInterface;
use Sabre\HTTP\ResponseInterface;

View File

@ -31,7 +31,7 @@ class PDO extends AbstractDigest {
*
* If the filename argument is passed in, it will parse out the specified file fist.
*
* @param PDO $pdo
* @param \PDO $pdo
*/
function __construct(\PDO $pdo) {

View File

@ -2,11 +2,11 @@
namespace Sabre\DAV\Auth;
use Sabre\HTTP\RequestInterface;
use Sabre\HTTP\ResponseInterface;
use Sabre\DAV\Exception\NotAuthenticated;
use Sabre\DAV\Server;
use Sabre\DAV\ServerPlugin;
use Sabre\HTTP\RequestInterface;
use Sabre\HTTP\ResponseInterface;
/**
* This plugin provides Authentication for a WebDAV server.
@ -181,7 +181,7 @@ class Plugin extends ServerPlugin {
*
* If login was not successful, the second item in the array will contain a
* an array with strings. The strings are a list of reasons why login was
* unsuccesful. For every auth backend there will be one reason, so usually
* unsuccessful. For every auth backend there will be one reason, so usually
* there's just one.
*
* @param RequestInterface $request

View File

@ -2,10 +2,10 @@
namespace Sabre\DAV\Browser;
use Sabre\HTTP\URLUtil;
use Sabre\DAV;
use Sabre\DAV\PropFind;
use Sabre\DAV\Inode;
use Sabre\DAV\PropFind;
use Sabre\HTTP\URLUtil;
/**
* GuessContentType plugin

View File

@ -21,7 +21,7 @@ class MapGetToPropFind extends DAV\ServerPlugin {
/**
* reference to server class
*
* @var Sabre\DAV\Server
* @var DAV\Server
*/
protected $server;

View File

@ -4,9 +4,9 @@ namespace Sabre\DAV\Browser;
use Sabre\DAV;
use Sabre\DAV\MkCol;
use Sabre\HTTP\URLUtil;
use Sabre\HTTP\RequestInterface;
use Sabre\HTTP\ResponseInterface;
use Sabre\HTTP\URLUtil;
/**
* Browser Plugin
@ -26,7 +26,7 @@ class Plugin extends DAV\ServerPlugin {
/**
* reference to server class
*
* @var Sabre\DAV\Server
* @var DAV\Server
*/
protected $server;
@ -112,7 +112,7 @@ class Plugin extends DAV\ServerPlugin {
$getVars = $request->getQueryParameters();
// CSP headers
$this->server->httpResponse->setHeader('Content-Security-Policy', "default-src 'none'; img-src 'self'; style-src 'self'; font-src 'self';");
$response->setHeader('Content-Security-Policy', "default-src 'none'; img-src 'self'; style-src 'self'; font-src 'self';");
$sabreAction = isset($getVars['sabreAction']) ? $getVars['sabreAction'] : null;
@ -317,7 +317,7 @@ class Plugin extends DAV\ServerPlugin {
$buttonActions = '';
if ($subProps['subNode'] instanceof DAV\IFile) {
$buttonActions = '<a href="' . $this->escapeHTML($subProps['fullPath']) . '?sabreAction=info"><span class="oi" data-glyph="info"></span></a>';
$buttonActions = '<a href="' . $this->escapeHTML($subProps['fullPath']) . '?sabreAction=info"><span class="oi" data-glyph="info"></span></a>';
}
$this->server->emit('browserButtonActions', [$subProps['fullPath'], $subProps['subNode'], &$buttonActions]);
@ -414,11 +414,14 @@ class Plugin extends DAV\ServerPlugin {
*
* @param string $title
* @param string $path
* @return void
* @return string
*/
function generateHeader($title, $path = null) {
$version = DAV\Version::VERSION;
$version = '';
if (DAV\Server::$exposeVersion) {
$version = DAV\Version::VERSION;
}
$vars = [
'title' => $this->escapeHTML($title),
@ -475,7 +478,10 @@ HTML;
*/
function generateFooter() {
$version = DAV\Version::VERSION;
$version = '';
if (DAV\Server::$exposeVersion) {
$version = DAV\Version::VERSION;
}
return <<<HTML
<footer>Generated by SabreDAV $version (c)2007-2016 <a href="http://sabre.io/">http://sabre.io/</a></footer>
</body>
@ -506,23 +512,21 @@ HTML;
if (get_class($node) === 'Sabre\\DAV\\SimpleCollection')
return;
ob_start();
echo '<form method="post" action="">
<h3>Create new folder</h3>
<input type="hidden" name="sabreAction" value="mkcol" />
<label>Name:</label> <input type="text" name="name" /><br />
<input type="submit" value="create" />
</form>
<form method="post" action="" enctype="multipart/form-data">
<h3>Upload file</h3>
<input type="hidden" name="sabreAction" value="put" />
<label>Name (optional):</label> <input type="text" name="name" /><br />
<label>File:</label> <input type="file" name="file" /><br />
<input type="submit" value="upload" />
</form>
';
$output .= ob_get_clean();
$output .= <<<HTML
<form method="post" action="">
<h3>Create new folder</h3>
<input type="hidden" name="sabreAction" value="mkcol" />
<label>Name:</label> <input type="text" name="name" /><br />
<input type="submit" value="create" />
</form>
<form method="post" action="" enctype="multipart/form-data">
<h3>Upload file</h3>
<input type="hidden" name="sabreAction" value="put" />
<label>Name (optional):</label> <input type="text" name="name" /><br />
<label>File:</label> <input type="file" name="file" /><br />
<input type="submit" value="upload" />
</form>
HTML;
}
@ -543,8 +547,8 @@ HTML;
* This method returns a local pathname to an asset.
*
* @param string $assetName
* @return string
* @throws DAV\Exception\NotFound
* @return string
*/
protected function getLocalAssetPath($assetName) {
@ -575,9 +579,9 @@ HTML;
// Rudimentary mime type detection
$mime = 'application/octet-stream';
$map = [
'ico' => 'image/vnd.microsoft.icon',
'png' => 'image/png',
'css' => 'text/css',
'ico' => 'image/vnd.microsoft.icon',
'png' => 'image/png',
'css' => 'text/css',
];
$ext = substr($assetName, strrpos($assetName, '.') + 1);
@ -623,7 +627,7 @@ HTML;
* Maps a resource type to a human-readable string and icon.
*
* @param array $resourceTypes
* @param INode $node
* @param DAV\INode $node
* @return array
*/
private function mapResourceType(array $resourceTypes, $node) {

View File

@ -28,7 +28,7 @@ class PropFindAll extends PropFind {
/**
* Handles a specific property.
*
* This method checks wether the specified property was requested in this
* This method checks whether the specified property was requested in this
* PROPFIND request, and if so, it will call the callback and use the
* return value for it's value.
*

View File

@ -231,7 +231,7 @@ class Client extends HTTP\Client {
$response = $this->send($request);
if ((int)$response->getStatus() >= 400) {
throw new \Sabre\HTTP\ClientHttpException($response);
throw new HTTP\ClientHttpException($response);
}
$result = $this->parseMultiStatus($response->getBodyAsString());
@ -281,7 +281,7 @@ class Client extends HTTP\Client {
$response = $this->send($request);
if ($response->getStatus() >= 400) {
throw new \Sabre\HTTP\ClientHttpException($response);
throw new HTTP\ClientHttpException($response);
}
if ($response->getStatus() === 207) {
@ -303,7 +303,7 @@ class Client extends HTTP\Client {
}
if ($errorProperties) {
throw new \Sabre\HTTP\ClientException('PROPPATCH failed. The following properties errored: ' . implode(', ', $errorProperties));
throw new HTTP\ClientException('PROPPATCH failed. The following properties errored: ' . implode(', ', $errorProperties));
}
}
return true;

View File

@ -68,7 +68,7 @@ abstract class Collection extends Node implements ICollection {
* Data will either be supplied as a stream resource, or in certain cases
* as a string. Keep in mind that you may have to support either.
*
* After succesful creation of the file, you may choose to return the ETag
* After successful creation of the file, you may choose to return the ETag
* of the new file here.
*
* The returned ETag must be surrounded by double-quotes (The quotes should

View File

@ -165,7 +165,7 @@ class CorePlugin extends ServerPlugin {
} else {
$start = $nodeSize - $range[1];
$end = $nodeSize - 1;
$end = $nodeSize - 1;
if ($start < 0) $start = 0;
@ -194,7 +194,7 @@ class CorePlugin extends ServerPlugin {
$response->setBody($body);
}
// Sending back false will interupt the event chain and tell the server
// Sending back false will interrupt the event chain and tell the server
// we've handled this method.
return false;
@ -224,7 +224,7 @@ class CorePlugin extends ServerPlugin {
$response->setHeader('Content-Length', '0');
$response->setStatus(200);
// Sending back false will interupt the event chain and tell the server
// Sending back false will interrupt the event chain and tell the server
// we've handled this method.
return false;
@ -264,7 +264,7 @@ class CorePlugin extends ServerPlugin {
$response->setHeader('X-Sabre-Real-Status', $e->getHTTPCode());
}
// Sending back false will interupt the event chain and tell the server
// Sending back false will interrupt the event chain and tell the server
// we've handled this method.
return false;
@ -290,7 +290,7 @@ class CorePlugin extends ServerPlugin {
$response->setStatus(204);
$response->setHeader('Content-Length', '0');
// Sending back false will interupt the event chain and tell the server
// Sending back false will interrupt the event chain and tell the server
// we've handled this method.
return false;
@ -333,7 +333,7 @@ class CorePlugin extends ServerPlugin {
// The only two options for the depth of a propfind is 0 or 1 - as long as depth infinity is not enabled
if (!$this->server->enablePropfindDepthInfinity && $depth != 0) $depth = 1;
$newProperties = $this->server->getPropertiesForPath($path, $propFindXml->properties, $depth);
$newProperties = $this->server->getPropertiesIteratorForPath($path, $propFindXml->properties, $depth);
// This is a multi-status response
$response->setStatus(207);
@ -355,7 +355,7 @@ class CorePlugin extends ServerPlugin {
$data = $this->server->generateMultiStatus($newProperties, $minimal);
$response->setBody($data);
// Sending back false will interupt the event chain and tell the server
// Sending back false will interrupt the event chain and tell the server
// we've handled this method.
return false;
@ -390,7 +390,7 @@ class CorePlugin extends ServerPlugin {
if ($prefer['return'] === 'minimal') {
// If return-minimal is specified, we only have to check if the
// request was succesful, and don't need to return the
// request was successful, and don't need to return the
// multi-status.
$ok = true;
foreach ($result as $prop => $code) {
@ -427,7 +427,7 @@ class CorePlugin extends ServerPlugin {
$this->server->generateMultiStatus([$multiStatus])
);
// Sending back false will interupt the event chain and tell the server
// Sending back false will interrupt the event chain and tell the server
// we've handled this method.
return false;
@ -533,7 +533,7 @@ class CorePlugin extends ServerPlugin {
}
// Sending back false will interupt the event chain and tell the server
// Sending back false will interrupt the event chain and tell the server
// we've handled this method.
return false;
@ -602,7 +602,7 @@ class CorePlugin extends ServerPlugin {
$response->setStatus(201);
}
// Sending back false will interupt the event chain and tell the server
// Sending back false will interrupt the event chain and tell the server
// we've handled this method.
return false;
@ -653,7 +653,7 @@ class CorePlugin extends ServerPlugin {
$response->setHeader('Content-Length', '0');
$response->setStatus($moveInfo['destinationExists'] ? 204 : 201);
// Sending back false will interupt the event chain and tell the server
// Sending back false will interrupt the event chain and tell the server
// we've handled this method.
return false;
@ -688,7 +688,7 @@ class CorePlugin extends ServerPlugin {
$response->setHeader('Content-Length', '0');
$response->setStatus($copyInfo['destinationExists'] ? 204 : 201);
// Sending back false will interupt the event chain and tell the server
// Sending back false will interrupt the event chain and tell the server
// we've handled this method.
return false;
@ -722,7 +722,7 @@ class CorePlugin extends ServerPlugin {
}
// Sending back false will interupt the event chain and tell the server
// Sending back false will interrupt the event chain and tell the server
// we've handled this method.
return false;
@ -740,7 +740,7 @@ class CorePlugin extends ServerPlugin {
*/
function propPatchProtectedPropertyCheck($path, PropPatch $propPatch) {
// Comparing the mutation list to the list of propetected properties.
// Comparing the mutation list to the list of protected properties.
$mutations = $propPatch->getMutations();
$protected = array_intersect(

View File

@ -19,7 +19,7 @@ class InvalidResourceType extends Forbidden {
/**
* This method allows the exception to include additional information into the WebDAV error response
*
* @param DAV\Server $server
* @param \Sabre\DAV\Server $server
* @param \DOMElement $errorNode
* @return void
*/

View File

@ -43,7 +43,7 @@ abstract class Node implements DAV\INode {
*/
function getName() {
list(, $name) = URLUtil::splitPath($this->path);
list(, $name) = URLUtil::splitPath($this->path);
return $name;
}

View File

@ -19,7 +19,7 @@ abstract class File extends Node implements IFile {
*
* The data argument is a readable stream resource.
*
* After a succesful put operation, you may choose to return an ETag. The
* After a successful put operation, you may choose to return an ETag. The
* etag must always be surrounded by double-quotes. These quotes must
* appear in the actual string you're returning.
*

View File

@ -20,7 +20,7 @@ interface IFile extends INode {
*
* The data argument is a readable stream resource.
*
* After a succesful put operation, you may choose to return an ETag. The
* After a successful put operation, you may choose to return an ETag. The
* etag must always be surrounded by double-quotes. These quotes must
* appear in the actual string you're returning.
*
@ -32,7 +32,7 @@ interface IFile extends INode {
* different object on a subsequent GET you are strongly recommended to not
* return an ETag, and just return null.
*
* @param resource|data $data
* @param resource|string $data
* @return string|null
*/
function put($data);

View File

@ -7,7 +7,7 @@ namespace Sabre\DAV;
* nodes may be moved into this collection".
*
* The benefit of this, is that sabre/dav will by default perform a move, by
* tranfersing an entire directory tree, copying every collection, and deleting
* transferring an entire directory tree, copying every collection, and deleting
* every item.
*
* If a backend supports a better optimized move operation, this can trigger

View File

@ -33,7 +33,7 @@ class PDO extends AbstractBackend {
/**
* Constructor
*
* @param PDO $pdo
* @param \PDO $pdo
*/
function __construct(\PDO $pdo) {
@ -102,7 +102,7 @@ class PDO extends AbstractBackend {
$lockInfo->created = $row['created'];
$lockInfo->scope = $row['scope'];
$lockInfo->depth = $row['depth'];
$lockInfo->uri = $row['uri'];
$lockInfo->uri = $row['uri'];
$lockList[] = $lockInfo;
}

View File

@ -25,14 +25,14 @@ class Plugin extends DAV\ServerPlugin {
/**
* locksBackend
*
* @var Backend\Backend\Interface
* @var Backend\BackendInterface
*/
protected $locksBackend;
/**
* server
*
* @var Sabre\DAV\Server
* @var DAV\Server
*/
protected $server;
@ -256,7 +256,7 @@ class Plugin extends DAV\ServerPlugin {
$response->setStatus($newFile ? 201 : 200);
$response->setBody($this->generateLockResponse($lockInfo));
// Returning false will interupt the event chain and mark this method
// Returning false will interrupt the event chain and mark this method
// as 'handled'.
return false;

View File

@ -61,6 +61,7 @@ class MkCol extends PropPatch {
* checked.
*
* @param string|string[] $resourceType
* @return bool
*/
function hasResourceType($resourceType) {

View File

@ -20,7 +20,7 @@ class Plugin extends DAV\ServerPlugin {
/**
* Reference to Server class
*
* @var Sabre\DAV\Server
* @var DAV\Server
*/
protected $server;

Some files were not shown because too many files have changed in this diff Show More