update to sabre/dav to version 3.2.0

This commit is contained in:
Mario Vavti 2016-06-28 21:45:14 +02:00
parent feaad50b6c
commit dcc65bbacb
21 changed files with 321 additions and 226 deletions

2
vendor/autoload.php vendored
View File

@ -4,4 +4,4 @@
require_once __DIR__ . '/composer' . '/autoload_real.php'; require_once __DIR__ . '/composer' . '/autoload_real.php';
return ComposerAutoloaderInit83c487173ca2d4f0ca8866f7816b9ab4::getLoader(); return ComposerAutoloaderInit02c7a5bb99a87a4c8dbf069d69b1a15c::getLoader();

View File

@ -7,10 +7,10 @@ $baseDir = dirname($vendorDir);
return array( return array(
'383eaff206634a77a1be54e64e6459c7' => $vendorDir . '/sabre/uri/lib/functions.php', '383eaff206634a77a1be54e64e6459c7' => $vendorDir . '/sabre/uri/lib/functions.php',
'3569eecfeed3bcf0bad3c998a494ecb8' => $vendorDir . '/sabre/xml/lib/Deserializer/functions.php',
'93aa591bc4ca510c520999e34229ee79' => $vendorDir . '/sabre/xml/lib/Serializer/functions.php',
'2b9d0f43f9552984cfa82fee95491826' => $vendorDir . '/sabre/event/lib/coroutine.php', '2b9d0f43f9552984cfa82fee95491826' => $vendorDir . '/sabre/event/lib/coroutine.php',
'd81bab31d3feb45bfe2f283ea3c8fdf7' => $vendorDir . '/sabre/event/lib/Loop/functions.php', 'd81bab31d3feb45bfe2f283ea3c8fdf7' => $vendorDir . '/sabre/event/lib/Loop/functions.php',
'a1cce3d26cc15c00fcd0b3354bd72c88' => $vendorDir . '/sabre/event/lib/Promise/functions.php', 'a1cce3d26cc15c00fcd0b3354bd72c88' => $vendorDir . '/sabre/event/lib/Promise/functions.php',
'3569eecfeed3bcf0bad3c998a494ecb8' => $vendorDir . '/sabre/xml/lib/Deserializer/functions.php',
'93aa591bc4ca510c520999e34229ee79' => $vendorDir . '/sabre/xml/lib/Serializer/functions.php',
'ebdb698ed4152ae445614b69b5e4bb6a' => $vendorDir . '/sabre/http/lib/functions.php', 'ebdb698ed4152ae445614b69b5e4bb6a' => $vendorDir . '/sabre/http/lib/functions.php',
); );

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer // autoload_real.php @generated by Composer
class ComposerAutoloaderInit83c487173ca2d4f0ca8866f7816b9ab4 class ComposerAutoloaderInit02c7a5bb99a87a4c8dbf069d69b1a15c
{ {
private static $loader; private static $loader;
@ -19,15 +19,15 @@ class ComposerAutoloaderInit83c487173ca2d4f0ca8866f7816b9ab4
return self::$loader; return self::$loader;
} }
spl_autoload_register(array('ComposerAutoloaderInit83c487173ca2d4f0ca8866f7816b9ab4', 'loadClassLoader'), true, true); spl_autoload_register(array('ComposerAutoloaderInit02c7a5bb99a87a4c8dbf069d69b1a15c', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(); self::$loader = $loader = new \Composer\Autoload\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInit83c487173ca2d4f0ca8866f7816b9ab4', 'loadClassLoader')); spl_autoload_unregister(array('ComposerAutoloaderInit02c7a5bb99a87a4c8dbf069d69b1a15c', 'loadClassLoader'));
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION'); $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION');
if ($useStaticLoader) { if ($useStaticLoader) {
require_once __DIR__ . '/autoload_static.php'; require_once __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit83c487173ca2d4f0ca8866f7816b9ab4::getInitializer($loader)); call_user_func(\Composer\Autoload\ComposerStaticInit02c7a5bb99a87a4c8dbf069d69b1a15c::getInitializer($loader));
} else { } else {
$map = require __DIR__ . '/autoload_namespaces.php'; $map = require __DIR__ . '/autoload_namespaces.php';
foreach ($map as $namespace => $path) { foreach ($map as $namespace => $path) {
@ -48,19 +48,19 @@ class ComposerAutoloaderInit83c487173ca2d4f0ca8866f7816b9ab4
$loader->register(true); $loader->register(true);
if ($useStaticLoader) { if ($useStaticLoader) {
$includeFiles = Composer\Autoload\ComposerStaticInit83c487173ca2d4f0ca8866f7816b9ab4::$files; $includeFiles = Composer\Autoload\ComposerStaticInit02c7a5bb99a87a4c8dbf069d69b1a15c::$files;
} else { } else {
$includeFiles = require __DIR__ . '/autoload_files.php'; $includeFiles = require __DIR__ . '/autoload_files.php';
} }
foreach ($includeFiles as $fileIdentifier => $file) { foreach ($includeFiles as $fileIdentifier => $file) {
composerRequire83c487173ca2d4f0ca8866f7816b9ab4($fileIdentifier, $file); composerRequire02c7a5bb99a87a4c8dbf069d69b1a15c($fileIdentifier, $file);
} }
return $loader; return $loader;
} }
} }
function composerRequire83c487173ca2d4f0ca8866f7816b9ab4($fileIdentifier, $file) function composerRequire02c7a5bb99a87a4c8dbf069d69b1a15c($fileIdentifier, $file)
{ {
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
require $file; require $file;

View File

@ -4,15 +4,15 @@
namespace Composer\Autoload; namespace Composer\Autoload;
class ComposerStaticInit83c487173ca2d4f0ca8866f7816b9ab4 class ComposerStaticInit02c7a5bb99a87a4c8dbf069d69b1a15c
{ {
public static $files = array ( public static $files = array (
'383eaff206634a77a1be54e64e6459c7' => __DIR__ . '/..' . '/sabre/uri/lib/functions.php', '383eaff206634a77a1be54e64e6459c7' => __DIR__ . '/..' . '/sabre/uri/lib/functions.php',
'3569eecfeed3bcf0bad3c998a494ecb8' => __DIR__ . '/..' . '/sabre/xml/lib/Deserializer/functions.php',
'93aa591bc4ca510c520999e34229ee79' => __DIR__ . '/..' . '/sabre/xml/lib/Serializer/functions.php',
'2b9d0f43f9552984cfa82fee95491826' => __DIR__ . '/..' . '/sabre/event/lib/coroutine.php', '2b9d0f43f9552984cfa82fee95491826' => __DIR__ . '/..' . '/sabre/event/lib/coroutine.php',
'd81bab31d3feb45bfe2f283ea3c8fdf7' => __DIR__ . '/..' . '/sabre/event/lib/Loop/functions.php', 'd81bab31d3feb45bfe2f283ea3c8fdf7' => __DIR__ . '/..' . '/sabre/event/lib/Loop/functions.php',
'a1cce3d26cc15c00fcd0b3354bd72c88' => __DIR__ . '/..' . '/sabre/event/lib/Promise/functions.php', 'a1cce3d26cc15c00fcd0b3354bd72c88' => __DIR__ . '/..' . '/sabre/event/lib/Promise/functions.php',
'3569eecfeed3bcf0bad3c998a494ecb8' => __DIR__ . '/..' . '/sabre/xml/lib/Deserializer/functions.php',
'93aa591bc4ca510c520999e34229ee79' => __DIR__ . '/..' . '/sabre/xml/lib/Serializer/functions.php',
'ebdb698ed4152ae445614b69b5e4bb6a' => __DIR__ . '/..' . '/sabre/http/lib/functions.php', 'ebdb698ed4152ae445614b69b5e4bb6a' => __DIR__ . '/..' . '/sabre/http/lib/functions.php',
); );
@ -83,9 +83,9 @@ class ComposerStaticInit83c487173ca2d4f0ca8866f7816b9ab4
public static function getInitializer(ClassLoader $loader) public static function getInitializer(ClassLoader $loader)
{ {
return \Closure::bind(function () use ($loader) { return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit83c487173ca2d4f0ca8866f7816b9ab4::$prefixLengthsPsr4; $loader->prefixLengthsPsr4 = ComposerStaticInit02c7a5bb99a87a4c8dbf069d69b1a15c::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit83c487173ca2d4f0ca8866f7816b9ab4::$prefixDirsPsr4; $loader->prefixDirsPsr4 = ComposerStaticInit02c7a5bb99a87a4c8dbf069d69b1a15c::$prefixDirsPsr4;
$loader->prefixesPsr0 = ComposerStaticInit83c487173ca2d4f0ca8866f7816b9ab4::$prefixesPsr0; $loader->prefixesPsr0 = ComposerStaticInit02c7a5bb99a87a4c8dbf069d69b1a15c::$prefixesPsr0;
}, null, ClassLoader::class); }, null, ClassLoader::class);
} }

View File

@ -1,44 +1,4 @@
[ [
{
"name": "psr/log",
"version": "1.0.0",
"version_normalized": "1.0.0.0",
"source": {
"type": "git",
"url": "https://github.com/php-fig/log.git",
"reference": "fe0936ee26643249e916849d48e3a51d5f5e278b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/log/zipball/fe0936ee26643249e916849d48e3a51d5f5e278b",
"reference": "fe0936ee26643249e916849d48e3a51d5f5e278b",
"shasum": ""
},
"time": "2012-12-21 11:40:51",
"type": "library",
"installation-source": "dist",
"autoload": {
"psr-0": {
"Psr\\Log\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP-FIG",
"homepage": "http://www.php-fig.org/"
}
],
"description": "Common interface for logging libraries",
"keywords": [
"log",
"psr",
"psr-3"
]
},
{ {
"name": "sabre/uri", "name": "sabre/uri",
"version": "1.1.0", "version": "1.1.0",
@ -92,122 +52,6 @@
"url" "url"
] ]
}, },
{
"name": "sabre/event",
"version": "3.0.0",
"version_normalized": "3.0.0.0",
"source": {
"type": "git",
"url": "https://github.com/fruux/sabre-event.git",
"reference": "831d586f5a442dceacdcf5e9c4c36a4db99a3534"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/fruux/sabre-event/zipball/831d586f5a442dceacdcf5e9c4c36a4db99a3534",
"reference": "831d586f5a442dceacdcf5e9c4c36a4db99a3534",
"shasum": ""
},
"require": {
"php": ">=5.5"
},
"require-dev": {
"phpunit/phpunit": "*",
"sabre/cs": "~0.0.4"
},
"time": "2015-11-05 20:14:39",
"type": "library",
"installation-source": "dist",
"autoload": {
"psr-4": {
"Sabre\\Event\\": "lib/"
},
"files": [
"lib/coroutine.php",
"lib/Loop/functions.php",
"lib/Promise/functions.php"
]
},
"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": "sabre/event is a library for lightweight event-based programming",
"homepage": "http://sabre.io/event/",
"keywords": [
"EventEmitter",
"async",
"events",
"hooks",
"plugin",
"promise",
"signal"
]
},
{
"name": "sabre/http",
"version": "4.2.1",
"version_normalized": "4.2.1.0",
"source": {
"type": "git",
"url": "https://github.com/fruux/sabre-http.git",
"reference": "2e93bc8321524c67be4ca5b8415daebd4c8bf85e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/fruux/sabre-http/zipball/2e93bc8321524c67be4ca5b8415daebd4c8bf85e",
"reference": "2e93bc8321524c67be4ca5b8415daebd4c8bf85e",
"shasum": ""
},
"require": {
"ext-mbstring": "*",
"php": ">=5.4",
"sabre/event": ">=1.0.0,<4.0.0",
"sabre/uri": "~1.0"
},
"require-dev": {
"phpunit/phpunit": "~4.3",
"sabre/cs": "~0.0.1"
},
"suggest": {
"ext-curl": " to make http requests with the Client class"
},
"time": "2016-01-06 23:00:08",
"type": "library",
"installation-source": "dist",
"autoload": {
"files": [
"lib/functions.php"
],
"psr-4": {
"Sabre\\HTTP\\": "lib/"
}
},
"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": "The sabre/http library provides utilities for dealing with http requests and responses. ",
"homepage": "https://github.com/fruux/sabre-http",
"keywords": [
"http"
]
},
{ {
"name": "sabre/xml", "name": "sabre/xml",
"version": "1.4.2", "version": "1.4.2",
@ -371,18 +215,174 @@
] ]
}, },
{ {
"name": "sabre/dav", "name": "sabre/event",
"version": "3.2.0-beta1", "version": "3.0.0",
"version_normalized": "3.2.0.0-beta1", "version_normalized": "3.0.0.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/fruux/sabre-dav.git", "url": "https://github.com/fruux/sabre-event.git",
"reference": "32524c79a5890056123aa64499719e7c061bfde8" "reference": "831d586f5a442dceacdcf5e9c4c36a4db99a3534"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/fruux/sabre-dav/zipball/32524c79a5890056123aa64499719e7c061bfde8", "url": "https://api.github.com/repos/fruux/sabre-event/zipball/831d586f5a442dceacdcf5e9c4c36a4db99a3534",
"reference": "32524c79a5890056123aa64499719e7c061bfde8", "reference": "831d586f5a442dceacdcf5e9c4c36a4db99a3534",
"shasum": ""
},
"require": {
"php": ">=5.5"
},
"require-dev": {
"phpunit/phpunit": "*",
"sabre/cs": "~0.0.4"
},
"time": "2015-11-05 20:14:39",
"type": "library",
"installation-source": "dist",
"autoload": {
"psr-4": {
"Sabre\\Event\\": "lib/"
},
"files": [
"lib/coroutine.php",
"lib/Loop/functions.php",
"lib/Promise/functions.php"
]
},
"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": "sabre/event is a library for lightweight event-based programming",
"homepage": "http://sabre.io/event/",
"keywords": [
"EventEmitter",
"async",
"events",
"hooks",
"plugin",
"promise",
"signal"
]
},
{
"name": "sabre/http",
"version": "4.2.1",
"version_normalized": "4.2.1.0",
"source": {
"type": "git",
"url": "https://github.com/fruux/sabre-http.git",
"reference": "2e93bc8321524c67be4ca5b8415daebd4c8bf85e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/fruux/sabre-http/zipball/2e93bc8321524c67be4ca5b8415daebd4c8bf85e",
"reference": "2e93bc8321524c67be4ca5b8415daebd4c8bf85e",
"shasum": ""
},
"require": {
"ext-mbstring": "*",
"php": ">=5.4",
"sabre/event": ">=1.0.0,<4.0.0",
"sabre/uri": "~1.0"
},
"require-dev": {
"phpunit/phpunit": "~4.3",
"sabre/cs": "~0.0.1"
},
"suggest": {
"ext-curl": " to make http requests with the Client class"
},
"time": "2016-01-06 23:00:08",
"type": "library",
"installation-source": "dist",
"autoload": {
"files": [
"lib/functions.php"
],
"psr-4": {
"Sabre\\HTTP\\": "lib/"
}
},
"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": "The sabre/http library provides utilities for dealing with http requests and responses. ",
"homepage": "https://github.com/fruux/sabre-http",
"keywords": [
"http"
]
},
{
"name": "psr/log",
"version": "1.0.0",
"version_normalized": "1.0.0.0",
"source": {
"type": "git",
"url": "https://github.com/php-fig/log.git",
"reference": "fe0936ee26643249e916849d48e3a51d5f5e278b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/log/zipball/fe0936ee26643249e916849d48e3a51d5f5e278b",
"reference": "fe0936ee26643249e916849d48e3a51d5f5e278b",
"shasum": ""
},
"time": "2012-12-21 11:40:51",
"type": "library",
"installation-source": "dist",
"autoload": {
"psr-0": {
"Psr\\Log\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP-FIG",
"homepage": "http://www.php-fig.org/"
}
],
"description": "Common interface for logging libraries",
"keywords": [
"log",
"psr",
"psr-3"
]
},
{
"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": "" "shasum": ""
}, },
"require": { "require": {
@ -413,7 +413,7 @@
"ext-curl": "*", "ext-curl": "*",
"ext-pdo": "*" "ext-pdo": "*"
}, },
"time": "2016-05-21 03:49:31", "time": "2016-06-28 02:44:05",
"bin": [ "bin": [
"bin/sabredav", "bin/sabredav",
"bin/naturalselection" "bin/naturalselection"

View File

@ -1,12 +1,26 @@
ChangeLog ChangeLog
========= =========
3.2.0 (2016-06-27)
------------------
* The default ACL rules allow an unauthenticated user to read information
about nodes that don't have their own ACL defined. This was a security
problem.
* The zip release ships with [sabre/vobject 4.1.0][vobj],
[sabre/http 4.2.1][http], [sabre/event 3.0.0][evnt],
[sabre/uri 1.1.0][uri] and [sabre/xml 1.4.2][xml].
3.2.0-beta1 (2016-05-20) 3.2.0-beta1 (2016-05-20)
------------------------ ------------------------
* #833: Calendars throw exceptions when the sharing plugin is not enabled. * #833: Calendars throw exceptions when the sharing plugin is not enabled.
* #834: Return vCards exactly as they were stored if we don't need to convert * #834: Return vCards exactly as they were stored if we don't need to convert
in between versions. in between versions.
* The zip release ships with [sabre/vobject 4.1.0][vobj],
[sabre/http 4.2.1][http], [sabre/event 3.0.0][evnt],
[sabre/uri 1.1.0][uri] and [sabre/xml 1.4.1][xml].
3.2.0-alpha1 (2016-05-09) 3.2.0-alpha1 (2016-05-09)
@ -70,6 +84,23 @@ ChangeLog
[sabre/uri 1.1.0][uri] and [sabre/xml 1.4.1][xml]. [sabre/uri 1.1.0][uri] and [sabre/xml 1.4.1][xml].
3.1.5 (????-??-??)
------------------
* Fixed: Creating a new calendar on some MySQL configurations caused an error.
3.1.4 (2016-05-28)
------------------
* #834: Backport from `master`: Return vCards exactly as they were stored if
we don't need to convert in between versions. This should speed up many
large addressbook syncs sometimes up to 50%.
* The zip release ships with [sabre/vobject 4.1.0][vobj],
[sabre/http 4.2.1][http], [sabre/event 3.0.0][evnt],
[sabre/uri 1.1.0][uri] and [sabre/xml 1.4.2][xml].
3.1.3 (2016-04-06) 3.1.3 (2016-04-06)
------------------ ------------------

View File

@ -237,7 +237,7 @@ if ($migrateCalendars) {
CREATE TABLE calendars ( CREATE TABLE calendars (
id INTEGER UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, id INTEGER UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
synctoken INTEGER UNSIGNED NOT NULL DEFAULT '1', synctoken INTEGER UNSIGNED NOT NULL DEFAULT '1',
components VARBINARY(20) components VARBINARY(21)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
SQL SQL
); );

View File

@ -1502,7 +1502,7 @@ SQL;
*/ */
function setPublishStatus($calendarId, $value) { function setPublishStatus($calendarId, $value) {
throw new \Exception('Not implemented'); throw new \Sabre\DAV\Exception\NotImplemented('Not implemented');
} }

View File

@ -4,8 +4,8 @@ namespace Sabre\CalDAV\Xml\Property;
use Sabre\Xml\Element; use Sabre\Xml\Element;
use Sabre\Xml\Reader; use Sabre\Xml\Reader;
use Sabre\Xml\Deserializer;
use Sabre\Xml\Writer; use Sabre\Xml\Writer;
use Sabre\Xml\Element\Elements;
use Sabre\CalDAV\Plugin; use Sabre\CalDAV\Plugin;
/** /**
@ -116,23 +116,13 @@ class ScheduleCalendarTransp implements Element {
*/ */
static function xmlDeserialize(Reader $reader) { static function xmlDeserialize(Reader $reader) {
$elems = Elements::xmlDeserialize($reader); $elems = Deserializer\enum($reader, Plugin::NS_CALDAV);
$value = null; if (in_array('transparent', $elems)) {
foreach ($elems as $elem) {
switch ($elem) {
case '{' . Plugin::NS_CALDAV . '}opaque' :
$value = self::OPAQUE;
break;
case '{' . Plugin::NS_CALDAV . '}transparent' :
$value = self::TRANSPARENT; $value = self::TRANSPARENT;
break; } else {
$value = self::OPAQUE;
} }
}
if (is_null($value))
return null;
return new self($value); return new self($value);
} }

View File

@ -25,7 +25,7 @@ class File extends AbstractDigest {
/** /**
* Creates the backend object. * Creates the backend object.
* *
* If the filename argument is passed in, it will parse out the specified file fist. * If the filename argument is passed in, it will parse out the specified file first.
* *
* @param string|null $filename * @param string|null $filename
*/ */

View File

@ -131,12 +131,7 @@ class Directory extends Node implements DAV\ICollection, DAV\IQuota, DAV\IMoveTa
foreach ($iterator as $entry) { foreach ($iterator as $entry) {
$node = $entry->getFilename(); $nodes[] = $this->getChild($entry->getFilename());
if ($node === '.sabredav')
continue;
$nodes[] = $this->getChild($node);
} }
return $nodes; return $nodes;
@ -153,9 +148,6 @@ class Directory extends Node implements DAV\ICollection, DAV\IQuota, DAV\IMoveTa
// Deleting all children // Deleting all children
foreach ($this->getChildren() as $child) $child->delete(); foreach ($this->getChildren() as $child) $child->delete();
// Removing resource info, if its still around
if (file_exists($this->path . '/.sabredav')) unlink($this->path . '/.sabredav');
// Removing the directory itself // Removing the directory itself
rmdir($this->path); rmdir($this->path);

View File

@ -14,6 +14,6 @@ class Version {
/** /**
* Full version number * Full version number
*/ */
const VERSION = '3.2.0-beta1'; const VERSION = '3.2.0';
} }

View File

@ -127,7 +127,7 @@ class ShareAccess implements Element {
switch ($elem['name']) { switch ($elem['name']) {
case '{DAV:}not-shared' : case '{DAV:}not-shared' :
return new self(SharingPlugin::ACCESS_NOTSHARED); return new self(SharingPlugin::ACCESS_NOTSHARED);
case '{DAV:}sharedowner' : case '{DAV:}shared-owner' :
return new self(SharingPlugin::ACCESS_SHAREDOWNER); return new self(SharingPlugin::ACCESS_SHAREDOWNER);
case '{DAV:}read' : case '{DAV:}read' :
return new self(SharingPlugin::ACCESS_READ); return new self(SharingPlugin::ACCESS_READ);

View File

@ -32,16 +32,11 @@ class SupportedMethodSet implements XmlSerializable, HtmlOutput {
/** /**
* Creates the property * Creates the property
* *
* Any reports passed in the constructor * @param string[] $methods
* should be valid report-types in clark-notation.
*
* Either a string or an array of strings must be passed.
*
* @param string|string[] $methods
*/ */
function __construct($methods = null) { function __construct(array $methods) {
$this->methods = (array)$methods; $this->methods = $methods;
} }

View File

@ -307,11 +307,6 @@ class Plugin extends DAV\ServerPlugin {
'protected' => true, 'protected' => true,
'privilege' => '{DAV:}all', 'privilege' => '{DAV:}all',
], ],
[
'principal' => '{DAV:}unauthenticated',
'protected' => true,
'privilege' => '{DAV:}read',
],
]; ];
/** /**

View File

@ -1418,4 +1418,14 @@ abstract class AbstractPDOTest extends \PHPUnit_Framework_TestCase {
} }
/**
* @expectedException \Sabre\DAV\Exception\NotImplemented
*/
function testSetPublishStatus() {
$backend = new PDO($this->pdo);
$backend->setPublishStatus([1, 1], true);
}
} }

View File

@ -23,8 +23,7 @@ class FileTest extends \PHPUnit_Framework_TestCase {
function testLoadFileBroken() { function testLoadFileBroken() {
file_put_contents(SABRE_TEMPDIR . '/backend', 'user:realm:hash'); file_put_contents(SABRE_TEMPDIR . '/backend', 'user:realm:hash');
$file = new File(); $file = new File(SABRE_TEMPDIR . '/backend');
$file->loadFile(SABRE_TEMPDIR . '/backend');
} }

View File

@ -48,6 +48,25 @@ class PluginTest extends \PHPUnit_Framework_TestCase {
} }
/**
* @depends testAuthenticateFail
*/
function testAuthenticateFailDontAutoRequire() {
$fakeServer = new DAV\Server(new DAV\SimpleCollection('bla'));
$backend = new Backend\Mock();
$backend->fail = true;
$plugin = new Plugin($backend);
$plugin->autoRequireLogin = false;
$fakeServer->addPlugin($plugin);
$this->assertTrue(
$fakeServer->emit('beforeMethod', [new HTTP\Request(), new HTTP\Response()])
);
$this->assertEquals(1, count($plugin->getLoginFailedReasons()));
}
/** /**
* @depends testAuthenticate * @depends testAuthenticate
*/ */

View File

@ -31,7 +31,9 @@ class ServerEventsTest extends AbstractServer {
function testAfterResponse() { function testAfterResponse() {
$mock = $this->getMock('stdClass', ['afterResponseCallback']); $mock = $this->getMockBuilder('stdClass')
->setMethods(['afterResponseCallback'])
->getMock();
$mock->expects($this->once())->method('afterResponseCallback'); $mock->expects($this->once())->method('afterResponseCallback');
$this->server->on('afterResponse', [$mock, 'afterResponseCallback']); $this->server->on('afterResponse', [$mock, 'afterResponseCallback']);

View File

@ -34,6 +34,13 @@ class ExpandPropertiesTest extends \PHPUnit_Framework_TestCase {
$fakeServer->httpResponse = new HTTP\ResponseMock(); $fakeServer->httpResponse = new HTTP\ResponseMock();
$plugin = new Plugin(); $plugin = new Plugin();
$plugin->allowUnauthenticatedAccess = false; $plugin->allowUnauthenticatedAccess = false;
// Anyone can do anything
$plugin->setDefaultACL([
[
'principal' => '{DAV:}all',
'privilege' => '{DAV:}all',
]
]);
$this->assertTrue($plugin instanceof Plugin); $this->assertTrue($plugin instanceof Plugin);
$fakeServer->addPlugin($plugin); $fakeServer->addPlugin($plugin);

View File

@ -11,6 +11,13 @@ class PluginPropertiesTest extends \PHPUnit_Framework_TestCase {
$plugin = new Plugin(); $plugin = new Plugin();
$plugin->allowUnauthenticatedAccess = false; $plugin->allowUnauthenticatedAccess = false;
$plugin->setDefaultACL([
[
'principal' => '{DAV:}all',
'privilege' => '{DAV:}all',
],
]);
//Anyone can do anything
$plugin->principalCollectionSet = [ $plugin->principalCollectionSet = [
'principals1', 'principals1',
'principals2', 'principals2',
@ -47,6 +54,12 @@ class PluginPropertiesTest extends \PHPUnit_Framework_TestCase {
$plugin = new DAV\Auth\Plugin(new DAV\Auth\Backend\Mock()); $plugin = new DAV\Auth\Plugin(new DAV\Auth\Backend\Mock());
$fakeServer->addPlugin($plugin); $fakeServer->addPlugin($plugin);
$plugin = new Plugin(); $plugin = new Plugin();
$plugin->setDefaultACL([
[
'principal' => '{DAV:}all',
'privilege' => '{DAV:}all',
],
]);
$fakeServer->addPlugin($plugin); $fakeServer->addPlugin($plugin);
@ -80,6 +93,12 @@ class PluginPropertiesTest extends \PHPUnit_Framework_TestCase {
$plugin = new Plugin(); $plugin = new Plugin();
$plugin->allowUnauthenticatedAccess = false; $plugin->allowUnauthenticatedAccess = false;
$plugin->setDefaultACL([
[
'principal' => '{DAV:}all',
'privilege' => '{DAV:}all',
],
]);
$server = new DAV\Server(); $server = new DAV\Server();
$server->addPlugin($plugin); $server->addPlugin($plugin);
@ -140,6 +159,12 @@ class PluginPropertiesTest extends \PHPUnit_Framework_TestCase {
$plugin = new Plugin(); $plugin = new Plugin();
$plugin->allowUnauthenticatedAccess = false; $plugin->allowUnauthenticatedAccess = false;
$plugin->setDefaultACL([
[
'principal' => '{DAV:}all',
'privilege' => '{DAV:}all',
],
]);
$nodes = [ $nodes = [
new MockACLNode('foo', [ new MockACLNode('foo', [
@ -227,6 +252,12 @@ class PluginPropertiesTest extends \PHPUnit_Framework_TestCase {
//$fakeServer->addPlugin($plugin); //$fakeServer->addPlugin($plugin);
$plugin = new Plugin(); $plugin = new Plugin();
$plugin->allowUnauthenticatedAccess = false; $plugin->allowUnauthenticatedAccess = false;
$plugin->setDefaultACL([
[
'principal' => '{DAV:}all',
'privilege' => '{DAV:}all',
],
]);
$fakeServer->addPlugin($plugin); $fakeServer->addPlugin($plugin);
$requestedProperties = [ $requestedProperties = [
@ -256,6 +287,12 @@ class PluginPropertiesTest extends \PHPUnit_Framework_TestCase {
//$fakeServer->addPlugin($plugin); //$fakeServer->addPlugin($plugin);
$plugin = new Plugin(); $plugin = new Plugin();
$plugin->allowUnauthenticatedAccess = false; $plugin->allowUnauthenticatedAccess = false;
$plugin->setDefaultACL([
[
'principal' => '{DAV:}all',
'privilege' => '{DAV:}all',
],
]);
$fakeServer->addPlugin($plugin); $fakeServer->addPlugin($plugin);
$requestedProperties = [ $requestedProperties = [
@ -286,6 +323,12 @@ class PluginPropertiesTest extends \PHPUnit_Framework_TestCase {
//$fakeServer->addPlugin($plugin); //$fakeServer->addPlugin($plugin);
$plugin = new Plugin(); $plugin = new Plugin();
$plugin->allowUnauthenticatedAccess = false; $plugin->allowUnauthenticatedAccess = false;
$plugin->setDefaultACL([
[
'principal' => '{DAV:}all',
'privilege' => '{DAV:}all',
],
]);
$fakeServer->addPlugin($plugin); $fakeServer->addPlugin($plugin);
$requestedProperties = [ $requestedProperties = [
@ -315,6 +358,12 @@ class PluginPropertiesTest extends \PHPUnit_Framework_TestCase {
$plugin = new Plugin(); $plugin = new Plugin();
$plugin->allowUnauthenticatedAccess = false; $plugin->allowUnauthenticatedAccess = false;
$fakeServer->addPlugin($plugin); $fakeServer->addPlugin($plugin);
$plugin->setDefaultACL([
[
'principal' => '{DAV:}all',
'privilege' => '{DAV:}all',
],
]);
$requestedProperties = [ $requestedProperties = [
'{DAV:}group-membership', '{DAV:}group-membership',
@ -343,6 +392,12 @@ class PluginPropertiesTest extends \PHPUnit_Framework_TestCase {
$plugin = new Plugin(); $plugin = new Plugin();
$plugin->allowUnauthenticatedAccess = false; $plugin->allowUnauthenticatedAccess = false;
$fakeServer->addPlugin($plugin); $fakeServer->addPlugin($plugin);
$plugin->setDefaultACL([
[
'principal' => '{DAV:}all',
'privilege' => '{DAV:}all',
],
]);
$requestedProperties = [ $requestedProperties = [
'{DAV:}displayname', '{DAV:}displayname',