';
$events = array();
$out .= img_picto('', 'resource', 'class="pictofixedwidth"');
-$out .= $formresources->select_resource_list('', 'fk_resource', '', 1, 1, 0, $events, '', 2, null);
+$out .= $formresources->select_resource_list(0, 'fk_resource', '', 1, 1, 0, $events, '', 2, null);
$out .= '
';
$out .= ' ';
diff --git a/htdocs/dav/fileserver.php b/htdocs/dav/fileserver.php
index 9ebe9ae4099..d6df1a7af4d 100644
--- a/htdocs/dav/fileserver.php
+++ b/htdocs/dav/fileserver.php
@@ -49,7 +49,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
require_once DOL_DOCUMENT_ROOT.'/dav/dav.class.php';
require_once DOL_DOCUMENT_ROOT.'/dav/dav.lib.php';
+
require_once DOL_DOCUMENT_ROOT.'/includes/sabre/autoload.php';
+//require_once DOL_DOCUMENT_ROOT.'/includes/autoload.php';
$user = new User($db);
diff --git a/htdocs/fichinter/class/fichinterrec.class.php b/htdocs/fichinter/class/fichinterrec.class.php
index 671c566009d..beb2d6358c2 100644
--- a/htdocs/fichinter/class/fichinterrec.class.php
+++ b/htdocs/fichinter/class/fichinterrec.class.php
@@ -471,7 +471,7 @@ class FichinterRec extends Fichinter
* @param double $remise_percent Percentage of discount on line
* @param string $price_base_type HT or TTC
* @param int $info_bits Bits for type of lines
- * @param int $fk_remise_except Id discount
+ * @param int $fk_remise_except Id discount (not used)
* @param double $pu_ttc Unit price with tax (> 0 even for credit note)
* @param int $type Type of line (0=product, 1=service)
* @param int $special_code Special code
@@ -479,7 +479,7 @@ class FichinterRec extends Fichinter
* @param string $fk_unit Unit
* @return int Return integer <0 if KO, Id of line if OK
*/
- public function addline($desc, $duration, $date, $rang = -1, $pu_ht = 0, $qty = 0, $txtva = 0, $fk_product = 0, $remise_percent = 0, $price_base_type = 'HT', $info_bits = 0, $fk_remise_except = '', $pu_ttc = 0, $type = 0, $special_code = 0, $label = '', $fk_unit = null)
+ public function addline($desc, $duration, $date, $rang = -1, $pu_ht = 0, $qty = 0, $txtva = 0, $fk_product = 0, $remise_percent = 0, $price_base_type = 'HT', $info_bits = 0, $fk_remise_except = 0, $pu_ttc = 0, $type = 0, $special_code = 0, $label = '', $fk_unit = null)
{
global $mysoc;
diff --git a/htdocs/includes/sabre/autoload.php b/htdocs/includes/sabre/autoload.php
index d8ccc5f35c3..fffd9ae73be 100644
--- a/htdocs/includes/sabre/autoload.php
+++ b/htdocs/includes/sabre/autoload.php
@@ -4,4 +4,4 @@
require_once __DIR__ . '/composer/autoload_real.php';
-return ComposerAutoloaderInit60b9ac98a8448ede6c445b0fd4bd31e0::getLoader();
+return ComposerAutoloaderInit51cd53f153efda61d1f1f814155d1c4a::getLoader();
diff --git a/htdocs/includes/sabre/composer.json b/htdocs/includes/sabre/composer.json
new file mode 100644
index 00000000000..dc9dcc24803
--- /dev/null
+++ b/htdocs/includes/sabre/composer.json
@@ -0,0 +1,6 @@
+{
+ "require" : {
+ "php": ">=7.1.0",
+ "sabre/dav" : ">=3.0.0"
+ }
+}
\ No newline at end of file
diff --git a/htdocs/includes/sabre/composer.lock b/htdocs/includes/sabre/composer.lock
new file mode 100644
index 00000000000..e42ea662f93
--- /dev/null
+++ b/htdocs/includes/sabre/composer.lock
@@ -0,0 +1,513 @@
+{
+ "_readme": [
+ "This file locks the dependencies of your project to a known state",
+ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
+ "This file is @generated automatically"
+ ],
+ "content-hash": "fffed375dc9f645f46fc681f0b1b7f07",
+ "packages": [
+ {
+ "name": "psr/log",
+ "version": "1.1.4",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/php-fig/log.git",
+ "reference": "d49695b909c3b7628b6289db5479a1c204601f11"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11",
+ "reference": "d49695b909c3b7628b6289db5479a1c204601f11",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.1.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Psr\\Log\\": "Psr/Log/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "PHP-FIG",
+ "homepage": "https://www.php-fig.org/"
+ }
+ ],
+ "description": "Common interface for logging libraries",
+ "homepage": "https://github.com/php-fig/log",
+ "keywords": [
+ "log",
+ "psr",
+ "psr-3"
+ ],
+ "support": {
+ "source": "https://github.com/php-fig/log/tree/1.1.4"
+ },
+ "time": "2021-05-03T11:20:27+00:00"
+ },
+ {
+ "name": "sabre/dav",
+ "version": "4.6.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sabre-io/dav.git",
+ "reference": "554145304b4a026477d130928d16e626939b0b2a"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sabre-io/dav/zipball/554145304b4a026477d130928d16e626939b0b2a",
+ "reference": "554145304b4a026477d130928d16e626939b0b2a",
+ "shasum": ""
+ },
+ "require": {
+ "ext-ctype": "*",
+ "ext-date": "*",
+ "ext-dom": "*",
+ "ext-iconv": "*",
+ "ext-json": "*",
+ "ext-mbstring": "*",
+ "ext-pcre": "*",
+ "ext-simplexml": "*",
+ "ext-spl": "*",
+ "lib-libxml": ">=2.7.0",
+ "php": "^7.1.0 || ^8.0",
+ "psr/log": "^1.0 || ^2.0 || ^3.0",
+ "sabre/event": "^5.0",
+ "sabre/http": "^5.0.5",
+ "sabre/uri": "^2.0",
+ "sabre/vobject": "^4.2.1",
+ "sabre/xml": "^2.0.1"
+ },
+ "require-dev": {
+ "friendsofphp/php-cs-fixer": "^2.19",
+ "monolog/monolog": "^1.27 || ^2.0",
+ "phpstan/phpstan": "^0.12 || ^1.0",
+ "phpstan/phpstan-phpunit": "^1.0",
+ "phpunit/phpunit": "^7.5 || ^8.5 || ^9.6"
+ },
+ "suggest": {
+ "ext-curl": "*",
+ "ext-imap": "*",
+ "ext-pdo": "*"
+ },
+ "bin": [
+ "bin/sabredav",
+ "bin/naturalselection"
+ ],
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Sabre\\": "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": "WebDAV Framework for PHP",
+ "homepage": "http://sabre.io/",
+ "keywords": [
+ "CalDAV",
+ "CardDAV",
+ "WebDAV",
+ "framework",
+ "iCalendar"
+ ],
+ "support": {
+ "forum": "https://groups.google.com/group/sabredav-discuss",
+ "issues": "https://github.com/sabre-io/dav/issues",
+ "source": "https://github.com/fruux/sabre-dav"
+ },
+ "time": "2023-12-11T13:01:23+00:00"
+ },
+ {
+ "name": "sabre/event",
+ "version": "5.1.4",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sabre-io/event.git",
+ "reference": "d7da22897125d34d7eddf7977758191c06a74497"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sabre-io/event/zipball/d7da22897125d34d7eddf7977758191c06a74497",
+ "reference": "d7da22897125d34d7eddf7977758191c06a74497",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.1 || ^8.0"
+ },
+ "require-dev": {
+ "friendsofphp/php-cs-fixer": "~2.17.1",
+ "phpstan/phpstan": "^0.12",
+ "phpunit/phpunit": "^7.5 || ^8.5 || ^9.0"
+ },
+ "type": "library",
+ "autoload": {
+ "files": [
+ "lib/coroutine.php",
+ "lib/Loop/functions.php",
+ "lib/Promise/functions.php"
+ ],
+ "psr-4": {
+ "Sabre\\Event\\": "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": "sabre/event is a library for lightweight event-based programming",
+ "homepage": "http://sabre.io/event/",
+ "keywords": [
+ "EventEmitter",
+ "async",
+ "coroutine",
+ "eventloop",
+ "events",
+ "hooks",
+ "plugin",
+ "promise",
+ "reactor",
+ "signal"
+ ],
+ "support": {
+ "forum": "https://groups.google.com/group/sabredav-discuss",
+ "issues": "https://github.com/sabre-io/event/issues",
+ "source": "https://github.com/fruux/sabre-event"
+ },
+ "time": "2021-11-04T06:51:17+00:00"
+ },
+ {
+ "name": "sabre/http",
+ "version": "5.1.10",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sabre-io/http.git",
+ "reference": "f9f3d1fba8916fa2f4ec25636c4fedc26cb94e02"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sabre-io/http/zipball/f9f3d1fba8916fa2f4ec25636c4fedc26cb94e02",
+ "reference": "f9f3d1fba8916fa2f4ec25636c4fedc26cb94e02",
+ "shasum": ""
+ },
+ "require": {
+ "ext-ctype": "*",
+ "ext-curl": "*",
+ "ext-mbstring": "*",
+ "php": "^7.1 || ^8.0",
+ "sabre/event": ">=4.0 <6.0",
+ "sabre/uri": "^2.0"
+ },
+ "require-dev": {
+ "friendsofphp/php-cs-fixer": "~2.17.1",
+ "phpstan/phpstan": "^0.12",
+ "phpunit/phpunit": "^7.5 || ^8.5 || ^9.0"
+ },
+ "suggest": {
+ "ext-curl": " to make http requests with the Client class"
+ },
+ "type": "library",
+ "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"
+ ],
+ "support": {
+ "forum": "https://groups.google.com/group/sabredav-discuss",
+ "issues": "https://github.com/sabre-io/http/issues",
+ "source": "https://github.com/fruux/sabre-http"
+ },
+ "time": "2023-08-18T01:55:28+00:00"
+ },
+ {
+ "name": "sabre/uri",
+ "version": "2.2.4",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sabre-io/uri.git",
+ "reference": "c0c9af9f7754e60a49ebd760e1708adc6d1510c0"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sabre-io/uri/zipball/c0c9af9f7754e60a49ebd760e1708adc6d1510c0",
+ "reference": "c0c9af9f7754e60a49ebd760e1708adc6d1510c0",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.1 || ^8.0"
+ },
+ "require-dev": {
+ "friendsofphp/php-cs-fixer": "~2.19.3",
+ "phpstan/phpstan": "^0.12",
+ "phpunit/phpunit": "^7.5 || ^8.5 || ^9.0"
+ },
+ "type": "library",
+ "autoload": {
+ "files": [
+ "lib/functions.php"
+ ],
+ "psr-4": {
+ "Sabre\\Uri\\": "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": "Functions for making sense out of URIs.",
+ "homepage": "http://sabre.io/uri/",
+ "keywords": [
+ "rfc3986",
+ "uri",
+ "url"
+ ],
+ "support": {
+ "forum": "https://groups.google.com/group/sabredav-discuss",
+ "issues": "https://github.com/sabre-io/uri/issues",
+ "source": "https://github.com/fruux/sabre-uri"
+ },
+ "time": "2022-09-19T12:25:28+00:00"
+ },
+ {
+ "name": "sabre/vobject",
+ "version": "4.5.4",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sabre-io/vobject.git",
+ "reference": "a6d53a3e5bec85ed3dd78868b7de0f5b4e12f772"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sabre-io/vobject/zipball/a6d53a3e5bec85ed3dd78868b7de0f5b4e12f772",
+ "reference": "a6d53a3e5bec85ed3dd78868b7de0f5b4e12f772",
+ "shasum": ""
+ },
+ "require": {
+ "ext-mbstring": "*",
+ "php": "^7.1 || ^8.0",
+ "sabre/xml": "^2.1 || ^3.0 || ^4.0"
+ },
+ "require-dev": {
+ "friendsofphp/php-cs-fixer": "~2.17.1",
+ "phpstan/phpstan": "^0.12",
+ "phpunit/php-invoker": "^2.0 || ^3.1",
+ "phpunit/phpunit": "^7.5 || ^8.5 || ^9.0"
+ },
+ "suggest": {
+ "hoa/bench": "If you would like to run the benchmark scripts"
+ },
+ "bin": [
+ "bin/vobject",
+ "bin/generate_vcards"
+ ],
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "4.0.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Sabre\\VObject\\": "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"
+ },
+ {
+ "name": "Dominik Tobschall",
+ "email": "dominik@fruux.com",
+ "homepage": "http://tobschall.de/",
+ "role": "Developer"
+ },
+ {
+ "name": "Ivan Enderlin",
+ "email": "ivan.enderlin@hoa-project.net",
+ "homepage": "http://mnt.io/",
+ "role": "Developer"
+ }
+ ],
+ "description": "The VObject library for PHP allows you to easily parse and manipulate iCalendar and vCard objects",
+ "homepage": "http://sabre.io/vobject/",
+ "keywords": [
+ "availability",
+ "freebusy",
+ "iCalendar",
+ "ical",
+ "ics",
+ "jCal",
+ "jCard",
+ "recurrence",
+ "rfc2425",
+ "rfc2426",
+ "rfc2739",
+ "rfc4770",
+ "rfc5545",
+ "rfc5546",
+ "rfc6321",
+ "rfc6350",
+ "rfc6351",
+ "rfc6474",
+ "rfc6638",
+ "rfc6715",
+ "rfc6868",
+ "vCalendar",
+ "vCard",
+ "vcf",
+ "xCal",
+ "xCard"
+ ],
+ "support": {
+ "forum": "https://groups.google.com/group/sabredav-discuss",
+ "issues": "https://github.com/sabre-io/vobject/issues",
+ "source": "https://github.com/fruux/sabre-vobject"
+ },
+ "time": "2023-11-09T12:54:37+00:00"
+ },
+ {
+ "name": "sabre/xml",
+ "version": "2.2.6",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sabre-io/xml.git",
+ "reference": "9cde7cdab1e50893cc83b037b40cd47bfde42a2b"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sabre-io/xml/zipball/9cde7cdab1e50893cc83b037b40cd47bfde42a2b",
+ "reference": "9cde7cdab1e50893cc83b037b40cd47bfde42a2b",
+ "shasum": ""
+ },
+ "require": {
+ "ext-dom": "*",
+ "ext-xmlreader": "*",
+ "ext-xmlwriter": "*",
+ "lib-libxml": ">=2.6.20",
+ "php": "^7.1 || ^8.0",
+ "sabre/uri": ">=1.0,<3.0.0"
+ },
+ "require-dev": {
+ "friendsofphp/php-cs-fixer": "~2.17.1",
+ "phpstan/phpstan": "^0.12",
+ "phpunit/phpunit": "^7.5 || ^8.5 || ^9.0"
+ },
+ "type": "library",
+ "autoload": {
+ "files": [
+ "lib/Deserializer/functions.php",
+ "lib/Serializer/functions.php"
+ ],
+ "psr-4": {
+ "Sabre\\Xml\\": "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"
+ },
+ {
+ "name": "Markus Staab",
+ "email": "markus.staab@redaxo.de",
+ "role": "Developer"
+ }
+ ],
+ "description": "sabre/xml is an XML library that you may not hate.",
+ "homepage": "https://sabre.io/xml/",
+ "keywords": [
+ "XMLReader",
+ "XMLWriter",
+ "dom",
+ "xml"
+ ],
+ "support": {
+ "forum": "https://groups.google.com/group/sabredav-discuss",
+ "issues": "https://github.com/sabre-io/xml/issues",
+ "source": "https://github.com/fruux/sabre-xml"
+ },
+ "time": "2023-06-28T12:56:05+00:00"
+ }
+ ],
+ "packages-dev": [],
+ "aliases": [],
+ "minimum-stability": "stable",
+ "stability-flags": [],
+ "prefer-stable": false,
+ "prefer-lowest": false,
+ "platform": {
+ "php": ">=7.1.0"
+ },
+ "platform-dev": [],
+ "plugin-api-version": "2.2.0"
+}
diff --git a/htdocs/includes/sabre/composer/ClassLoader.php b/htdocs/includes/sabre/composer/ClassLoader.php
index 4626994fd4d..afef3fa2ad8 100644
--- a/htdocs/includes/sabre/composer/ClassLoader.php
+++ b/htdocs/includes/sabre/composer/ClassLoader.php
@@ -37,57 +37,130 @@ namespace Composer\Autoload;
*
* @author Fabien Potencier
* @author Jordi Boggiano
- * @see http://www.php-fig.org/psr/psr-0/
- * @see http://www.php-fig.org/psr/psr-4/
+ * @see https://www.php-fig.org/psr/psr-0/
+ * @see https://www.php-fig.org/psr/psr-4/
*/
class ClassLoader
{
+ /** @var ?string */
+ private $vendorDir;
+
// PSR-4
+ /**
+ * @var array[]
+ * @psalm-var array>
+ */
private $prefixLengthsPsr4 = array();
+ /**
+ * @var array[]
+ * @psalm-var array>
+ */
private $prefixDirsPsr4 = array();
+ /**
+ * @var array[]
+ * @psalm-var array
+ */
private $fallbackDirsPsr4 = array();
// PSR-0
+ /**
+ * @var array[]
+ * @psalm-var array>
+ */
private $prefixesPsr0 = array();
+ /**
+ * @var array[]
+ * @psalm-var array
+ */
private $fallbackDirsPsr0 = array();
+ /** @var bool */
private $useIncludePath = false;
+
+ /**
+ * @var string[]
+ * @psalm-var array
+ */
private $classMap = array();
+
+ /** @var bool */
private $classMapAuthoritative = false;
+
+ /**
+ * @var bool[]
+ * @psalm-var array
+ */
private $missingClasses = array();
+
+ /** @var ?string */
private $apcuPrefix;
+ /**
+ * @var self[]
+ */
+ private static $registeredLoaders = array();
+
+ /**
+ * @param ?string $vendorDir
+ */
+ public function __construct($vendorDir = null)
+ {
+ $this->vendorDir = $vendorDir;
+ }
+
+ /**
+ * @return string[]
+ */
public function getPrefixes()
{
if (!empty($this->prefixesPsr0)) {
- return call_user_func_array('array_merge', $this->prefixesPsr0);
+ return call_user_func_array('array_merge', array_values($this->prefixesPsr0));
}
return array();
}
+ /**
+ * @return array[]
+ * @psalm-return array>
+ */
public function getPrefixesPsr4()
{
return $this->prefixDirsPsr4;
}
+ /**
+ * @return array[]
+ * @psalm-return array
+ */
public function getFallbackDirs()
{
return $this->fallbackDirsPsr0;
}
+ /**
+ * @return array[]
+ * @psalm-return array
+ */
public function getFallbackDirsPsr4()
{
return $this->fallbackDirsPsr4;
}
+ /**
+ * @return string[] Array of classname => path
+ * @psalm-return array
+ */
public function getClassMap()
{
return $this->classMap;
}
/**
- * @param array $classMap Class to filename map
+ * @param string[] $classMap Class to filename map
+ * @psalm-param array $classMap
+ *
+ * @return void
*/
public function addClassMap(array $classMap)
{
@@ -102,9 +175,11 @@ class ClassLoader
* Registers a set of PSR-0 directories for a given prefix, either
* appending or prepending to the ones previously set for this prefix.
*
- * @param string $prefix The prefix
- * @param array|string $paths The PSR-0 root directories
- * @param bool $prepend Whether to prepend the directories
+ * @param string $prefix The prefix
+ * @param string[]|string $paths The PSR-0 root directories
+ * @param bool $prepend Whether to prepend the directories
+ *
+ * @return void
*/
public function add($prefix, $paths, $prepend = false)
{
@@ -147,11 +222,13 @@ class ClassLoader
* Registers a set of PSR-4 directories for a given namespace, either
* appending or prepending to the ones previously set for this namespace.
*
- * @param string $prefix The prefix/namespace, with trailing '\\'
- * @param array|string $paths The PSR-4 base directories
- * @param bool $prepend Whether to prepend the directories
+ * @param string $prefix The prefix/namespace, with trailing '\\'
+ * @param string[]|string $paths The PSR-4 base directories
+ * @param bool $prepend Whether to prepend the directories
*
* @throws \InvalidArgumentException
+ *
+ * @return void
*/
public function addPsr4($prefix, $paths, $prepend = false)
{
@@ -195,8 +272,10 @@ class ClassLoader
* Registers a set of PSR-0 directories for a given prefix,
* replacing any others previously set for this prefix.
*
- * @param string $prefix The prefix
- * @param array|string $paths The PSR-0 base directories
+ * @param string $prefix The prefix
+ * @param string[]|string $paths The PSR-0 base directories
+ *
+ * @return void
*/
public function set($prefix, $paths)
{
@@ -211,10 +290,12 @@ class ClassLoader
* Registers a set of PSR-4 directories for a given namespace,
* replacing any others previously set for this namespace.
*
- * @param string $prefix The prefix/namespace, with trailing '\\'
- * @param array|string $paths The PSR-4 base directories
+ * @param string $prefix The prefix/namespace, with trailing '\\'
+ * @param string[]|string $paths The PSR-4 base directories
*
* @throws \InvalidArgumentException
+ *
+ * @return void
*/
public function setPsr4($prefix, $paths)
{
@@ -234,6 +315,8 @@ class ClassLoader
* Turns on searching the include path for class files.
*
* @param bool $useIncludePath
+ *
+ * @return void
*/
public function setUseIncludePath($useIncludePath)
{
@@ -256,6 +339,8 @@ class ClassLoader
* that have not been registered with the class map.
*
* @param bool $classMapAuthoritative
+ *
+ * @return void
*/
public function setClassMapAuthoritative($classMapAuthoritative)
{
@@ -276,10 +361,12 @@ class ClassLoader
* APCu prefix to use to cache found/not-found classes, if the extension is enabled.
*
* @param string|null $apcuPrefix
+ *
+ * @return void
*/
public function setApcuPrefix($apcuPrefix)
{
- $this->apcuPrefix = function_exists('apcu_fetch') && ini_get('apc.enabled') ? $apcuPrefix : null;
+ $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
}
/**
@@ -296,25 +383,44 @@ class ClassLoader
* Registers this instance as an autoloader.
*
* @param bool $prepend Whether to prepend the autoloader or not
+ *
+ * @return void
*/
public function register($prepend = false)
{
spl_autoload_register(array($this, 'loadClass'), true, $prepend);
+
+ if (null === $this->vendorDir) {
+ return;
+ }
+
+ if ($prepend) {
+ self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders;
+ } else {
+ unset(self::$registeredLoaders[$this->vendorDir]);
+ self::$registeredLoaders[$this->vendorDir] = $this;
+ }
}
/**
* Unregisters this instance as an autoloader.
+ *
+ * @return void
*/
public function unregister()
{
spl_autoload_unregister(array($this, 'loadClass'));
+
+ if (null !== $this->vendorDir) {
+ unset(self::$registeredLoaders[$this->vendorDir]);
+ }
}
/**
* Loads the given class or interface.
*
* @param string $class The name of the class
- * @return bool|null True if loaded, null otherwise
+ * @return true|null True if loaded, null otherwise
*/
public function loadClass($class)
{
@@ -323,6 +429,8 @@ class ClassLoader
return true;
}
+
+ return null;
}
/**
@@ -367,6 +475,21 @@ class ClassLoader
return $file;
}
+ /**
+ * Returns the currently registered loaders indexed by their corresponding vendor directories.
+ *
+ * @return self[]
+ */
+ public static function getRegisteredLoaders()
+ {
+ return self::$registeredLoaders;
+ }
+
+ /**
+ * @param string $class
+ * @param string $ext
+ * @return string|false
+ */
private function findFileWithExtension($class, $ext)
{
// PSR-4 lookup
@@ -374,10 +497,14 @@ class ClassLoader
$first = $class[0];
if (isset($this->prefixLengthsPsr4[$first])) {
- foreach ($this->prefixLengthsPsr4[$first] as $prefix => $length) {
- if (0 === strpos($class, $prefix)) {
- foreach ($this->prefixDirsPsr4[$prefix] as $dir) {
- if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) {
+ $subPath = $class;
+ while (false !== $lastPos = strrpos($subPath, '\\')) {
+ $subPath = substr($subPath, 0, $lastPos);
+ $search = $subPath . '\\';
+ if (isset($this->prefixDirsPsr4[$search])) {
+ $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
+ foreach ($this->prefixDirsPsr4[$search] as $dir) {
+ if (file_exists($file = $dir . $pathEnd)) {
return $file;
}
}
@@ -434,6 +561,10 @@ class ClassLoader
* Scope isolated include.
*
* Prevents access to $this/self from included files.
+ *
+ * @param string $file
+ * @return void
+ * @private
*/
function includeFile($file)
{
diff --git a/htdocs/includes/sabre/composer/InstalledVersions.php b/htdocs/includes/sabre/composer/InstalledVersions.php
new file mode 100644
index 00000000000..d50e0c9fcc4
--- /dev/null
+++ b/htdocs/includes/sabre/composer/InstalledVersions.php
@@ -0,0 +1,350 @@
+
+ * Jordi Boggiano
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Composer;
+
+use Composer\Autoload\ClassLoader;
+use Composer\Semver\VersionParser;
+
+/**
+ * This class is copied in every Composer installed project and available to all
+ *
+ * See also https://getcomposer.org/doc/07-runtime.md#installed-versions
+ *
+ * To require its presence, you can require `composer-runtime-api ^2.0`
+ */
+class InstalledVersions
+{
+ /**
+ * @var mixed[]|null
+ * @psalm-var array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array}|array{}|null
+ */
+ private static $installed;
+
+ /**
+ * @var bool|null
+ */
+ private static $canGetVendors;
+
+ /**
+ * @var array[]
+ * @psalm-var array}>
+ */
+ private static $installedByVendor = array();
+
+ /**
+ * Returns a list of all package names which are present, either by being installed, replaced or provided
+ *
+ * @return string[]
+ * @psalm-return list
+ */
+ public static function getInstalledPackages()
+ {
+ $packages = array();
+ foreach (self::getInstalled() as $installed) {
+ $packages[] = array_keys($installed['versions']);
+ }
+
+ if (1 === \count($packages)) {
+ return $packages[0];
+ }
+
+ return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
+ }
+
+ /**
+ * Returns a list of all package names with a specific type e.g. 'library'
+ *
+ * @param string $type
+ * @return string[]
+ * @psalm-return list
+ */
+ public static function getInstalledPackagesByType($type)
+ {
+ $packagesByType = array();
+
+ foreach (self::getInstalled() as $installed) {
+ foreach ($installed['versions'] as $name => $package) {
+ if (isset($package['type']) && $package['type'] === $type) {
+ $packagesByType[] = $name;
+ }
+ }
+ }
+
+ return $packagesByType;
+ }
+
+ /**
+ * Checks whether the given package is installed
+ *
+ * This also returns true if the package name is provided or replaced by another package
+ *
+ * @param string $packageName
+ * @param bool $includeDevRequirements
+ * @return bool
+ */
+ public static function isInstalled($packageName, $includeDevRequirements = true)
+ {
+ foreach (self::getInstalled() as $installed) {
+ if (isset($installed['versions'][$packageName])) {
+ return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']);
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Checks whether the given package satisfies a version constraint
+ *
+ * e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call:
+ *
+ * Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3')
+ *
+ * @param VersionParser $parser Install composer/semver to have access to this class and functionality
+ * @param string $packageName
+ * @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package
+ * @return bool
+ */
+ public static function satisfies(VersionParser $parser, $packageName, $constraint)
+ {
+ $constraint = $parser->parseConstraints($constraint);
+ $provided = $parser->parseConstraints(self::getVersionRanges($packageName));
+
+ return $provided->matches($constraint);
+ }
+
+ /**
+ * Returns a version constraint representing all the range(s) which are installed for a given package
+ *
+ * It is easier to use this via isInstalled() with the $constraint argument if you need to check
+ * whether a given version of a package is installed, and not just whether it exists
+ *
+ * @param string $packageName
+ * @return string Version constraint usable with composer/semver
+ */
+ public static function getVersionRanges($packageName)
+ {
+ foreach (self::getInstalled() as $installed) {
+ if (!isset($installed['versions'][$packageName])) {
+ continue;
+ }
+
+ $ranges = array();
+ if (isset($installed['versions'][$packageName]['pretty_version'])) {
+ $ranges[] = $installed['versions'][$packageName]['pretty_version'];
+ }
+ if (array_key_exists('aliases', $installed['versions'][$packageName])) {
+ $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);
+ }
+ if (array_key_exists('replaced', $installed['versions'][$packageName])) {
+ $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);
+ }
+ if (array_key_exists('provided', $installed['versions'][$packageName])) {
+ $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);
+ }
+
+ return implode(' || ', $ranges);
+ }
+
+ throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
+ }
+
+ /**
+ * @param string $packageName
+ * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
+ */
+ public static function getVersion($packageName)
+ {
+ foreach (self::getInstalled() as $installed) {
+ if (!isset($installed['versions'][$packageName])) {
+ continue;
+ }
+
+ if (!isset($installed['versions'][$packageName]['version'])) {
+ return null;
+ }
+
+ return $installed['versions'][$packageName]['version'];
+ }
+
+ throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
+ }
+
+ /**
+ * @param string $packageName
+ * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
+ */
+ public static function getPrettyVersion($packageName)
+ {
+ foreach (self::getInstalled() as $installed) {
+ if (!isset($installed['versions'][$packageName])) {
+ continue;
+ }
+
+ if (!isset($installed['versions'][$packageName]['pretty_version'])) {
+ return null;
+ }
+
+ return $installed['versions'][$packageName]['pretty_version'];
+ }
+
+ throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
+ }
+
+ /**
+ * @param string $packageName
+ * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference
+ */
+ public static function getReference($packageName)
+ {
+ foreach (self::getInstalled() as $installed) {
+ if (!isset($installed['versions'][$packageName])) {
+ continue;
+ }
+
+ if (!isset($installed['versions'][$packageName]['reference'])) {
+ return null;
+ }
+
+ return $installed['versions'][$packageName]['reference'];
+ }
+
+ throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
+ }
+
+ /**
+ * @param string $packageName
+ * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path.
+ */
+ public static function getInstallPath($packageName)
+ {
+ foreach (self::getInstalled() as $installed) {
+ if (!isset($installed['versions'][$packageName])) {
+ continue;
+ }
+
+ return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null;
+ }
+
+ throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
+ }
+
+ /**
+ * @return array
+ * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}
+ */
+ public static function getRootPackage()
+ {
+ $installed = self::getInstalled();
+
+ return $installed[0]['root'];
+ }
+
+ /**
+ * Returns the raw installed.php data for custom implementations
+ *
+ * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
+ * @return array[]
+ * @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array}
+ */
+ public static function getRawData()
+ {
+ @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED);
+
+ if (null === self::$installed) {
+ // only require the installed.php file if this file is loaded from its dumped location,
+ // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
+ if (substr(__DIR__, -8, 1) !== 'C') {
+ self::$installed = include __DIR__ . '/installed.php';
+ } else {
+ self::$installed = array();
+ }
+ }
+
+ return self::$installed;
+ }
+
+ /**
+ * Returns the raw data of all installed.php which are currently loaded for custom implementations
+ *
+ * @return array[]
+ * @psalm-return list}>
+ */
+ public static function getAllRawData()
+ {
+ return self::getInstalled();
+ }
+
+ /**
+ * Lets you reload the static array from another file
+ *
+ * This is only useful for complex integrations in which a project needs to use
+ * this class but then also needs to execute another project's autoloader in process,
+ * and wants to ensure both projects have access to their version of installed.php.
+ *
+ * A typical case would be PHPUnit, where it would need to make sure it reads all
+ * the data it needs from this class, then call reload() with
+ * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure
+ * the project in which it runs can then also use this class safely, without
+ * interference between PHPUnit's dependencies and the project's dependencies.
+ *
+ * @param array[] $data A vendor/composer/installed.php data set
+ * @return void
+ *
+ * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array} $data
+ */
+ public static function reload($data)
+ {
+ self::$installed = $data;
+ self::$installedByVendor = array();
+ }
+
+ /**
+ * @return array[]
+ * @psalm-return list}>
+ */
+ private static function getInstalled()
+ {
+ if (null === self::$canGetVendors) {
+ self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
+ }
+
+ $installed = array();
+
+ if (self::$canGetVendors) {
+ foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
+ if (isset(self::$installedByVendor[$vendorDir])) {
+ $installed[] = self::$installedByVendor[$vendorDir];
+ } elseif (is_file($vendorDir.'/composer/installed.php')) {
+ $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php';
+ if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
+ self::$installed = $installed[count($installed) - 1];
+ }
+ }
+ }
+ }
+
+ if (null === self::$installed) {
+ // only require the installed.php file if this file is loaded from its dumped location,
+ // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
+ if (substr(__DIR__, -8, 1) !== 'C') {
+ self::$installed = require __DIR__ . '/installed.php';
+ } else {
+ self::$installed = array();
+ }
+ }
+ $installed[] = self::$installed;
+
+ return $installed;
+ }
+}
diff --git a/htdocs/includes/sabre/composer/LICENSE b/htdocs/includes/sabre/composer/LICENSE
index 1a28124886d..f27399a042d 100644
--- a/htdocs/includes/sabre/composer/LICENSE
+++ b/htdocs/includes/sabre/composer/LICENSE
@@ -1,5 +1,5 @@
-Copyright (c) 2016 Nils Adermann, Jordi Boggiano
+Copyright (c) Nils Adermann, Jordi Boggiano
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/htdocs/includes/sabre/composer/autoload_classmap.php b/htdocs/includes/sabre/composer/autoload_classmap.php
index 7a91153b0d8..b26f1b13b1f 100644
--- a/htdocs/includes/sabre/composer/autoload_classmap.php
+++ b/htdocs/includes/sabre/composer/autoload_classmap.php
@@ -6,4 +6,5 @@ $vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
+ 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
);
diff --git a/htdocs/includes/sabre/composer/autoload_files.php b/htdocs/includes/sabre/composer/autoload_files.php
index 24ffd37183a..a78cbe6fb59 100644
--- a/htdocs/includes/sabre/composer/autoload_files.php
+++ b/htdocs/includes/sabre/composer/autoload_files.php
@@ -7,10 +7,10 @@ $baseDir = dirname($vendorDir);
return array(
'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',
'd81bab31d3feb45bfe2f283ea3c8fdf7' => $vendorDir . '/sabre/event/lib/Loop/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',
);
diff --git a/htdocs/includes/sabre/composer/autoload_psr4.php b/htdocs/includes/sabre/composer/autoload_psr4.php
index 3928c989660..100702eadc8 100644
--- a/htdocs/includes/sabre/composer/autoload_psr4.php
+++ b/htdocs/includes/sabre/composer/autoload_psr4.php
@@ -11,9 +11,6 @@ return array(
'Sabre\\Uri\\' => array($vendorDir . '/sabre/uri/lib'),
'Sabre\\HTTP\\' => array($vendorDir . '/sabre/http/lib'),
'Sabre\\Event\\' => array($vendorDir . '/sabre/event/lib'),
- 'Sabre\\DAV\\' => array($vendorDir . '/sabre/dav/lib/DAV'),
- 'Sabre\\DAVACL\\' => array($vendorDir . '/sabre/dav/lib/DAVACL'),
- 'Sabre\\CardDAV\\' => array($vendorDir . '/sabre/dav/lib/CardDAV'),
- 'Sabre\\CalDAV\\' => array($vendorDir . '/sabre/dav/lib/CalDAV'),
+ 'Sabre\\' => array($vendorDir . '/sabre/dav/lib'),
'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'),
);
diff --git a/htdocs/includes/sabre/composer/autoload_real.php b/htdocs/includes/sabre/composer/autoload_real.php
index bb9949a91c4..3c57540c52e 100644
--- a/htdocs/includes/sabre/composer/autoload_real.php
+++ b/htdocs/includes/sabre/composer/autoload_real.php
@@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
-class ComposerAutoloaderInit60b9ac98a8448ede6c445b0fd4bd31e0
+class ComposerAutoloaderInit51cd53f153efda61d1f1f814155d1c4a
{
private static $loader;
@@ -13,21 +13,26 @@ class ComposerAutoloaderInit60b9ac98a8448ede6c445b0fd4bd31e0
}
}
+ /**
+ * @return \Composer\Autoload\ClassLoader
+ */
public static function getLoader()
{
if (null !== self::$loader) {
return self::$loader;
}
- spl_autoload_register(array('ComposerAutoloaderInit60b9ac98a8448ede6c445b0fd4bd31e0', 'loadClassLoader'), true, true);
- self::$loader = $loader = new \Composer\Autoload\ClassLoader();
- spl_autoload_unregister(array('ComposerAutoloaderInit60b9ac98a8448ede6c445b0fd4bd31e0', 'loadClassLoader'));
+ require __DIR__ . '/platform_check.php';
+
+ spl_autoload_register(array('ComposerAutoloaderInit51cd53f153efda61d1f1f814155d1c4a', 'loadClassLoader'), true, true);
+ self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
+ spl_autoload_unregister(array('ComposerAutoloaderInit51cd53f153efda61d1f1f814155d1c4a', 'loadClassLoader'));
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
if ($useStaticLoader) {
- require_once __DIR__ . '/autoload_static.php';
+ require __DIR__ . '/autoload_static.php';
- call_user_func(\Composer\Autoload\ComposerStaticInit60b9ac98a8448ede6c445b0fd4bd31e0::getInitializer($loader));
+ call_user_func(\Composer\Autoload\ComposerStaticInit51cd53f153efda61d1f1f814155d1c4a::getInitializer($loader));
} else {
$map = require __DIR__ . '/autoload_namespaces.php';
foreach ($map as $namespace => $path) {
@@ -48,23 +53,28 @@ class ComposerAutoloaderInit60b9ac98a8448ede6c445b0fd4bd31e0
$loader->register(true);
if ($useStaticLoader) {
- $includeFiles = Composer\Autoload\ComposerStaticInit60b9ac98a8448ede6c445b0fd4bd31e0::$files;
+ $includeFiles = Composer\Autoload\ComposerStaticInit51cd53f153efda61d1f1f814155d1c4a::$files;
} else {
$includeFiles = require __DIR__ . '/autoload_files.php';
}
foreach ($includeFiles as $fileIdentifier => $file) {
- composerRequire60b9ac98a8448ede6c445b0fd4bd31e0($fileIdentifier, $file);
+ composerRequire51cd53f153efda61d1f1f814155d1c4a($fileIdentifier, $file);
}
return $loader;
}
}
-function composerRequire60b9ac98a8448ede6c445b0fd4bd31e0($fileIdentifier, $file)
+/**
+ * @param string $fileIdentifier
+ * @param string $file
+ * @return void
+ */
+function composerRequire51cd53f153efda61d1f1f814155d1c4a($fileIdentifier, $file)
{
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
- require $file;
-
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
+
+ require $file;
}
}
diff --git a/htdocs/includes/sabre/composer/autoload_static.php b/htdocs/includes/sabre/composer/autoload_static.php
index d76d2c4c34b..c4a8c8f3d18 100644
--- a/htdocs/includes/sabre/composer/autoload_static.php
+++ b/htdocs/includes/sabre/composer/autoload_static.php
@@ -4,15 +4,15 @@
namespace Composer\Autoload;
-class ComposerStaticInit60b9ac98a8448ede6c445b0fd4bd31e0
+class ComposerStaticInit51cd53f153efda61d1f1f814155d1c4a
{
public static $files = array (
'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',
'd81bab31d3feb45bfe2f283ea3c8fdf7' => __DIR__ . '/..' . '/sabre/event/lib/Loop/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',
);
@@ -24,10 +24,7 @@ class ComposerStaticInit60b9ac98a8448ede6c445b0fd4bd31e0
'Sabre\\Uri\\' => 10,
'Sabre\\HTTP\\' => 11,
'Sabre\\Event\\' => 12,
- 'Sabre\\DAV\\' => 10,
- 'Sabre\\DAVACL\\' => 13,
- 'Sabre\\CardDAV\\' => 14,
- 'Sabre\\CalDAV\\' => 13,
+ 'Sabre\\' => 6,
),
'P' =>
array (
@@ -56,21 +53,9 @@ class ComposerStaticInit60b9ac98a8448ede6c445b0fd4bd31e0
array (
0 => __DIR__ . '/..' . '/sabre/event/lib',
),
- 'Sabre\\DAV\\' =>
+ 'Sabre\\' =>
array (
- 0 => __DIR__ . '/..' . '/sabre/dav/lib/DAV',
- ),
- 'Sabre\\DAVACL\\' =>
- array (
- 0 => __DIR__ . '/..' . '/sabre/dav/lib/DAVACL',
- ),
- 'Sabre\\CardDAV\\' =>
- array (
- 0 => __DIR__ . '/..' . '/sabre/dav/lib/CardDAV',
- ),
- 'Sabre\\CalDAV\\' =>
- array (
- 0 => __DIR__ . '/..' . '/sabre/dav/lib/CalDAV',
+ 0 => __DIR__ . '/..' . '/sabre/dav/lib',
),
'Psr\\Log\\' =>
array (
@@ -78,11 +63,16 @@ class ComposerStaticInit60b9ac98a8448ede6c445b0fd4bd31e0
),
);
+ public static $classMap = array (
+ 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
+ );
+
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
- $loader->prefixLengthsPsr4 = ComposerStaticInit60b9ac98a8448ede6c445b0fd4bd31e0::$prefixLengthsPsr4;
- $loader->prefixDirsPsr4 = ComposerStaticInit60b9ac98a8448ede6c445b0fd4bd31e0::$prefixDirsPsr4;
+ $loader->prefixLengthsPsr4 = ComposerStaticInit51cd53f153efda61d1f1f814155d1c4a::$prefixLengthsPsr4;
+ $loader->prefixDirsPsr4 = ComposerStaticInit51cd53f153efda61d1f1f814155d1c4a::$prefixDirsPsr4;
+ $loader->classMap = ComposerStaticInit51cd53f153efda61d1f1f814155d1c4a::$classMap;
}, null, ClassLoader::class);
}
diff --git a/htdocs/includes/sabre/composer/installed.json b/htdocs/includes/sabre/composer/installed.json
index c226d3ef4a6..cadcc120067 100644
--- a/htdocs/includes/sabre/composer/installed.json
+++ b/htdocs/includes/sabre/composer/installed.json
@@ -1,470 +1,519 @@
-[
- {
- "name": "sabre/uri",
- "version": "1.2.0",
- "version_normalized": "1.2.0.0",
- "source": {
- "type": "git",
- "url": "https://github.com/fruux/sabre-uri.git",
- "reference": "8545a3335f741d4b7700bb14efb41b4c03775dcd"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/fruux/sabre-uri/zipball/8545a3335f741d4b7700bb14efb41b4c03775dcd",
- "reference": "8545a3335f741d4b7700bb14efb41b4c03775dcd",
- "shasum": ""
- },
- "require": {
- "php": ">=5.4.7"
- },
- "require-dev": {
- "phpunit/phpunit": "*",
- "sabre/cs": "~1.0.0"
- },
- "time": "2016-12-07T01:17:59+00:00",
- "type": "library",
- "installation-source": "dist",
- "autoload": {
- "files": [
- "lib/functions.php"
+{
+ "packages": [
+ {
+ "name": "psr/log",
+ "version": "1.1.4",
+ "version_normalized": "1.1.4.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/php-fig/log.git",
+ "reference": "d49695b909c3b7628b6289db5479a1c204601f11"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11",
+ "reference": "d49695b909c3b7628b6289db5479a1c204601f11",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.0"
+ },
+ "time": "2021-05-03T11:20:27+00:00",
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.1.x-dev"
+ }
+ },
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "Psr\\Log\\": "Psr/Log/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
],
- "psr-4": {
- "Sabre\\Uri\\": "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": "Functions for making sense out of URIs.",
- "homepage": "http://sabre.io/uri/",
- "keywords": [
- "rfc3986",
- "uri",
- "url"
- ]
- },
- {
- "name": "sabre/xml",
- "version": "1.5.0",
- "version_normalized": "1.5.0.0",
- "source": {
- "type": "git",
- "url": "https://github.com/fruux/sabre-xml.git",
- "reference": "59b20e5bbace9912607481634f97d05a776ffca7"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/fruux/sabre-xml/zipball/59b20e5bbace9912607481634f97d05a776ffca7",
- "reference": "59b20e5bbace9912607481634f97d05a776ffca7",
- "shasum": ""
- },
- "require": {
- "ext-dom": "*",
- "ext-xmlreader": "*",
- "ext-xmlwriter": "*",
- "lib-libxml": ">=2.6.20",
- "php": ">=5.5.5",
- "sabre/uri": ">=1.0,<3.0.0"
- },
- "require-dev": {
- "phpunit/phpunit": "*",
- "sabre/cs": "~1.0.0"
- },
- "time": "2016-10-09T22:57:52+00:00",
- "type": "library",
- "installation-source": "dist",
- "autoload": {
- "psr-4": {
- "Sabre\\Xml\\": "lib/"
- },
- "files": [
- "lib/Deserializer/functions.php",
- "lib/Serializer/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"
- },
- {
- "name": "Markus Staab",
- "email": "markus.staab@redaxo.de",
- "role": "Developer"
- }
- ],
- "description": "sabre/xml is an XML library that you may not hate.",
- "homepage": "https://sabre.io/xml/",
- "keywords": [
- "XMLReader",
- "XMLWriter",
- "dom",
- "xml"
- ]
- },
- {
- "name": "sabre/vobject",
- "version": "4.1.2",
- "version_normalized": "4.1.2.0",
- "source": {
- "type": "git",
- "url": "https://github.com/fruux/sabre-vobject.git",
- "reference": "d0fde2fafa2a3dad1f559c2d1c2591d4fd75ae3c"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/fruux/sabre-vobject/zipball/d0fde2fafa2a3dad1f559c2d1c2591d4fd75ae3c",
- "reference": "d0fde2fafa2a3dad1f559c2d1c2591d4fd75ae3c",
- "shasum": ""
- },
- "require": {
- "ext-mbstring": "*",
- "php": ">=5.5",
- "sabre/xml": ">=1.5 <3.0"
- },
- "require-dev": {
- "phpunit/phpunit": "*",
- "sabre/cs": "^1.0.0"
- },
- "suggest": {
- "hoa/bench": "If you would like to run the benchmark scripts"
- },
- "time": "2016-12-06T04:14:09+00:00",
- "bin": [
- "bin/vobject",
- "bin/generate_vcards"
- ],
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "4.0.x-dev"
- }
- },
- "installation-source": "dist",
- "autoload": {
- "psr-4": {
- "Sabre\\VObject\\": "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"
- },
- {
- "name": "Dominik Tobschall",
- "email": "dominik@fruux.com",
- "homepage": "http://tobschall.de/",
- "role": "Developer"
- },
- {
- "name": "Ivan Enderlin",
- "email": "ivan.enderlin@hoa-project.net",
- "homepage": "http://mnt.io/",
- "role": "Developer"
- }
- ],
- "description": "The VObject library for PHP allows you to easily parse and manipulate iCalendar and vCard objects",
- "homepage": "http://sabre.io/vobject/",
- "keywords": [
- "availability",
- "freebusy",
- "iCalendar",
- "ical",
- "ics",
- "jCal",
- "jCard",
- "recurrence",
- "rfc2425",
- "rfc2426",
- "rfc2739",
- "rfc4770",
- "rfc5545",
- "rfc5546",
- "rfc6321",
- "rfc6350",
- "rfc6351",
- "rfc6474",
- "rfc6638",
- "rfc6715",
- "rfc6868",
- "vCalendar",
- "vCard",
- "vcf",
- "xCal",
- "xCard"
- ]
- },
- {
- "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-05T20:14:39+00:00",
- "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.2",
- "version_normalized": "4.2.2.0",
- "source": {
- "type": "git",
- "url": "https://github.com/fruux/sabre-http.git",
- "reference": "dd50e7260356f4599d40270826f9548b23efa204"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/fruux/sabre-http/zipball/dd50e7260356f4599d40270826f9548b23efa204",
- "reference": "dd50e7260356f4599d40270826f9548b23efa204",
- "shasum": ""
- },
- "require": {
- "ext-ctype": "*",
- "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": "2017-01-02T19:38:42+00:00",
- "type": "library",
- "installation-source": "dist",
- "autoload": {
- "files": [
- "lib/functions.php"
+ "authors": [
+ {
+ "name": "PHP-FIG",
+ "homepage": "https://www.php-fig.org/"
+ }
],
- "psr-4": {
- "Sabre\\HTTP\\": "lib/"
- }
+ "description": "Common interface for logging libraries",
+ "homepage": "https://github.com/php-fig/log",
+ "keywords": [
+ "log",
+ "psr",
+ "psr-3"
+ ],
+ "support": {
+ "source": "https://github.com/php-fig/log/tree/1.1.4"
+ },
+ "install-path": "../psr/log"
},
- "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.2",
- "version_normalized": "1.0.2.0",
- "source": {
- "type": "git",
- "url": "https://github.com/php-fig/log.git",
- "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d"
+ {
+ "name": "sabre/dav",
+ "version": "4.6.0",
+ "version_normalized": "4.6.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sabre-io/dav.git",
+ "reference": "554145304b4a026477d130928d16e626939b0b2a"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sabre-io/dav/zipball/554145304b4a026477d130928d16e626939b0b2a",
+ "reference": "554145304b4a026477d130928d16e626939b0b2a",
+ "shasum": ""
+ },
+ "require": {
+ "ext-ctype": "*",
+ "ext-date": "*",
+ "ext-dom": "*",
+ "ext-iconv": "*",
+ "ext-json": "*",
+ "ext-mbstring": "*",
+ "ext-pcre": "*",
+ "ext-simplexml": "*",
+ "ext-spl": "*",
+ "lib-libxml": ">=2.7.0",
+ "php": "^7.1.0 || ^8.0",
+ "psr/log": "^1.0 || ^2.0 || ^3.0",
+ "sabre/event": "^5.0",
+ "sabre/http": "^5.0.5",
+ "sabre/uri": "^2.0",
+ "sabre/vobject": "^4.2.1",
+ "sabre/xml": "^2.0.1"
+ },
+ "require-dev": {
+ "friendsofphp/php-cs-fixer": "^2.19",
+ "monolog/monolog": "^1.27 || ^2.0",
+ "phpstan/phpstan": "^0.12 || ^1.0",
+ "phpstan/phpstan-phpunit": "^1.0",
+ "phpunit/phpunit": "^7.5 || ^8.5 || ^9.6"
+ },
+ "suggest": {
+ "ext-curl": "*",
+ "ext-imap": "*",
+ "ext-pdo": "*"
+ },
+ "time": "2023-12-11T13:01:23+00:00",
+ "bin": [
+ "bin/sabredav",
+ "bin/naturalselection"
+ ],
+ "type": "library",
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "Sabre\\": "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": "WebDAV Framework for PHP",
+ "homepage": "http://sabre.io/",
+ "keywords": [
+ "CalDAV",
+ "CardDAV",
+ "WebDAV",
+ "framework",
+ "iCalendar"
+ ],
+ "support": {
+ "forum": "https://groups.google.com/group/sabredav-discuss",
+ "issues": "https://github.com/sabre-io/dav/issues",
+ "source": "https://github.com/fruux/sabre-dav"
+ },
+ "install-path": "../sabre/dav"
},
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
- "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
- "shasum": ""
+ {
+ "name": "sabre/event",
+ "version": "5.1.4",
+ "version_normalized": "5.1.4.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sabre-io/event.git",
+ "reference": "d7da22897125d34d7eddf7977758191c06a74497"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sabre-io/event/zipball/d7da22897125d34d7eddf7977758191c06a74497",
+ "reference": "d7da22897125d34d7eddf7977758191c06a74497",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.1 || ^8.0"
+ },
+ "require-dev": {
+ "friendsofphp/php-cs-fixer": "~2.17.1",
+ "phpstan/phpstan": "^0.12",
+ "phpunit/phpunit": "^7.5 || ^8.5 || ^9.0"
+ },
+ "time": "2021-11-04T06:51:17+00:00",
+ "type": "library",
+ "installation-source": "dist",
+ "autoload": {
+ "files": [
+ "lib/coroutine.php",
+ "lib/Loop/functions.php",
+ "lib/Promise/functions.php"
+ ],
+ "psr-4": {
+ "Sabre\\Event\\": "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": "sabre/event is a library for lightweight event-based programming",
+ "homepage": "http://sabre.io/event/",
+ "keywords": [
+ "EventEmitter",
+ "async",
+ "coroutine",
+ "eventloop",
+ "events",
+ "hooks",
+ "plugin",
+ "promise",
+ "reactor",
+ "signal"
+ ],
+ "support": {
+ "forum": "https://groups.google.com/group/sabredav-discuss",
+ "issues": "https://github.com/sabre-io/event/issues",
+ "source": "https://github.com/fruux/sabre-event"
+ },
+ "install-path": "../sabre/event"
},
- "require": {
- "php": ">=5.3.0"
+ {
+ "name": "sabre/http",
+ "version": "5.1.10",
+ "version_normalized": "5.1.10.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sabre-io/http.git",
+ "reference": "f9f3d1fba8916fa2f4ec25636c4fedc26cb94e02"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sabre-io/http/zipball/f9f3d1fba8916fa2f4ec25636c4fedc26cb94e02",
+ "reference": "f9f3d1fba8916fa2f4ec25636c4fedc26cb94e02",
+ "shasum": ""
+ },
+ "require": {
+ "ext-ctype": "*",
+ "ext-curl": "*",
+ "ext-mbstring": "*",
+ "php": "^7.1 || ^8.0",
+ "sabre/event": ">=4.0 <6.0",
+ "sabre/uri": "^2.0"
+ },
+ "require-dev": {
+ "friendsofphp/php-cs-fixer": "~2.17.1",
+ "phpstan/phpstan": "^0.12",
+ "phpunit/phpunit": "^7.5 || ^8.5 || ^9.0"
+ },
+ "suggest": {
+ "ext-curl": " to make http requests with the Client class"
+ },
+ "time": "2023-08-18T01:55:28+00:00",
+ "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"
+ ],
+ "support": {
+ "forum": "https://groups.google.com/group/sabredav-discuss",
+ "issues": "https://github.com/sabre-io/http/issues",
+ "source": "https://github.com/fruux/sabre-http"
+ },
+ "install-path": "../sabre/http"
},
- "time": "2016-10-10T12:19:37+00:00",
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.0.x-dev"
- }
+ {
+ "name": "sabre/uri",
+ "version": "2.2.4",
+ "version_normalized": "2.2.4.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sabre-io/uri.git",
+ "reference": "c0c9af9f7754e60a49ebd760e1708adc6d1510c0"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sabre-io/uri/zipball/c0c9af9f7754e60a49ebd760e1708adc6d1510c0",
+ "reference": "c0c9af9f7754e60a49ebd760e1708adc6d1510c0",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.1 || ^8.0"
+ },
+ "require-dev": {
+ "friendsofphp/php-cs-fixer": "~2.19.3",
+ "phpstan/phpstan": "^0.12",
+ "phpunit/phpunit": "^7.5 || ^8.5 || ^9.0"
+ },
+ "time": "2022-09-19T12:25:28+00:00",
+ "type": "library",
+ "installation-source": "dist",
+ "autoload": {
+ "files": [
+ "lib/functions.php"
+ ],
+ "psr-4": {
+ "Sabre\\Uri\\": "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": "Functions for making sense out of URIs.",
+ "homepage": "http://sabre.io/uri/",
+ "keywords": [
+ "rfc3986",
+ "uri",
+ "url"
+ ],
+ "support": {
+ "forum": "https://groups.google.com/group/sabredav-discuss",
+ "issues": "https://github.com/sabre-io/uri/issues",
+ "source": "https://github.com/fruux/sabre-uri"
+ },
+ "install-path": "../sabre/uri"
},
- "installation-source": "dist",
- "autoload": {
- "psr-4": {
- "Psr\\Log\\": "Psr/Log/"
- }
+ {
+ "name": "sabre/vobject",
+ "version": "4.5.4",
+ "version_normalized": "4.5.4.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sabre-io/vobject.git",
+ "reference": "a6d53a3e5bec85ed3dd78868b7de0f5b4e12f772"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sabre-io/vobject/zipball/a6d53a3e5bec85ed3dd78868b7de0f5b4e12f772",
+ "reference": "a6d53a3e5bec85ed3dd78868b7de0f5b4e12f772",
+ "shasum": ""
+ },
+ "require": {
+ "ext-mbstring": "*",
+ "php": "^7.1 || ^8.0",
+ "sabre/xml": "^2.1 || ^3.0 || ^4.0"
+ },
+ "require-dev": {
+ "friendsofphp/php-cs-fixer": "~2.17.1",
+ "phpstan/phpstan": "^0.12",
+ "phpunit/php-invoker": "^2.0 || ^3.1",
+ "phpunit/phpunit": "^7.5 || ^8.5 || ^9.0"
+ },
+ "suggest": {
+ "hoa/bench": "If you would like to run the benchmark scripts"
+ },
+ "time": "2023-11-09T12:54:37+00:00",
+ "bin": [
+ "bin/vobject",
+ "bin/generate_vcards"
+ ],
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "4.0.x-dev"
+ }
+ },
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "Sabre\\VObject\\": "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"
+ },
+ {
+ "name": "Dominik Tobschall",
+ "email": "dominik@fruux.com",
+ "homepage": "http://tobschall.de/",
+ "role": "Developer"
+ },
+ {
+ "name": "Ivan Enderlin",
+ "email": "ivan.enderlin@hoa-project.net",
+ "homepage": "http://mnt.io/",
+ "role": "Developer"
+ }
+ ],
+ "description": "The VObject library for PHP allows you to easily parse and manipulate iCalendar and vCard objects",
+ "homepage": "http://sabre.io/vobject/",
+ "keywords": [
+ "availability",
+ "freebusy",
+ "iCalendar",
+ "ical",
+ "ics",
+ "jCal",
+ "jCard",
+ "recurrence",
+ "rfc2425",
+ "rfc2426",
+ "rfc2739",
+ "rfc4770",
+ "rfc5545",
+ "rfc5546",
+ "rfc6321",
+ "rfc6350",
+ "rfc6351",
+ "rfc6474",
+ "rfc6638",
+ "rfc6715",
+ "rfc6868",
+ "vCalendar",
+ "vCard",
+ "vcf",
+ "xCal",
+ "xCard"
+ ],
+ "support": {
+ "forum": "https://groups.google.com/group/sabredav-discuss",
+ "issues": "https://github.com/sabre-io/vobject/issues",
+ "source": "https://github.com/fruux/sabre-vobject"
+ },
+ "install-path": "../sabre/vobject"
},
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "PHP-FIG",
- "homepage": "http://www.php-fig.org/"
- }
- ],
- "description": "Common interface for logging libraries",
- "homepage": "https://github.com/php-fig/log",
- "keywords": [
- "log",
- "psr",
- "psr-3"
- ]
- },
- {
- "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"
- ]
- }
-]
+ {
+ "name": "sabre/xml",
+ "version": "2.2.6",
+ "version_normalized": "2.2.6.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sabre-io/xml.git",
+ "reference": "9cde7cdab1e50893cc83b037b40cd47bfde42a2b"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sabre-io/xml/zipball/9cde7cdab1e50893cc83b037b40cd47bfde42a2b",
+ "reference": "9cde7cdab1e50893cc83b037b40cd47bfde42a2b",
+ "shasum": ""
+ },
+ "require": {
+ "ext-dom": "*",
+ "ext-xmlreader": "*",
+ "ext-xmlwriter": "*",
+ "lib-libxml": ">=2.6.20",
+ "php": "^7.1 || ^8.0",
+ "sabre/uri": ">=1.0,<3.0.0"
+ },
+ "require-dev": {
+ "friendsofphp/php-cs-fixer": "~2.17.1",
+ "phpstan/phpstan": "^0.12",
+ "phpunit/phpunit": "^7.5 || ^8.5 || ^9.0"
+ },
+ "time": "2023-06-28T12:56:05+00:00",
+ "type": "library",
+ "installation-source": "dist",
+ "autoload": {
+ "files": [
+ "lib/Deserializer/functions.php",
+ "lib/Serializer/functions.php"
+ ],
+ "psr-4": {
+ "Sabre\\Xml\\": "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"
+ },
+ {
+ "name": "Markus Staab",
+ "email": "markus.staab@redaxo.de",
+ "role": "Developer"
+ }
+ ],
+ "description": "sabre/xml is an XML library that you may not hate.",
+ "homepage": "https://sabre.io/xml/",
+ "keywords": [
+ "XMLReader",
+ "XMLWriter",
+ "dom",
+ "xml"
+ ],
+ "support": {
+ "forum": "https://groups.google.com/group/sabredav-discuss",
+ "issues": "https://github.com/sabre-io/xml/issues",
+ "source": "https://github.com/fruux/sabre-xml"
+ },
+ "install-path": "../sabre/xml"
+ }
+ ],
+ "dev": false,
+ "dev-package-names": []
+}
diff --git a/htdocs/includes/sabre/composer/installed.php b/htdocs/includes/sabre/composer/installed.php
new file mode 100644
index 00000000000..a88a2bc131e
--- /dev/null
+++ b/htdocs/includes/sabre/composer/installed.php
@@ -0,0 +1,86 @@
+ array(
+ 'pretty_version' => 'dev-develop',
+ 'version' => 'dev-develop',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../../',
+ 'aliases' => array(),
+ 'reference' => 'a2df2f2553a3f36892665f58c0e5a115a4d56038',
+ 'name' => '__root__',
+ 'dev' => false,
+ ),
+ 'versions' => array(
+ '__root__' => array(
+ 'pretty_version' => 'dev-develop',
+ 'version' => 'dev-develop',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../../',
+ 'aliases' => array(),
+ 'reference' => 'a2df2f2553a3f36892665f58c0e5a115a4d56038',
+ 'dev_requirement' => false,
+ ),
+ 'psr/log' => array(
+ 'pretty_version' => '1.1.4',
+ 'version' => '1.1.4.0',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../psr/log',
+ 'aliases' => array(),
+ 'reference' => 'd49695b909c3b7628b6289db5479a1c204601f11',
+ 'dev_requirement' => false,
+ ),
+ 'sabre/dav' => array(
+ 'pretty_version' => '4.6.0',
+ 'version' => '4.6.0.0',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../sabre/dav',
+ 'aliases' => array(),
+ 'reference' => '554145304b4a026477d130928d16e626939b0b2a',
+ 'dev_requirement' => false,
+ ),
+ 'sabre/event' => array(
+ 'pretty_version' => '5.1.4',
+ 'version' => '5.1.4.0',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../sabre/event',
+ 'aliases' => array(),
+ 'reference' => 'd7da22897125d34d7eddf7977758191c06a74497',
+ 'dev_requirement' => false,
+ ),
+ 'sabre/http' => array(
+ 'pretty_version' => '5.1.10',
+ 'version' => '5.1.10.0',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../sabre/http',
+ 'aliases' => array(),
+ 'reference' => 'f9f3d1fba8916fa2f4ec25636c4fedc26cb94e02',
+ 'dev_requirement' => false,
+ ),
+ 'sabre/uri' => array(
+ 'pretty_version' => '2.2.4',
+ 'version' => '2.2.4.0',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../sabre/uri',
+ 'aliases' => array(),
+ 'reference' => 'c0c9af9f7754e60a49ebd760e1708adc6d1510c0',
+ 'dev_requirement' => false,
+ ),
+ 'sabre/vobject' => array(
+ 'pretty_version' => '4.5.4',
+ 'version' => '4.5.4.0',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../sabre/vobject',
+ 'aliases' => array(),
+ 'reference' => 'a6d53a3e5bec85ed3dd78868b7de0f5b4e12f772',
+ 'dev_requirement' => false,
+ ),
+ 'sabre/xml' => array(
+ 'pretty_version' => '2.2.6',
+ 'version' => '2.2.6.0',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../sabre/xml',
+ 'aliases' => array(),
+ 'reference' => '9cde7cdab1e50893cc83b037b40cd47bfde42a2b',
+ 'dev_requirement' => false,
+ ),
+ ),
+);
diff --git a/htdocs/includes/sabre/composer/platform_check.php b/htdocs/includes/sabre/composer/platform_check.php
new file mode 100644
index 00000000000..6d3407dbb68
--- /dev/null
+++ b/htdocs/includes/sabre/composer/platform_check.php
@@ -0,0 +1,26 @@
+= 70100)) {
+ $issues[] = 'Your Composer dependencies require a PHP version ">= 7.1.0". You are running ' . PHP_VERSION . '.';
+}
+
+if ($issues) {
+ if (!headers_sent()) {
+ header('HTTP/1.1 500 Internal Server Error');
+ }
+ if (!ini_get('display_errors')) {
+ if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
+ fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL);
+ } elseif (!headers_sent()) {
+ echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL;
+ }
+ }
+ trigger_error(
+ 'Composer detected issues in your platform: ' . implode(' ', $issues),
+ E_USER_ERROR
+ );
+}
diff --git a/htdocs/includes/sabre/psr/log/.gitignore b/htdocs/includes/sabre/psr/log/.gitignore
deleted file mode 100644
index 22d0d82f809..00000000000
--- a/htdocs/includes/sabre/psr/log/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-vendor
diff --git a/htdocs/includes/sabre/psr/log/Psr/Log/AbstractLogger.php b/htdocs/includes/sabre/psr/log/Psr/Log/AbstractLogger.php
index 90e721af2d3..e02f9daf3d5 100644
--- a/htdocs/includes/sabre/psr/log/Psr/Log/AbstractLogger.php
+++ b/htdocs/includes/sabre/psr/log/Psr/Log/AbstractLogger.php
@@ -14,8 +14,8 @@ abstract class AbstractLogger implements LoggerInterface
/**
* System is unusable.
*
- * @param string $message
- * @param array $context
+ * @param string $message
+ * @param mixed[] $context
*
* @return void
*/
@@ -30,8 +30,8 @@ abstract class AbstractLogger implements LoggerInterface
* Example: Entire website down, database unavailable, etc. This should
* trigger the SMS alerts and wake you up.
*
- * @param string $message
- * @param array $context
+ * @param string $message
+ * @param mixed[] $context
*
* @return void
*/
@@ -45,8 +45,8 @@ abstract class AbstractLogger implements LoggerInterface
*
* Example: Application component unavailable, unexpected exception.
*
- * @param string $message
- * @param array $context
+ * @param string $message
+ * @param mixed[] $context
*
* @return void
*/
@@ -59,8 +59,8 @@ abstract class AbstractLogger implements LoggerInterface
* Runtime errors that do not require immediate action but should typically
* be logged and monitored.
*
- * @param string $message
- * @param array $context
+ * @param string $message
+ * @param mixed[] $context
*
* @return void
*/
@@ -75,8 +75,8 @@ abstract class AbstractLogger implements LoggerInterface
* Example: Use of deprecated APIs, poor use of an API, undesirable things
* that are not necessarily wrong.
*
- * @param string $message
- * @param array $context
+ * @param string $message
+ * @param mixed[] $context
*
* @return void
*/
@@ -88,8 +88,8 @@ abstract class AbstractLogger implements LoggerInterface
/**
* Normal but significant events.
*
- * @param string $message
- * @param array $context
+ * @param string $message
+ * @param mixed[] $context
*
* @return void
*/
@@ -103,8 +103,8 @@ abstract class AbstractLogger implements LoggerInterface
*
* Example: User logs in, SQL logs.
*
- * @param string $message
- * @param array $context
+ * @param string $message
+ * @param mixed[] $context
*
* @return void
*/
@@ -116,8 +116,8 @@ abstract class AbstractLogger implements LoggerInterface
/**
* Detailed debug information.
*
- * @param string $message
- * @param array $context
+ * @param string $message
+ * @param mixed[] $context
*
* @return void
*/
diff --git a/htdocs/includes/sabre/psr/log/Psr/Log/LoggerAwareTrait.php b/htdocs/includes/sabre/psr/log/Psr/Log/LoggerAwareTrait.php
index 639f79bdaa5..82bf45c89ba 100644
--- a/htdocs/includes/sabre/psr/log/Psr/Log/LoggerAwareTrait.php
+++ b/htdocs/includes/sabre/psr/log/Psr/Log/LoggerAwareTrait.php
@@ -10,7 +10,7 @@ trait LoggerAwareTrait
/**
* The logger instance.
*
- * @var LoggerInterface
+ * @var LoggerInterface|null
*/
protected $logger;
diff --git a/htdocs/includes/sabre/psr/log/Psr/Log/LoggerInterface.php b/htdocs/includes/sabre/psr/log/Psr/Log/LoggerInterface.php
index 5ea72438b56..2206cfde41a 100644
--- a/htdocs/includes/sabre/psr/log/Psr/Log/LoggerInterface.php
+++ b/htdocs/includes/sabre/psr/log/Psr/Log/LoggerInterface.php
@@ -22,8 +22,8 @@ interface LoggerInterface
/**
* System is unusable.
*
- * @param string $message
- * @param array $context
+ * @param string $message
+ * @param mixed[] $context
*
* @return void
*/
@@ -35,8 +35,8 @@ interface LoggerInterface
* Example: Entire website down, database unavailable, etc. This should
* trigger the SMS alerts and wake you up.
*
- * @param string $message
- * @param array $context
+ * @param string $message
+ * @param mixed[] $context
*
* @return void
*/
@@ -47,8 +47,8 @@ interface LoggerInterface
*
* Example: Application component unavailable, unexpected exception.
*
- * @param string $message
- * @param array $context
+ * @param string $message
+ * @param mixed[] $context
*
* @return void
*/
@@ -58,8 +58,8 @@ interface LoggerInterface
* Runtime errors that do not require immediate action but should typically
* be logged and monitored.
*
- * @param string $message
- * @param array $context
+ * @param string $message
+ * @param mixed[] $context
*
* @return void
*/
@@ -71,8 +71,8 @@ interface LoggerInterface
* Example: Use of deprecated APIs, poor use of an API, undesirable things
* that are not necessarily wrong.
*
- * @param string $message
- * @param array $context
+ * @param string $message
+ * @param mixed[] $context
*
* @return void
*/
@@ -81,8 +81,8 @@ interface LoggerInterface
/**
* Normal but significant events.
*
- * @param string $message
- * @param array $context
+ * @param string $message
+ * @param mixed[] $context
*
* @return void
*/
@@ -93,8 +93,8 @@ interface LoggerInterface
*
* Example: User logs in, SQL logs.
*
- * @param string $message
- * @param array $context
+ * @param string $message
+ * @param mixed[] $context
*
* @return void
*/
@@ -103,8 +103,8 @@ interface LoggerInterface
/**
* Detailed debug information.
*
- * @param string $message
- * @param array $context
+ * @param string $message
+ * @param mixed[] $context
*
* @return void
*/
@@ -113,11 +113,13 @@ interface LoggerInterface
/**
* Logs with an arbitrary level.
*
- * @param mixed $level
- * @param string $message
- * @param array $context
+ * @param mixed $level
+ * @param string $message
+ * @param mixed[] $context
*
* @return void
+ *
+ * @throws \Psr\Log\InvalidArgumentException
*/
public function log($level, $message, array $context = array());
}
diff --git a/htdocs/includes/sabre/psr/log/Psr/Log/LoggerTrait.php b/htdocs/includes/sabre/psr/log/Psr/Log/LoggerTrait.php
index 867225df1d1..e392fef0a0c 100644
--- a/htdocs/includes/sabre/psr/log/Psr/Log/LoggerTrait.php
+++ b/htdocs/includes/sabre/psr/log/Psr/Log/LoggerTrait.php
@@ -135,6 +135,8 @@ trait LoggerTrait
* @param array $context
*
* @return void
+ *
+ * @throws \Psr\Log\InvalidArgumentException
*/
abstract public function log($level, $message, array $context = array());
}
diff --git a/htdocs/includes/sabre/psr/log/Psr/Log/NullLogger.php b/htdocs/includes/sabre/psr/log/Psr/Log/NullLogger.php
index d8cd682c8f9..c8f7293b1c6 100644
--- a/htdocs/includes/sabre/psr/log/Psr/Log/NullLogger.php
+++ b/htdocs/includes/sabre/psr/log/Psr/Log/NullLogger.php
@@ -20,6 +20,8 @@ class NullLogger extends AbstractLogger
* @param array $context
*
* @return void
+ *
+ * @throws \Psr\Log\InvalidArgumentException
*/
public function log($level, $message, array $context = array())
{
diff --git a/htdocs/includes/sabre/psr/log/Psr/Log/Test/DummyTest.php b/htdocs/includes/sabre/psr/log/Psr/Log/Test/DummyTest.php
new file mode 100644
index 00000000000..9638c110186
--- /dev/null
+++ b/htdocs/includes/sabre/psr/log/Psr/Log/Test/DummyTest.php
@@ -0,0 +1,18 @@
+ true,
'null' => null,
@@ -110,6 +114,7 @@ abstract class LoggerInterfaceTest extends \PHPUnit_Framework_TestCase
'nested' => array('with object' => new DummyTest),
'object' => new \DateTime,
'resource' => fopen('php://memory', 'r'),
+ 'closed' => $closed,
);
$this->getLogger()->warning('Crazy context data', $context);
@@ -131,10 +136,3 @@ abstract class LoggerInterfaceTest extends \PHPUnit_Framework_TestCase
$this->assertEquals($expected, $this->getLogs());
}
}
-
-class DummyTest
-{
- public function __toString()
- {
- }
-}
diff --git a/htdocs/includes/sabre/psr/log/Psr/Log/Test/TestLogger.php b/htdocs/includes/sabre/psr/log/Psr/Log/Test/TestLogger.php
new file mode 100644
index 00000000000..1be3230496b
--- /dev/null
+++ b/htdocs/includes/sabre/psr/log/Psr/Log/Test/TestLogger.php
@@ -0,0 +1,147 @@
+ $level,
+ 'message' => $message,
+ 'context' => $context,
+ ];
+
+ $this->recordsByLevel[$record['level']][] = $record;
+ $this->records[] = $record;
+ }
+
+ public function hasRecords($level)
+ {
+ return isset($this->recordsByLevel[$level]);
+ }
+
+ public function hasRecord($record, $level)
+ {
+ if (is_string($record)) {
+ $record = ['message' => $record];
+ }
+ return $this->hasRecordThatPasses(function ($rec) use ($record) {
+ if ($rec['message'] !== $record['message']) {
+ return false;
+ }
+ if (isset($record['context']) && $rec['context'] !== $record['context']) {
+ return false;
+ }
+ return true;
+ }, $level);
+ }
+
+ public function hasRecordThatContains($message, $level)
+ {
+ return $this->hasRecordThatPasses(function ($rec) use ($message) {
+ return strpos($rec['message'], $message) !== false;
+ }, $level);
+ }
+
+ public function hasRecordThatMatches($regex, $level)
+ {
+ return $this->hasRecordThatPasses(function ($rec) use ($regex) {
+ return preg_match($regex, $rec['message']) > 0;
+ }, $level);
+ }
+
+ public function hasRecordThatPasses(callable $predicate, $level)
+ {
+ if (!isset($this->recordsByLevel[$level])) {
+ return false;
+ }
+ foreach ($this->recordsByLevel[$level] as $i => $rec) {
+ if (call_user_func($predicate, $rec, $i)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public function __call($method, $args)
+ {
+ if (preg_match('/(.*)(Debug|Info|Notice|Warning|Error|Critical|Alert|Emergency)(.*)/', $method, $matches) > 0) {
+ $genericMethod = $matches[1] . ('Records' !== $matches[3] ? 'Record' : '') . $matches[3];
+ $level = strtolower($matches[2]);
+ if (method_exists($this, $genericMethod)) {
+ $args[] = $level;
+ return call_user_func_array([$this, $genericMethod], $args);
+ }
+ }
+ throw new \BadMethodCallException('Call to undefined method ' . get_class($this) . '::' . $method . '()');
+ }
+
+ public function reset()
+ {
+ $this->records = [];
+ $this->recordsByLevel = [];
+ }
+}
diff --git a/htdocs/includes/sabre/psr/log/README.md b/htdocs/includes/sabre/psr/log/README.md
index 574bc1cb2a8..a9f20c437b3 100644
--- a/htdocs/includes/sabre/psr/log/README.md
+++ b/htdocs/includes/sabre/psr/log/README.md
@@ -7,6 +7,13 @@ This repository holds all interfaces/classes/traits related to
Note that this is not a logger of its own. It is merely an interface that
describes a logger. See the specification for more details.
+Installation
+------------
+
+```bash
+composer require psr/log
+```
+
Usage
-----
@@ -31,6 +38,12 @@ class Foo
if ($this->logger) {
$this->logger->info('Doing work');
}
+
+ try {
+ $this->doSomethingElse();
+ } catch (Exception $exception) {
+ $this->logger->error('Oh no!', array('exception' => $exception));
+ }
// do something useful
}
diff --git a/htdocs/includes/sabre/psr/log/composer.json b/htdocs/includes/sabre/psr/log/composer.json
index 87934d707e7..ca056953770 100644
--- a/htdocs/includes/sabre/psr/log/composer.json
+++ b/htdocs/includes/sabre/psr/log/composer.json
@@ -7,7 +7,7 @@
"authors": [
{
"name": "PHP-FIG",
- "homepage": "http://www.php-fig.org/"
+ "homepage": "https://www.php-fig.org/"
}
],
"require": {
@@ -20,7 +20,7 @@
},
"extra": {
"branch-alias": {
- "dev-master": "1.0.x-dev"
+ "dev-master": "1.1.x-dev"
}
}
}
diff --git a/htdocs/includes/sabre/sabre/dav/.travis.yml b/htdocs/includes/sabre/sabre/dav/.travis.yml
deleted file mode 100644
index 6214d80b39e..00000000000
--- a/htdocs/includes/sabre/sabre/dav/.travis.yml
+++ /dev/null
@@ -1,73 +0,0 @@
-language: php
-sudo: required
-
-branches:
- only:
- - master
-
-php:
- - 7.1
- - 7.2
- - 7.3
- - 7.4
-
-env:
- global:
- - SABRE_MYSQLUSER="root"
- - SABRE_MYSQLPASS=""
- - SABRE_MYSQLDSN="mysql:host=127.0.0.1;dbname=sabredav_test"
- - RUN_PHPCSFIXER="TRUE"
- - RUN_PHPUNIT="TRUE"
- - RUN_PHPSTAN="FALSE"
- matrix:
- - PREFER_LOWEST="" TEST_DEPS="" REPORT_COVERAGE="TRUE" WITH_COVERAGE="--coverage-clover=coverage.xml"
- - PREFER_LOWEST="--prefer-lowest" TEST_DEPS="tests/Sabre/" REPORT_COVERAGE="FALSE" WITH_COVERAGE=""
-
-matrix:
- include:
- - name: 'PHP8'
- dist: bionic
- php: 8.0
- env:
- - RUN_PHPCSFIXER="FALSE"
- - REPORT_COVERAGE="FALSE"
- - name: 'PHPStan'
- php: 7.4
- env:
- - RUN_PHPCSFIXER="FALSE"
- - RUN_PHPUNIT="FALSE"
- - RUN_PHPSTAN="TRUE"
- - REPORT_COVERAGE="FALSE"
- - name: 'Test with streaming propfind'
- php: 7.2
- env:
- - RUN_TEST_WITH_STREAMING_PROPFIND="TRUE"
- - REPORT_COVERAGE="FALSE"
- fast_finish: true
-
-services:
- - mysql
- - postgresql
-
-before_script:
- - mysql -u root -h 127.0.0.1 -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
- - if [ $RUN_PHPCSFIXER == "FALSE" ]; then composer remove --no-update --dev friendsofphp/php-cs-fixer; fi
- - composer update $PREFER_LOWEST
-
-addons:
- postgresql: "9.5"
-
-script:
- - if [ $RUN_PHPCSFIXER == "TRUE" ]; then php vendor/bin/php-cs-fixer fix --dry-run --diff; fi
- - if [ $RUN_PHPUNIT == "TRUE" ]; then php vendor/bin/phpunit --configuration tests/phpunit.xml $WITH_COVERAGE $TEST_DEPS; fi
- - if [ $RUN_PHPUNIT == "TRUE" ]; then rm -f ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini; fi
- - if [ $RUN_PHPSTAN == "TRUE" ]; then composer phpstan; fi
-
-after_success:
- - if [ $REPORT_COVERAGE == "TRUE" ]; then bash <(curl -s https://codecov.io/bash); fi
-
-cache:
- directories:
- - $HOME/.composer/cache
diff --git a/htdocs/includes/sabre/sabre/dav/composer.json b/htdocs/includes/sabre/sabre/dav/composer.json
index 6e9b9cb6b39..3154173398e 100644
--- a/htdocs/includes/sabre/sabre/dav/composer.json
+++ b/htdocs/includes/sabre/sabre/dav/composer.json
@@ -15,11 +15,11 @@
],
"require": {
"php": "^7.1.0 || ^8.0",
- "sabre/vobject": "^4.5.1",
- "sabre/event" : "^5.0.0",
- "sabre/xml" : "^2.5.5",
+ "sabre/vobject": "^4.2.1",
+ "sabre/event" : "^5.0",
+ "sabre/xml" : "^2.0.1",
"sabre/http" : "^5.0.5",
- "sabre/uri" : "^2.2.3",
+ "sabre/uri" : "^2.0",
"ext-dom": "*",
"ext-pcre": "*",
"ext-spl": "*",
@@ -33,11 +33,11 @@
"ext-json": "*"
},
"require-dev" : {
- "friendsofphp/php-cs-fixer": "^2.17.1",
- "phpstan/phpstan": "^0.12",
- "phpunit/phpunit" : "^7.5 || ^8.5 || ^9.0",
- "evert/phpdoc-md" : "~0.1.0",
- "monolog/monolog": "^1.18"
+ "friendsofphp/php-cs-fixer": "^2.19",
+ "monolog/monolog": "^1.27 || ^2.0",
+ "phpstan/phpstan": "^0.12 || ^1.0",
+ "phpstan/phpstan-phpunit": "^1.0",
+ "phpunit/phpunit": "^7.5 || ^8.5 || ^9.6"
},
"suggest" : {
"ext-curl" : "*",
@@ -46,21 +46,12 @@
},
"autoload": {
"psr-4" : {
- "Sabre\\DAV\\" : "lib/DAV/",
- "Sabre\\DAVACL\\" : "lib/DAVACL/",
- "Sabre\\CalDAV\\" : "lib/CalDAV/",
- "Sabre\\CardDAV\\" : "lib/CardDAV/"
+ "Sabre\\" : "lib/"
}
},
"autoload-dev" : {
"psr-4" : {
- "Sabre\\" : "tests/Sabre/",
- "Sabre\\CalDAV\\" : "tests/Sabre/CalDAV",
- "Sabre\\CardDAV\\" : "tests/Sabre/CardDAV",
- "Sabre\\DAV\\" : "tests/Sabre/DAV",
- "Sabre\\DAV\\Property\\" : "tests/Sabre/DAV/Xml/Property",
- "Sabre\\DAVACL\\" : "tests/Sabre/DAVACL",
- "Sabre\\HTTP\\" : "tests/Sabre/HTTP"
+ "Sabre\\" : "tests/Sabre/"
}
},
"support" : {
diff --git a/htdocs/includes/sabre/sabre/dav/lib/CalDAV/Backend/AbstractBackend.php b/htdocs/includes/sabre/sabre/dav/lib/CalDAV/Backend/AbstractBackend.php
index c32c86489da..c761bff51b5 100644
--- a/htdocs/includes/sabre/sabre/dav/lib/CalDAV/Backend/AbstractBackend.php
+++ b/htdocs/includes/sabre/sabre/dav/lib/CalDAV/Backend/AbstractBackend.php
@@ -78,7 +78,7 @@ abstract class AbstractBackend implements BackendInterface
*
* This default may well be good enough for personal use, and calendars
* that aren't very large. But if you anticipate high usage, big calendars
- * or high loads, you are strongly adviced to optimize certain paths.
+ * or high loads, you are strongly advised to optimize certain paths.
*
* The best way to do so is override this method and to optimize
* specifically for 'common filters'.
@@ -95,7 +95,7 @@ abstract class AbstractBackend implements BackendInterface
* 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.
diff --git a/htdocs/includes/sabre/sabre/dav/lib/CalDAV/Backend/PDO.php b/htdocs/includes/sabre/sabre/dav/lib/CalDAV/Backend/PDO.php
index 2f48ab9828d..b9f112cf8da 100644
--- a/htdocs/includes/sabre/sabre/dav/lib/CalDAV/Backend/PDO.php
+++ b/htdocs/includes/sabre/sabre/dav/lib/CalDAV/Backend/PDO.php
@@ -939,7 +939,7 @@ SQL;
* @param int $syncLevel
* @param int $limit
*
- * @return array
+ * @return array|null
*/
public function getChangesForCalendar($calendarId, $syncToken, $syncLevel, $limit = null)
{
diff --git a/htdocs/includes/sabre/sabre/dav/lib/CalDAV/Backend/SyncSupport.php b/htdocs/includes/sabre/sabre/dav/lib/CalDAV/Backend/SyncSupport.php
index c7f67d17615..bfc1dafc2ea 100644
--- a/htdocs/includes/sabre/sabre/dav/lib/CalDAV/Backend/SyncSupport.php
+++ b/htdocs/includes/sabre/sabre/dav/lib/CalDAV/Backend/SyncSupport.php
@@ -77,7 +77,7 @@ interface SyncSupport extends BackendInterface
* @param int $syncLevel
* @param int $limit
*
- * @return array
+ * @return array|null
*/
public function getChangesForCalendar($calendarId, $syncToken, $syncLevel, $limit = null);
}
diff --git a/htdocs/includes/sabre/sabre/dav/lib/CalDAV/Calendar.php b/htdocs/includes/sabre/sabre/dav/lib/CalDAV/Calendar.php
index 6e989314dcf..6c0bf541155 100644
--- a/htdocs/includes/sabre/sabre/dav/lib/CalDAV/Calendar.php
+++ b/htdocs/includes/sabre/sabre/dav/lib/CalDAV/Calendar.php
@@ -186,17 +186,17 @@ class Calendar implements ICalendar, DAV\IProperties, DAV\Sync\ISyncCollection,
* The contents of the new file must be a valid ICalendar string.
*
* @param string $name
- * @param resource $calendarData
+ * @param resource $data
*
* @return string|null
*/
- public function createFile($name, $calendarData = null)
+ public function createFile($name, $data = null)
{
- if (is_resource($calendarData)) {
- $calendarData = stream_get_contents($calendarData);
+ if (is_resource($data)) {
+ $data = stream_get_contents($data);
}
- return $this->caldavBackend->createCalendarObject($this->calendarInfo['id'], $name, $calendarData);
+ return $this->caldavBackend->createCalendarObject($this->calendarInfo['id'], $name, $data);
}
/**
@@ -442,7 +442,7 @@ class Calendar implements ICalendar, DAV\IProperties, DAV\Sync\ISyncCollection,
* @param int $syncLevel
* @param int $limit
*
- * @return array
+ * @return array|null
*/
public function getChanges($syncToken, $syncLevel, $limit = null)
{
diff --git a/htdocs/includes/sabre/sabre/dav/lib/CalDAV/CalendarHome.php b/htdocs/includes/sabre/sabre/dav/lib/CalDAV/CalendarHome.php
index 159ddcc67c1..49c54a37a7a 100644
--- a/htdocs/includes/sabre/sabre/dav/lib/CalDAV/CalendarHome.php
+++ b/htdocs/includes/sabre/sabre/dav/lib/CalDAV/CalendarHome.php
@@ -96,10 +96,10 @@ class CalendarHome implements DAV\IExtendedCollection, DAVACL\IACL
*
* This is currently not allowed
*
- * @param string $filename
+ * @param string $name
* @param resource $data
*/
- public function createFile($filename, $data = null)
+ public function createFile($name, $data = null)
{
throw new DAV\Exception\MethodNotAllowed('Creating new files in this collection is not supported');
}
diff --git a/htdocs/includes/sabre/sabre/dav/lib/CalDAV/Schedule/IMipPlugin.php b/htdocs/includes/sabre/sabre/dav/lib/CalDAV/Schedule/IMipPlugin.php
index e050ac273d2..dcaf951efdf 100644
--- a/htdocs/includes/sabre/sabre/dav/lib/CalDAV/Schedule/IMipPlugin.php
+++ b/htdocs/includes/sabre/sabre/dav/lib/CalDAV/Schedule/IMipPlugin.php
@@ -30,13 +30,6 @@ class IMipPlugin extends DAV\ServerPlugin
*/
protected $senderEmail;
- /**
- * ITipMessage.
- *
- * @var ITip\Message
- */
- protected $itipMessage;
-
/**
* Creates the email handler.
*
diff --git a/htdocs/includes/sabre/sabre/dav/lib/CalDAV/Schedule/Plugin.php b/htdocs/includes/sabre/sabre/dav/lib/CalDAV/Schedule/Plugin.php
index 3cc360f1d45..5e565961019 100644
--- a/htdocs/includes/sabre/sabre/dav/lib/CalDAV/Schedule/Plugin.php
+++ b/htdocs/includes/sabre/sabre/dav/lib/CalDAV/Schedule/Plugin.php
@@ -605,10 +605,9 @@ class Plugin extends ServerPlugin
*
* This method may update $newObject to add any status changes.
*
- * @param VCalendar|string $oldObject
- * @param array $ignore any addresses to not send messages to
- * @param bool $modified a marker to indicate that the original object
- * modified by this process
+ * @param VCalendar|string|null $oldObject
+ * @param array $ignore any addresses to not send messages to
+ * @param bool $modified a marker to indicate that the original object modified by this process
*/
protected function processICalendarChange($oldObject, VCalendar $newObject, array $addresses, array $ignore = [], &$modified = false)
{
@@ -969,7 +968,7 @@ class Plugin extends ServerPlugin
*
* @return bool
*/
- private function scheduleReply(RequestInterface $request)
+ protected function scheduleReply(RequestInterface $request)
{
$scheduleReply = $request->getHeader('Schedule-Reply');
diff --git a/htdocs/includes/sabre/sabre/dav/lib/CalDAV/Xml/Filter/PropFilter.php b/htdocs/includes/sabre/sabre/dav/lib/CalDAV/Xml/Filter/PropFilter.php
index c9a3cb5acfa..f1d66cc0d66 100644
--- a/htdocs/includes/sabre/sabre/dav/lib/CalDAV/Xml/Filter/PropFilter.php
+++ b/htdocs/includes/sabre/sabre/dav/lib/CalDAV/Xml/Filter/PropFilter.php
@@ -53,7 +53,7 @@ class PropFilter implements XmlDeserializable
'is-not-defined' => false,
'param-filters' => [],
'text-match' => null,
- 'time-range' => false,
+ 'time-range' => [],
];
$att = $reader->parseAttributes();
diff --git a/htdocs/includes/sabre/sabre/dav/lib/CardDAV/AddressBook.php b/htdocs/includes/sabre/sabre/dav/lib/CardDAV/AddressBook.php
index 86994f2d5f6..f5744f644b2 100644
--- a/htdocs/includes/sabre/sabre/dav/lib/CardDAV/AddressBook.php
+++ b/htdocs/includes/sabre/sabre/dav/lib/CardDAV/AddressBook.php
@@ -129,19 +129,19 @@ class AddressBook extends DAV\Collection implements IAddressBook, DAV\IPropertie
* This method may return an ETag.
*
* @param string $name
- * @param resource $vcardData
+ * @param resource $data
*
* @return string|null
*/
- public function createFile($name, $vcardData = null)
+ public function createFile($name, $data = null)
{
- if (is_resource($vcardData)) {
- $vcardData = stream_get_contents($vcardData);
+ if (is_resource($data)) {
+ $data = stream_get_contents($data);
}
// Converting to UTF-8, if needed
- $vcardData = DAV\StringUtil::ensureUTF8($vcardData);
+ $data = DAV\StringUtil::ensureUTF8($data);
- return $this->carddavBackend->createCard($this->addressBookInfo['id'], $name, $vcardData);
+ return $this->carddavBackend->createCard($this->addressBookInfo['id'], $name, $data);
}
/**
@@ -317,7 +317,7 @@ class AddressBook extends DAV\Collection implements IAddressBook, DAV\IPropertie
* @param int $syncLevel
* @param int $limit
*
- * @return array
+ * @return array|null
*/
public function getChanges($syncToken, $syncLevel, $limit = null)
{
diff --git a/htdocs/includes/sabre/sabre/dav/lib/CardDAV/AddressBookHome.php b/htdocs/includes/sabre/sabre/dav/lib/CardDAV/AddressBookHome.php
index 884e9b24e08..d7365fbe826 100644
--- a/htdocs/includes/sabre/sabre/dav/lib/CardDAV/AddressBookHome.php
+++ b/htdocs/includes/sabre/sabre/dav/lib/CardDAV/AddressBookHome.php
@@ -92,10 +92,10 @@ class AddressBookHome extends DAV\Collection implements DAV\IExtendedCollection,
*
* This is currently not allowed
*
- * @param string $filename
+ * @param string $name
* @param resource $data
*/
- public function createFile($filename, $data = null)
+ public function createFile($name, $data = null)
{
throw new DAV\Exception\MethodNotAllowed('Creating new files in this collection is not supported');
}
diff --git a/htdocs/includes/sabre/sabre/dav/lib/CardDAV/Backend/PDO.php b/htdocs/includes/sabre/sabre/dav/lib/CardDAV/Backend/PDO.php
index 966d7ba095d..4ca9284a9ef 100644
--- a/htdocs/includes/sabre/sabre/dav/lib/CardDAV/Backend/PDO.php
+++ b/htdocs/includes/sabre/sabre/dav/lib/CardDAV/Backend/PDO.php
@@ -452,7 +452,7 @@ class PDO extends AbstractBackend implements SyncSupport
* @param int $syncLevel
* @param int $limit
*
- * @return array
+ * @return array|null
*/
public function getChangesForAddressBook($addressBookId, $syncToken, $syncLevel, $limit = null)
{
diff --git a/htdocs/includes/sabre/sabre/dav/lib/CardDAV/Backend/SyncSupport.php b/htdocs/includes/sabre/sabre/dav/lib/CardDAV/Backend/SyncSupport.php
index 071361ed027..6aaad141540 100644
--- a/htdocs/includes/sabre/sabre/dav/lib/CardDAV/Backend/SyncSupport.php
+++ b/htdocs/includes/sabre/sabre/dav/lib/CardDAV/Backend/SyncSupport.php
@@ -77,7 +77,7 @@ interface SyncSupport extends BackendInterface
* @param int $syncLevel
* @param int $limit
*
- * @return array
+ * @return array|null
*/
public function getChangesForAddressBook($addressBookId, $syncToken, $syncLevel, $limit = null);
}
diff --git a/htdocs/includes/sabre/sabre/dav/lib/CardDAV/Xml/Request/AddressBookMultiGetReport.php b/htdocs/includes/sabre/sabre/dav/lib/CardDAV/Xml/Request/AddressBookMultiGetReport.php
index c11d2dd7368..491f969088f 100644
--- a/htdocs/includes/sabre/sabre/dav/lib/CardDAV/Xml/Request/AddressBookMultiGetReport.php
+++ b/htdocs/includes/sabre/sabre/dav/lib/CardDAV/Xml/Request/AddressBookMultiGetReport.php
@@ -38,7 +38,7 @@ class AddressBookMultiGetReport implements XmlDeserializable
public $hrefs;
/**
- * The mimetype of the content that should be returend. Usually
+ * The mimetype of the content that should be returned. Usually
* text/vcard.
*
* @var string
@@ -53,6 +53,13 @@ class AddressBookMultiGetReport implements XmlDeserializable
*/
public $version = null;
+ /**
+ * An array with requested vcard properties.
+ *
+ * @var array
+ */
+ public $addressDataProperties;
+
/**
* The deserialize method is called during xml parsing.
*
diff --git a/htdocs/includes/sabre/sabre/dav/lib/DAV/Client.php b/htdocs/includes/sabre/sabre/dav/lib/DAV/Client.php
index a9de71cdbb5..1028a6b9d55 100644
--- a/htdocs/includes/sabre/sabre/dav/lib/DAV/Client.php
+++ b/htdocs/includes/sabre/sabre/dav/lib/DAV/Client.php
@@ -173,28 +173,99 @@ class Client extends HTTP\Client
$this->propertyMap = &$this->xml->elementMap;
}
+ /**
+ * Does a PROPFIND request with filtered response returning only available properties.
+ *
+ * The list of requested properties must be specified as an array, in clark
+ * notation.
+ *
+ * Depth should be either 0 or 1. A depth of 1 will cause a request to be
+ * made to the server to also return all child resources.
+ *
+ * For depth 0, just the array of properties for the resource is returned.
+ *
+ * For depth 1, the returned array will contain a list of resource names as keys,
+ * and an array of properties as values.
+ *
+ * The array of properties will contain the properties as keys with their values as the value.
+ * Only properties that are actually returned from the server without error will be
+ * returned, anything else is discarded.
+ *
+ * @param 1|0 $depth
+ */
+ public function propFind($url, array $properties, $depth = 0): array
+ {
+ $result = $this->doPropFind($url, $properties, $depth);
+
+ // If depth was 0, we only return the top item
+ if (0 === $depth) {
+ reset($result);
+ $result = current($result);
+
+ return isset($result[200]) ? $result[200] : [];
+ }
+
+ $newResult = [];
+ foreach ($result as $href => $statusList) {
+ $newResult[$href] = isset($statusList[200]) ? $statusList[200] : [];
+ }
+
+ return $newResult;
+ }
+
+ /**
+ * Does a PROPFIND request with unfiltered response.
+ *
+ * The list of requested properties must be specified as an array, in clark
+ * notation.
+ *
+ * Depth should be either 0 or 1. A depth of 1 will cause a request to be
+ * made to the server to also return all child resources.
+ *
+ * For depth 0, just the multi-level array of status and properties for the resource is returned.
+ *
+ * For depth 1, the returned array will contain a list of resources as keys and
+ * a multi-level array containing status and properties as value.
+ *
+ * The multi-level array of status and properties is formatted the same as what is
+ * documented for parseMultiStatus.
+ *
+ * All properties that are actually returned from the server are returned by this method.
+ *
+ * @param 1|0 $depth
+ */
+ public function propFindUnfiltered(string $url, array $properties, int $depth = 0): array
+ {
+ $result = $this->doPropFind($url, $properties, $depth);
+
+ // If depth was 0, we only return the top item
+ if (0 === $depth) {
+ reset($result);
+
+ return current($result);
+ } else {
+ return $result;
+ }
+ }
+
/**
* Does a PROPFIND request.
*
* The list of requested properties must be specified as an array, in clark
* notation.
*
- * The returned array will contain a list of filenames as keys, and
- * properties as values.
- *
- * The properties array will contain the list of properties. Only properties
- * that are actually returned from the server (without error) will be
- * returned, anything else is discarded.
- *
* Depth should be either 0 or 1. A depth of 1 will cause a request to be
* made to the server to also return all child resources.
*
- * @param string $url
- * @param int $depth
+ * The returned array will contain a list of resources as keys and
+ * a multi-level array containing status and properties as value.
*
- * @return array
+ * The multi-level array of status and properties is formatted the same as what is
+ * documented for parseMultiStatus.
+ *
+ * @param 1|0 $depth
*/
- public function propFind($url, array $properties, $depth = 0)
+ private function doPropFind($url, array $properties, $depth = 0): array
{
$dom = new \DOMDocument('1.0', 'UTF-8');
$dom->formatOutput = true;
@@ -232,22 +303,7 @@ class Client extends HTTP\Client
throw new HTTP\ClientHttpException($response);
}
- $result = $this->parseMultiStatus($response->getBodyAsString());
-
- // If depth was 0, we only return the top item
- if (0 === $depth) {
- reset($result);
- $result = current($result);
-
- return isset($result[200]) ? $result[200] : [];
- }
-
- $newResult = [];
- foreach ($result as $href => $statusList) {
- $newResult[$href] = isset($statusList[200]) ? $statusList[200] : [];
- }
-
- return $newResult;
+ return $this->parseMultiStatus($response->getBodyAsString());
}
/**
@@ -385,7 +441,7 @@ class Client extends HTTP\Client
{
return Uri\resolve(
$this->baseUri,
- $url
+ (string) $url
);
}
diff --git a/htdocs/includes/sabre/sabre/dav/lib/DAV/INodeByPath.php b/htdocs/includes/sabre/sabre/dav/lib/DAV/INodeByPath.php
new file mode 100644
index 00000000000..4d63a33bd7d
--- /dev/null
+++ b/htdocs/includes/sabre/sabre/dav/lib/DAV/INodeByPath.php
@@ -0,0 +1,36 @@
+rootNode;
}
- // Attempting to fetch its parent
- list($parentName, $baseName) = Uri\split($path);
+ $parts = explode('/', $path);
+ $node = $this->rootNode;
- // If there was no parent, we must simply ask it from the root node.
- if ('' === $parentName) {
- $node = $this->rootNode->getChild($baseName);
- } else {
- // Otherwise, we recursively grab the parent and ask him/her.
- $parent = $this->getNodeForPath($parentName);
-
- if (!($parent instanceof ICollection)) {
+ while (count($parts)) {
+ if (!($node instanceof ICollection)) {
throw new Exception\NotFound('Could not find node at path: '.$path);
}
- $node = $parent->getChild($baseName);
+
+ if ($node instanceof INodeByPath) {
+ $targetNode = $node->getNodeForPath(implode('/', $parts));
+ if ($targetNode instanceof Node) {
+ $node = $targetNode;
+ break;
+ }
+ }
+
+ $part = array_shift($parts);
+ if ('' !== $part) {
+ $node = $node->getChild($part);
+ }
}
$this->cache[$path] = $node;
diff --git a/htdocs/includes/sabre/sabre/dav/lib/DAV/Version.php b/htdocs/includes/sabre/sabre/dav/lib/DAV/Version.php
index c87901d8083..345c62d7ec9 100644
--- a/htdocs/includes/sabre/sabre/dav/lib/DAV/Version.php
+++ b/htdocs/includes/sabre/sabre/dav/lib/DAV/Version.php
@@ -16,5 +16,5 @@ class Version
/**
* Full version number.
*/
- const VERSION = '4.4.0';
+ public const VERSION = '4.6.0';
}
diff --git a/htdocs/includes/sabre/sabre/dav/lib/DAV/Xml/Element/Response.php b/htdocs/includes/sabre/sabre/dav/lib/DAV/Xml/Element/Response.php
index 79f06a09bf8..df92914650e 100644
--- a/htdocs/includes/sabre/sabre/dav/lib/DAV/Xml/Element/Response.php
+++ b/htdocs/includes/sabre/sabre/dav/lib/DAV/Xml/Element/Response.php
@@ -40,7 +40,7 @@ class Response implements Element
*
* This is currently only used in WebDAV-Sync
*
- * @var string
+ * @var string|null
*/
protected $httpStatus;
@@ -112,13 +112,21 @@ class Response implements Element
*/
public function xmlSerialize(Writer $writer)
{
- if ($status = $this->getHTTPStatus()) {
- $writer->writeElement('{DAV:}status', 'HTTP/1.1 '.$status.' '.\Sabre\HTTP\Response::$statusCodes[$status]);
- }
+ /*
+ * Accordingly to the RFC the element looks like:
+ *
+ *
+ * So the response
+ * - MUST contain a href and
+ * - EITHER a status and additional href(s)
+ * OR one or more propstat(s)
+ */
$writer->writeElement('{DAV:}href', $writer->contextUri.\Sabre\HTTP\encodePath($this->getHref()));
$empty = true;
+ $httpStatus = $this->getHTTPStatus();
+ // Add propstat elements
foreach ($this->getResponseProperties() as $status => $properties) {
// Skipping empty lists
if (!$properties || (!is_int($status) && !ctype_digit($status))) {
@@ -130,19 +138,25 @@ class Response implements Element
$writer->writeElement('{DAV:}status', 'HTTP/1.1 '.$status.' '.\Sabre\HTTP\Response::$statusCodes[$status]);
$writer->endElement(); // {DAV:}propstat
}
+
+ // The WebDAV spec only allows the status element on responses _without_ a propstat
if ($empty) {
- /*
- * The WebDAV spec _requires_ at least one DAV:propstat to appear for
- * every DAV:response. In some circumstances however, there are no
- * properties to encode.
- *
- * In those cases we MUST specify at least one DAV:propstat anyway, with
- * no properties.
- */
- $writer->writeElement('{DAV:}propstat', [
- '{DAV:}prop' => [],
- '{DAV:}status' => 'HTTP/1.1 418 '.\Sabre\HTTP\Response::$statusCodes[418],
- ]);
+ if (null !== $httpStatus) {
+ $writer->writeElement('{DAV:}status', 'HTTP/1.1 '.$httpStatus.' '.\Sabre\HTTP\Response::$statusCodes[$httpStatus]);
+ } else {
+ /*
+ * The WebDAV spec _requires_ at least one DAV:propstat to appear for
+ * every DAV:response if there is no status.
+ * In some circumstances however, there are no properties to encode.
+ *
+ * In those cases we MUST specify at least one DAV:propstat anyway, with
+ * no properties.
+ */
+ $writer->writeElement('{DAV:}propstat', [
+ '{DAV:}prop' => [],
+ '{DAV:}status' => 'HTTP/1.1 418 '.\Sabre\HTTP\Response::$statusCodes[418],
+ ]);
+ }
}
}
diff --git a/htdocs/includes/sabre/sabre/dav/lib/DAV/Xml/Property/Href.php b/htdocs/includes/sabre/sabre/dav/lib/DAV/Xml/Property/Href.php
index f88ce814ad6..d4e43da7cd9 100644
--- a/htdocs/includes/sabre/sabre/dav/lib/DAV/Xml/Property/Href.php
+++ b/htdocs/includes/sabre/sabre/dav/lib/DAV/Xml/Property/Href.php
@@ -34,6 +34,19 @@ class Href implements Element, HtmlOutput
*/
protected $hrefs;
+ /**
+ * Automatically prefix the url with the server base directory.
+ * Note: use of this property in code was removed in PR:
+ * https://github.com/sabre-io/dav/pull/801
+ * But the property is left here because old data may still exist
+ * that has this property saved.
+ * See discussion in issue:
+ * https://github.com/sabre-io/Baikal/issues/1154.
+ *
+ * @var bool
+ */
+ protected $autoPrefix = true;
+
/**
* Constructor.
*
diff --git a/htdocs/includes/sabre/sabre/dav/lib/DAVACL/PrincipalBackend/BackendInterface.php b/htdocs/includes/sabre/sabre/dav/lib/DAVACL/PrincipalBackend/BackendInterface.php
index 7140a929544..2fd31913daa 100644
--- a/htdocs/includes/sabre/sabre/dav/lib/DAVACL/PrincipalBackend/BackendInterface.php
+++ b/htdocs/includes/sabre/sabre/dav/lib/DAVACL/PrincipalBackend/BackendInterface.php
@@ -48,7 +48,7 @@ interface BackendInterface
public function getPrincipalByPath($path);
/**
- * Updates one ore more webdav properties on a principal.
+ * Updates one or more webdav properties on a principal.
*
* The list of mutations is stored in a Sabre\DAV\PropPatch object.
* To do the actual updates, you must tell this object which properties
diff --git a/htdocs/includes/sabre/sabre/event/.gitignore b/htdocs/includes/sabre/sabre/event/.gitignore
deleted file mode 100644
index d06a78164db..00000000000
--- a/htdocs/includes/sabre/sabre/event/.gitignore
+++ /dev/null
@@ -1,14 +0,0 @@
-#composer
-vendor
-composer.lock
-
-#binaries
-bin/sabre-cs-fixer
-bin/php-cs-fixer
-bin/phpunit
-
-#vim lock files
-.*.swp
-
-#development stuff
-tests/cov
diff --git a/htdocs/includes/sabre/sabre/dav/.php_cs.dist b/htdocs/includes/sabre/sabre/event/.php_cs.dist
similarity index 100%
rename from htdocs/includes/sabre/sabre/dav/.php_cs.dist
rename to htdocs/includes/sabre/sabre/event/.php_cs.dist
diff --git a/htdocs/includes/sabre/sabre/event/.travis.yml b/htdocs/includes/sabre/sabre/event/.travis.yml
deleted file mode 100644
index 7089e370b7d..00000000000
--- a/htdocs/includes/sabre/sabre/event/.travis.yml
+++ /dev/null
@@ -1,23 +0,0 @@
-language: php
-php:
- - 7
-
-matrix:
- allow_failures:
- - php: hhvm
-
-env:
- matrix:
- - LOWEST_DEPS=""
- - LOWEST_DEPS="--prefer-lowest"
-
-before_script:
- - composer update --prefer-source $LOWEST_DEPS
-
-script:
- - ./bin/phpunit
- - ./bin/sabre-cs-fixer fix . --dry-run --diff
-
-sudo: false
-
-cache: vendor
diff --git a/htdocs/includes/sabre/sabre/event/CHANGELOG.md b/htdocs/includes/sabre/sabre/event/CHANGELOG.md
deleted file mode 100644
index f46e9d0f76b..00000000000
--- a/htdocs/includes/sabre/sabre/event/CHANGELOG.md
+++ /dev/null
@@ -1,104 +0,0 @@
-ChangeLog
-=========
-
-5.0.0 (2016-10-23)
-------------------
-
-* #42: The `coroutine` function now supports `return` in the passed generator
- function. This allows you to more generally return a value. This is a BC
- break as this is a feature that was only made possible with PHP 7, and
- before the coroutine function would only ever return the last thing that
- was yielded. If you depended on that feature, replace your last `yield` with
- a `return`.
-
-
-4.0.0 (2016-09-19)
-------------------
-
-* sabre/event now requires PHP 7. If you need PHP 5.5 support, just keep
- using 3.0.0.
-* PHP 7 type hints are now used everywhere. We're also using strict_types.
-* Support for a new `WildcardEmitter` which allows you to listen for events
- using the `*` wildcard.
-* Removed deprecated functions `Promise::error` and `Promise::all`. Instead,
- use `Promise::otherwise` and `Promise\all()`.
-* `EventEmitter`, `EventEmitterTrait` and `EventEmitterInterface` are now just
- called `Emitter`, `EmitterTrait`, and `EmitterInterface`.
-* When rejecting Promises, it's now _required_ to use an `Exception` or
- `Throwable`. This makes the typical case simpler and reduces special cases.
-
-3.0.0 (2015-11-05)
-------------------
-
-* Now requires PHP 5.5!
-* `Promise::all()` is moved to `Promise\all()`.
-* Aside from the `Promise\all()` function, there's now also `Promise\race()`.
-* `Promise\reject()` and `Promise\resolve()` have also been added.
-* Now 100% compatible with the Ecmascript 6 Promise.
-
-
-3.0.0-alpha1 (2015-10-23)
--------------------------
-
-* This package now requires PHP 5.5.
-* #26: Added an event loop implementation. Also knows as the Reactor Pattern.
-* Renamed `Promise::error` to `Promise::otherwise` to be consistent with
- ReactPHP and Guzzle. The `error` method is kept for BC but will be removed
- in a future version.
-* #27: Support for Promise-based coroutines via the `Sabre\Event\coroutine`
- function.
-* BC Break: Promises now use the EventLoop to run "then"-events in a separate
- execution context. In practise that means you need to run the event loop to
- wait for any `then`/`otherwise` callbacks to trigger.
-* Promises now have a `wait()` method. Allowing you to make a promise
- synchronous and simply wait for a result (or exception) to happen.
-
-
-2.0.2 (2015-05-19)
-------------------
-
-* This release has no functional changes. It's just been brought up to date
- with the latest coding standards.
-
-
-2.0.1 (2014-10-06)
-------------------
-
-* Fixed: `$priority` was ignored in `EventEmitter::once` method.
-* Fixed: Breaking the event chain was not possible in `EventEmitter::once`.
-
-
-2.0.0 (2014-06-21)
-------------------
-
-* Added: When calling emit, it's now possible to specify a callback that will be
- triggered after each method handled. This is dubbed the 'continueCallback' and
- can be used to implement strategy patterns.
-* Added: Promise object!
-* Changed: EventEmitter::listeners now returns just the callbacks for an event,
- and no longer returns the list by reference. The list is now automatically
- sorted by priority.
-* Update: Speed improvements.
-* Updated: It's now possible to remove all listeners for every event.
-* Changed: Now uses psr-4 autoloading.
-
-
-1.0.1 (2014-06-12)
-------------------
-
-* hhvm compatible!
-* Fixed: Issue #4. Compatiblitiy for PHP < 5.4.14.
-
-
-1.0.0 (2013-07-19)
-------------------
-
-* Added: removeListener, removeAllListeners
-* Added: once, to only listen to an event emitting once.
-* Added README.md.
-
-
-0.0.1-alpha (2013-06-29)
-------------------------
-
-* First version!
diff --git a/htdocs/includes/sabre/sabre/event/README.md b/htdocs/includes/sabre/sabre/event/README.md
deleted file mode 100644
index a20473fd5d5..00000000000
--- a/htdocs/includes/sabre/sabre/event/README.md
+++ /dev/null
@@ -1,51 +0,0 @@
-sabre/event
-===========
-
-A lightweight library for event-based development in PHP.
-
-This library provides the following event-based concepts:
-
-1. EventEmitter.
-2. Promises.
-3. An event loop.
-4. Co-routines.
-
-Full documentation can be found on [the website][1].
-
-Installation
-------------
-
-Make sure you have [composer][3] installed, and then run:
-
- composer require sabre/event "^3.0"
-
-This package requires PHP 5.5. The 2.0 branch is still maintained as well, and
-supports PHP 5.4.
-
-Build status
-------------
-
-| branch | status |
-| ------ | ------ |
-| master | [](https://travis-ci.org/fruux/sabre-event) |
-| 3.0 | [](https://travis-ci.org/fruux/sabre-event) |
-| 2.0 | [](https://travis-ci.org/fruux/sabre-event) |
-| 1.0 | [](https://travis-ci.org/fruux/sabre-event) |
-| php53 | [](https://travis-ci.org/fruux/sabre-event) |
-
-
-Questions?
-----------
-
-Head over to the [sabre/dav mailinglist][4], or you can also just open a ticket
-on [GitHub][5].
-
-Made at fruux
--------------
-
-This library is being developed by [fruux](https://fruux.com/). Drop us a line for commercial services or enterprise support.
-
-[1]: http://sabre.io/event/
-[3]: http://getcomposer.org/
-[4]: http://groups.google.com/group/sabredav-discuss
-[5]: https://github.com/fruux/sabre-event/issues/
diff --git a/htdocs/includes/sabre/sabre/event/composer.json b/htdocs/includes/sabre/sabre/event/composer.json
index 6eb192e7a19..42fb4aa2297 100644
--- a/htdocs/includes/sabre/sabre/event/composer.json
+++ b/htdocs/includes/sabre/sabre/event/composer.json
@@ -16,7 +16,7 @@
"homepage": "http://sabre.io/event/",
"license": "BSD-3-Clause",
"require": {
- "php": ">=7.0"
+ "php": "^7.1 || ^8.0"
},
"authors": [
{
@@ -40,11 +40,30 @@
"lib/Promise/functions.php"
]
},
- "require-dev": {
- "sabre/cs": "~1.0.0",
- "phpunit/phpunit" : "*"
+ "autoload-dev": {
+ "psr-4" : {
+ "Sabre\\Event\\" : "tests/Event"
+ }
},
- "config" : {
- "bin-dir" : "bin/"
+ "require-dev": {
+ "friendsofphp/php-cs-fixer": "~2.17.1",
+ "phpstan/phpstan": "^0.12",
+ "phpunit/phpunit" : "^7.5 || ^8.5 || ^9.0"
+ },
+ "scripts": {
+ "phpstan": [
+ "phpstan analyse lib tests"
+ ],
+ "cs-fixer": [
+ "php-cs-fixer fix"
+ ],
+ "phpunit": [
+ "phpunit --configuration tests/phpunit.xml"
+ ],
+ "test": [
+ "composer phpstan",
+ "composer cs-fixer",
+ "composer phpunit"
+ ]
}
}
diff --git a/htdocs/includes/sabre/sabre/event/examples/curl.php b/htdocs/includes/sabre/sabre/event/examples/curl.php
deleted file mode 100644
index c2455760bc0..00000000000
--- a/htdocs/includes/sabre/sabre/event/examples/curl.php
+++ /dev/null
@@ -1,131 +0,0 @@
-#!/usr/bin/env php
-curlMultiHandle = curl_multi_init();
-
- }
-
- function addHandle($curlHandle) {
-
- curl_multi_add_handle($mh, $curlHandle);
-
- }
-
-}
-
-$active = null;
-
-function curl_multi_loop_scheduler($mh, callable $done) {
-
- $mrc = curl_multi_exec($mh, $active);
- switch ($mrc) {
-
- /**
- * From the curl docs. If CURM_CALL_MULTI_PERFORM is returned, simply
- * call curl_multi_perform immediately again. In PHP this means we
- * actually call curl_multi_exec immediately again.
- *
- * We're doing this in the next tick.
- */
- case CURLM_CALL_MULTI_PERFORM :
- Loop\nextTick(function() use ($mh, $done) {
-
- curl_multi_loop_scheduler($mh, $done);
-
- });
- break;
- case CURLM_OK :
- if (!$active) {
- // We're done!
- $done();
- return;
- }
- // Check again after 0.02 seconds
- Loop\setTimeout(function() use ($mh, $done) {
-
- curl_multi_loop_scheduler($mh, $done);
-
- }, 0.02);
- break;
-
- default :
- throw Exception('Curl error: ' . curl_multi_strerror($mrc));
-
- }
-
-}
-
-curl_multi_loop_scheduler($mh, function() {
-
- echo "Success!\n";
-
-});
-
-Loop\run();
-
-//close the handles
-curl_multi_remove_handle($mh, $ch1);
-curl_multi_remove_handle($mh, $ch2);
-curl_multi_close($mh);
diff --git a/htdocs/includes/sabre/sabre/event/examples/promise.php b/htdocs/includes/sabre/sabre/event/examples/promise.php
deleted file mode 100755
index 16ef3c53d71..00000000000
--- a/htdocs/includes/sabre/sabre/event/examples/promise.php
+++ /dev/null
@@ -1,100 +0,0 @@
-#!/usr/bin/env php
-fulfill("hello");
-
-}, 2);
-
-
-/* Callback chain */
-
-$result = $promise
- ->then(function($value) {
-
- echo "Step 2\n";
- // Immediately returning a new value.
- return $value . " world";
-
- })
- ->then(function($value) {
-
- echo "Step 3\n";
- // This 'then' returns a new promise which we resolve later.
- $promise = new Promise();
-
- // Resolving after 2 seconds
- Loop\setTimeout(function() use ($promise, $value) {
-
- $promise->fulfill($value . ", how are ya?");
-
- }, 2);
-
- return $promise;
- })
- ->then(function($value) {
-
- echo "Step 4\n";
- // This is the final event handler.
- return $value . " you rock!";
-
- })
- // Making all async calls synchronous by waiting for the final result.
- ->wait();
-
-echo $result, "\n";
-
-/* Now an identical example, this time with coroutines. */
-
-$result = coroutine(function() {
-
- $promise = new Promise();
-
- /* After 2 seconds we fulfill it */
- Loop\setTimeout(function() use ($promise) {
-
- echo "Step 1\n";
- $promise->fulfill("hello");
-
- }, 2);
-
- $value = (yield $promise);
-
- echo "Step 2\n";
- $value .= ' world';
-
- echo "Step 3\n";
- $promise = new Promise();
- Loop\setTimeout(function() use ($promise, $value) {
-
- $promise->fulfill($value . ", how are ya?");
-
- }, 2);
-
- $value = (yield $promise);
-
- echo "Step 4\n";
-
- // This is the final event handler.
- yield $value . " you rock!";
-
-})->wait();
-
-echo $result, "\n";
diff --git a/htdocs/includes/sabre/sabre/event/examples/tail.php b/htdocs/includes/sabre/sabre/event/examples/tail.php
deleted file mode 100755
index 334bd23f8bd..00000000000
--- a/htdocs/includes/sabre/sabre/event/examples/tail.php
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/usr/bin/env php
-listeners[$eventName])) {
$this->listeners[$eventName] = [
true, // If there's only one item, it's sorted
[$priority],
- [$callBack]
+ [$callBack],
];
} else {
$this->listeners[$eventName][0] = false; // marked as unsorted
$this->listeners[$eventName][1][] = $priority;
$this->listeners[$eventName][2][] = $callBack;
}
-
}
/**
* Subscribe to an event exactly once.
- *
- * @return void
*/
- function once(string $eventName, callable $callBack, int $priority = 100) {
-
+ public function once(string $eventName, callable $callBack, int $priority = 100)
+ {
$wrapper = null;
- $wrapper = function() use ($eventName, $callBack, &$wrapper) {
-
+ $wrapper = function () use ($eventName, $callBack, &$wrapper) {
$this->removeListener($eventName, $wrapper);
- return call_user_func_array($callBack, func_get_args());
+ return \call_user_func_array($callBack, \func_get_args());
};
$this->on($eventName, $wrapper, $priority);
-
}
/**
* Emits an event.
*
- * This method will return true if 0 or more listeners were succesfully
+ * This method will return true if 0 or more listeners were successfully
* handled. false is returned if one of the events broke the event chain.
*
* If the continueCallBack is specified, this callback will be called every
@@ -79,41 +73,35 @@ trait EmitterTrait {
* Lastly, if there are 5 event handlers for an event. The continueCallback
* will be called at most 4 times.
*/
- function emit(string $eventName, array $arguments = [], callable $continueCallBack = null) : bool {
-
- if (is_null($continueCallBack)) {
-
+ public function emit(string $eventName, array $arguments = [], callable $continueCallBack = null): bool
+ {
+ if (\is_null($continueCallBack)) {
foreach ($this->listeners($eventName) as $listener) {
-
- $result = call_user_func_array($listener, $arguments);
- if ($result === false) {
+ $result = \call_user_func_array($listener, $arguments);
+ if (false === $result) {
return false;
}
}
-
} else {
-
$listeners = $this->listeners($eventName);
- $counter = count($listeners);
+ $counter = \count($listeners);
foreach ($listeners as $listener) {
-
- $counter--;
- $result = call_user_func_array($listener, $arguments);
- if ($result === false) {
+ --$counter;
+ $result = \call_user_func_array($listener, $arguments);
+ if (false === $result) {
return false;
}
if ($counter > 0) {
- if (!$continueCallBack()) break;
+ if (!$continueCallBack()) {
+ break;
+ }
}
-
}
-
}
return true;
-
}
/**
@@ -124,24 +112,22 @@ trait EmitterTrait {
*
* @return callable[]
*/
- function listeners(string $eventName) : array {
-
+ public function listeners(string $eventName): array
+ {
if (!isset($this->listeners[$eventName])) {
return [];
}
// The list is not sorted
if (!$this->listeners[$eventName][0]) {
-
// Sorting
- array_multisort($this->listeners[$eventName][1], SORT_NUMERIC, $this->listeners[$eventName][2]);
+ \array_multisort($this->listeners[$eventName][1], SORT_NUMERIC, $this->listeners[$eventName][2]);
// Marking the listeners as sorted
$this->listeners[$eventName][0] = true;
}
return $this->listeners[$eventName][2];
-
}
/**
@@ -150,8 +136,8 @@ trait EmitterTrait {
* If the listener could not be found, this method will return false. If it
* was removed it will return true.
*/
- function removeListener(string $eventName, callable $listener) : bool {
-
+ public function removeListener(string $eventName, callable $listener): bool
+ {
if (!isset($this->listeners[$eventName])) {
return false;
}
@@ -159,11 +145,12 @@ trait EmitterTrait {
if ($check === $listener) {
unset($this->listeners[$eventName][1][$index]);
unset($this->listeners[$eventName][2][$index]);
+
return true;
}
}
- return false;
+ return false;
}
/**
@@ -172,24 +159,20 @@ trait EmitterTrait {
* If the eventName argument is specified, all listeners for that event are
* removed. If it is not specified, every listener for every event is
* removed.
- *
- * @return void
*/
- function removeAllListeners(string $eventName = null) {
-
- if (!is_null($eventName)) {
+ public function removeAllListeners(string $eventName = null)
+ {
+ if (!\is_null($eventName)) {
unset($this->listeners[$eventName]);
} else {
$this->listeners = [];
}
-
}
/**
- * The list of listeners
+ * The list of listeners.
*
* @var array
*/
protected $listeners = [];
-
}
diff --git a/htdocs/includes/sabre/sabre/event/lib/EventEmitter.php b/htdocs/includes/sabre/sabre/event/lib/EventEmitter.php
index cae6ac2a6ad..865c99b5386 100644
--- a/htdocs/includes/sabre/sabre/event/lib/EventEmitter.php
+++ b/htdocs/includes/sabre/sabre/event/lib/EventEmitter.php
@@ -1,19 +1,20 @@
-timers) {
// Special case when the timers array was empty.
$this->timers[] = [$triggerTime, $cb];
+
return;
}
@@ -46,14 +47,12 @@ class Loop {
[[$triggerTime, $cb]]
);
break;
- } elseif ($index === 0) {
+ } elseif (0 === $index) {
array_unshift($this->timers, [$triggerTime, $cb]);
break;
}
- $index--;
-
+ --$index;
}
-
}
/**
@@ -62,12 +61,12 @@ class Loop {
* The value this function returns can be used to stop the interval with
* clearInterval.
*/
- function setInterval(callable $cb, float $timeout) : array {
-
+ public function setInterval(callable $cb, float $timeout): array
+ {
$keepGoing = true;
$f = null;
- $f = function() use ($cb, &$f, $timeout, &$keepGoing) {
+ $f = function () use ($cb, &$f, $timeout, &$keepGoing) {
if ($keepGoing) {
$cb();
$this->setTimeout($f, $timeout);
@@ -82,32 +81,24 @@ class Loop {
// Because I'm worried people will be confused by using a boolean as a
// sort of identifier, I added an extra string.
return ['I\'m an implementation detail', &$keepGoing];
-
}
/**
* Stops a running interval.
- *
- * @return void
*/
- function clearInterval(array $intervalId) {
-
+ public function clearInterval(array $intervalId)
+ {
$intervalId[1] = false;
-
}
/**
* Runs a function immediately at the next iteration of the loop.
- *
- * @return void
*/
- function nextTick(callable $cb) {
-
+ public function nextTick(callable $cb)
+ {
$this->nextTick[] = $cb;
-
}
-
/**
* Adds a read stream.
*
@@ -118,13 +109,11 @@ class Loop {
* prevent the eventloop from never stopping.
*
* @param resource $stream
- * @return void
*/
- function addReadStream($stream, callable $cb) {
-
- $this->readStreams[(int)$stream] = $stream;
- $this->readCallbacks[(int)$stream] = $cb;
-
+ public function addReadStream($stream, callable $cb)
+ {
+ $this->readStreams[(int) $stream] = $stream;
+ $this->readCallbacks[(int) $stream] = $cb;
}
/**
@@ -137,65 +126,53 @@ class Loop {
* prevent the eventloop from never stopping.
*
* @param resource $stream
- * @return void
*/
- function addWriteStream($stream, callable $cb) {
-
- $this->writeStreams[(int)$stream] = $stream;
- $this->writeCallbacks[(int)$stream] = $cb;
-
+ public function addWriteStream($stream, callable $cb)
+ {
+ $this->writeStreams[(int) $stream] = $stream;
+ $this->writeCallbacks[(int) $stream] = $cb;
}
/**
* Stop watching a stream for reads.
*
* @param resource $stream
- * @return void
*/
- function removeReadStream($stream) {
-
+ public function removeReadStream($stream)
+ {
unset(
- $this->readStreams[(int)$stream],
- $this->readCallbacks[(int)$stream]
+ $this->readStreams[(int) $stream],
+ $this->readCallbacks[(int) $stream]
);
-
}
/**
* Stop watching a stream for writes.
*
* @param resource $stream
- * @return void
*/
- function removeWriteStream($stream) {
-
+ public function removeWriteStream($stream)
+ {
unset(
- $this->writeStreams[(int)$stream],
- $this->writeCallbacks[(int)$stream]
+ $this->writeStreams[(int) $stream],
+ $this->writeCallbacks[(int) $stream]
);
-
}
-
/**
* Runs the loop.
*
- * This function will run continiously, until there's no more events to
+ * This function will run continuously, until there's no more events to
* handle.
- *
- * @return void
*/
- function run() {
-
+ public function run()
+ {
$this->running = true;
do {
-
$hasEvents = $this->tick(true);
-
} while ($this->running && $hasEvents);
$this->running = false;
-
}
/**
@@ -210,8 +187,8 @@ class Loop {
* This function will return true if there are _any_ events left in the
* loop after the tick.
*/
- function tick(bool $block = false) : bool {
-
+ public function tick(bool $block = false): bool
+ {
$this->runNextTicks();
$nextTimeout = $this->runTimers();
@@ -232,19 +209,15 @@ class Loop {
$this->runStreams($streamWait);
- return ($this->readStreams || $this->writeStreams || $this->nextTick || $this->timers);
-
+ return $this->readStreams || $this->writeStreams || $this->nextTick || $this->timers;
}
/**
- * Stops a running eventloop
- *
- * @return void
+ * Stops a running eventloop.
*/
- function stop() {
-
+ public function stop()
+ {
$this->running = false;
-
}
/**
@@ -252,15 +225,14 @@ class Loop {
*
* return void
*/
- protected function runNextTicks() {
-
+ protected function runNextTicks()
+ {
$nextTick = $this->nextTick;
$this->nextTick = [];
foreach ($nextTick as $cb) {
$cb();
}
-
}
/**
@@ -273,8 +245,8 @@ class Loop {
*
* @return float|null
*/
- protected function runTimers() {
-
+ protected function runTimers()
+ {
$now = microtime(true);
while (($timer = array_pop($this->timers)) && $timer[0] < $now) {
$timer[1]();
@@ -282,9 +254,9 @@ class Loop {
// Add the last timer back to the array.
if ($timer) {
$this->timers[] = $timer;
+
return max(0, $timer[0] - microtime(true));
}
-
}
/**
@@ -295,36 +267,33 @@ class Loop {
*
* @param float|null timeout
*/
- protected function runStreams($timeout) {
-
+ protected function runStreams($timeout)
+ {
if ($this->readStreams || $this->writeStreams) {
-
$read = $this->readStreams;
$write = $this->writeStreams;
$except = null;
- if (stream_select($read, $write, $except, ($timeout === null) ? null : 0, $timeout ? (int)($timeout * 1000000) : 0)) {
-
+ // stream_select changes behavior in 8.1 to forbid passing non-null microseconds when the seconds are null.
+ // Older versions of php don't allow passing null to microseconds.
+ if (null !== $timeout ? stream_select($read, $write, $except, 0, (int) ($timeout * 1000000)) : stream_select($read, $write, $except, null)) {
// See PHP Bug https://bugs.php.net/bug.php?id=62452
// Fixed in PHP7
foreach ($read as $readStream) {
- $readCb = $this->readCallbacks[(int)$readStream];
+ $readCb = $this->readCallbacks[(int) $readStream];
$readCb();
}
foreach ($write as $writeStream) {
- $writeCb = $this->writeCallbacks[(int)$writeStream];
+ $writeCb = $this->writeCallbacks[(int) $writeStream];
$writeCb();
}
-
}
-
} elseif ($this->running && ($this->nextTick || $this->timers)) {
- usleep($timeout !== null ? intval($timeout * 1000000) : 200000);
+ usleep(null !== $timeout ? intval($timeout * 1000000) : 200000);
}
-
}
/**
- * Is the main loop active
+ * Is the main loop active.
*
* @var bool
*/
@@ -361,16 +330,14 @@ class Loop {
/**
* List of read callbacks, indexed by stream id.
*
- * @var callback[]
+ * @var callable[]
*/
protected $readCallbacks = [];
/**
* List of write callbacks, indexed by stream id.
*
- * @var callback[]
+ * @var callable[]
*/
protected $writeCallbacks = [];
-
-
}
diff --git a/htdocs/includes/sabre/sabre/event/lib/Loop/functions.php b/htdocs/includes/sabre/sabre/event/lib/Loop/functions.php
index b5884b2b62f..bf4d933f2d5 100644
--- a/htdocs/includes/sabre/sabre/event/lib/Loop/functions.php
+++ b/htdocs/includes/sabre/sabre/event/lib/Loop/functions.php
@@ -1,16 +1,15 @@
-setTimeout($cb, $timeout);
-
}
/**
@@ -19,35 +18,27 @@ function setTimeout(callable $cb, float $timeout) {
* The value this function returns can be used to stop the interval with
* clearInterval.
*/
-function setInterval(callable $cb, float $timeout) : array {
-
+function setInterval(callable $cb, float $timeout): array
+{
return instance()->setInterval($cb, $timeout);
-
}
/**
* Stops a running interval.
- *
- * @return void
*/
-function clearInterval(array $intervalId) {
-
+function clearInterval(array $intervalId)
+{
instance()->clearInterval($intervalId);
-
}
/**
* Runs a function immediately at the next iteration of the loop.
- *
- * @return void
*/
-function nextTick(callable $cb) {
-
+function nextTick(callable $cb)
+{
instance()->nextTick($cb);
-
}
-
/**
* Adds a read stream.
*
@@ -58,12 +49,10 @@ function nextTick(callable $cb) {
* prevent the eventloop from never stopping.
*
* @param resource $stream
- * @return void
*/
-function addReadStream($stream, callable $cb) {
-
+function addReadStream($stream, callable $cb)
+{
instance()->addReadStream($stream, $cb);
-
}
/**
@@ -76,51 +65,41 @@ function addReadStream($stream, callable $cb) {
* prevent the eventloop from never stopping.
*
* @param resource $stream
- * @return void
*/
-function addWriteStream($stream, callable $cb) {
-
+function addWriteStream($stream, callable $cb)
+{
instance()->addWriteStream($stream, $cb);
-
}
/**
* Stop watching a stream for reads.
*
* @param resource $stream
- * @return void
*/
-function removeReadStream($stream) {
-
+function removeReadStream($stream)
+{
instance()->removeReadStream($stream);
-
}
/**
* Stop watching a stream for writes.
*
* @param resource $stream
- * @return void
*/
-function removeWriteStream($stream) {
-
+function removeWriteStream($stream)
+{
instance()->removeWriteStream($stream);
-
}
-
/**
* Runs the loop.
*
- * This function will run continiously, until there's no more events to
+ * This function will run continuously, until there's no more events to
* handle.
- *
- * @return void
*/
-function run() {
-
+function run()
+{
instance()->run();
-
}
/**
@@ -135,34 +114,30 @@ function run() {
* This function will return true if there are _any_ events left in the
* loop after the tick.
*/
-function tick(bool $block = false) : bool {
-
+function tick(bool $block = false): bool
+{
return instance()->tick($block);
-
}
/**
- * Stops a running eventloop
- *
- * @return void
+ * Stops a running eventloop.
*/
-function stop() {
-
+function stop()
+{
instance()->stop();
-
}
/**
* Retrieves or sets the global Loop object.
*/
-function instance(Loop $newLoop = null) : Loop {
-
+function instance(Loop $newLoop = null): Loop
+{
static $loop;
if ($newLoop) {
$loop = $newLoop;
} elseif (!$loop) {
$loop = new Loop();
}
- return $loop;
+ return $loop;
}
diff --git a/htdocs/includes/sabre/sabre/event/lib/Promise.php b/htdocs/includes/sabre/sabre/event/lib/Promise.php
index 1d04bd4d456..42969a55f85 100644
--- a/htdocs/includes/sabre/sabre/event/lib/Promise.php
+++ b/htdocs/includes/sabre/sabre/event/lib/Promise.php
@@ -1,4 +1,6 @@
-fulfill and $this->reject.
* Using the executor is optional.
*/
- function __construct(callable $executor = null) {
-
+ public function __construct(callable $executor = null)
+ {
if ($executor) {
$executor(
[$this, 'fulfill'],
[$this, 'reject']
);
}
-
}
/**
@@ -84,32 +87,32 @@ class Promise {
* If either of the callbacks throw an exception, the returned promise will
* be rejected and the exception will be passed back.
*/
- function then(callable $onFulfilled = null, callable $onRejected = null) : Promise {
-
+ public function then(callable $onFulfilled = null, callable $onRejected = null): Promise
+ {
// This new subPromise will be returned from this function, and will
// be fulfilled with the result of the onFulfilled or onRejected event
// handlers.
$subPromise = new self();
switch ($this->state) {
- case self::PENDING :
+ case self::PENDING:
// The operation is pending, so we keep a reference to the
// event handlers so we can call them later.
$this->subscribers[] = [$subPromise, $onFulfilled, $onRejected];
break;
- case self::FULFILLED :
+ case self::FULFILLED:
// The async operation is already fulfilled, so we trigger the
// onFulfilled callback asap.
$this->invokeCallback($subPromise, $onFulfilled);
break;
- case self::REJECTED :
- // The async operation failed, so we call teh onRejected
+ case self::REJECTED:
+ // The async operation failed, so we call the onRejected
// callback asap.
$this->invokeCallback($subPromise, $onRejected);
break;
}
- return $subPromise;
+ return $subPromise;
}
/**
@@ -118,20 +121,19 @@ class Promise {
* Its usage is identical to then(). However, the otherwise() function is
* preferred.
*/
- function otherwise(callable $onRejected) : Promise {
-
+ public function otherwise(callable $onRejected): Promise
+ {
return $this->then(null, $onRejected);
-
}
/**
* Marks this promise as fulfilled and sets its return value.
*
* @param mixed $value
- * @return void
*/
- function fulfill($value = null) {
- if ($this->state !== self::PENDING) {
+ public function fulfill($value = null)
+ {
+ if (self::PENDING !== $this->state) {
throw new PromiseAlreadyResolvedException('This promise is already resolved, and you\'re not allowed to resolve a promise more than once');
}
$this->state = self::FULFILLED;
@@ -142,12 +144,11 @@ class Promise {
}
/**
- * Marks this promise as rejected, and set it's rejection reason.
- *
- * @return void
+ * Marks this promise as rejected, and set its rejection reason.
*/
- function reject(Throwable $reason) {
- if ($this->state !== self::PENDING) {
+ public function reject(Throwable $reason)
+ {
+ if (self::PENDING !== $this->state) {
throw new PromiseAlreadyResolvedException('This promise is already resolved, and you\'re not allowed to resolve a promise more than once');
}
$this->state = self::REJECTED;
@@ -155,13 +156,12 @@ class Promise {
foreach ($this->subscribers as $subscriber) {
$this->invokeCallback($subscriber[0], $subscriber[2]);
}
-
}
/**
* Stops execution until this promise is resolved.
*
- * This method stops exection completely. If the promise is successful with
+ * This method stops execution completely. If the promise is successful with
* a value, this method will return this value. If the promise was
* rejected, this method will throw an exception.
*
@@ -170,12 +170,12 @@ class Promise {
* chain.
*
* @return mixed
+ * @psalm-return TReturn
*/
- function wait() {
-
+ public function wait()
+ {
$hasEvents = true;
- while ($this->state === self::PENDING) {
-
+ while (self::PENDING === $this->state) {
if (!$hasEvents) {
throw new \LogicException('There were no more events in the loop. This promise will never be fulfilled.');
}
@@ -183,10 +183,9 @@ class Promise {
// As long as the promise is not fulfilled, we tell the event loop
// to handle events, and to block.
$hasEvents = Loop\tick(true);
-
}
- if ($this->state === self::FULFILLED) {
+ if (self::FULFILLED === $this->state) {
// If the state of this promise is fulfilled, we can return the value.
return $this->value;
} else {
@@ -194,11 +193,8 @@ class Promise {
// errored. Therefore we need to throw an exception.
throw $this->value;
}
-
-
}
-
/**
* A list of subscribers. Subscribers are the callbacks that want us to let
* them know if the callback was fulfilled or rejected.
@@ -224,21 +220,18 @@ class Promise {
* correctly, and any chained promises are also correctly fulfilled or
* rejected.
*
- * @param Promise $subPromise
* @param callable $callBack
- * @return void
*/
- private function invokeCallback(Promise $subPromise, callable $callBack = null) {
-
+ private function invokeCallback(Promise $subPromise, callable $callBack = null)
+ {
// We use 'nextTick' to ensure that the event handlers are always
// triggered outside of the calling stack in which they were originally
// passed to 'then'.
//
// This makes the order of execution more predictable.
- Loop\nextTick(function() use ($callBack, $subPromise) {
+ Loop\nextTick(function () use ($callBack, $subPromise) {
if (is_callable($callBack)) {
try {
-
$result = $callBack($this->value);
if ($result instanceof self) {
// If the callback (onRejected or onFulfilled)
@@ -257,7 +250,7 @@ class Promise {
$subPromise->reject($e);
}
} else {
- if ($this->state === self::FULFILLED) {
+ if (self::FULFILLED === $this->state) {
$subPromise->fulfill($this->value);
} else {
$subPromise->reject($this->value);
@@ -265,5 +258,4 @@ class Promise {
}
});
}
-
}
diff --git a/htdocs/includes/sabre/sabre/event/lib/Promise/functions.php b/htdocs/includes/sabre/sabre/event/lib/Promise/functions.php
index b846b7b84d1..fbed6347194 100644
--- a/htdocs/includes/sabre/sabre/event/lib/Promise/functions.php
+++ b/htdocs/includes/sabre/sabre/event/lib/Promise/functions.php
@@ -1,4 +1,6 @@
- $subPromise) {
-
$subPromise->then(
- function($result) use ($promiseIndex, &$completeResult, &$successCount, $success, $promises) {
+ function ($result) use ($promiseIndex, &$completeResult, &$successCount, $success, $promises) {
$completeResult[$promiseIndex] = $result;
- $successCount++;
+ ++$successCount;
if ($successCount === count($promises)) {
$success($completeResult);
}
+
return $result;
}
)->otherwise(
- function($reason) use ($fail) {
+ function ($reason) use ($fail) {
$fail($reason);
}
);
-
}
});
-
}
/**
@@ -67,22 +71,20 @@ function all(array $promises) : Promise {
*
* @param Promise[] $promises
*/
-function race(array $promises) : Promise {
-
- return new Promise(function($success, $fail) use ($promises) {
-
+function race(array $promises): Promise
+{
+ return new Promise(function ($success, $fail) use ($promises) {
$alreadyDone = false;
foreach ($promises as $promise) {
-
$promise->then(
- function($result) use ($success, &$alreadyDone) {
+ function ($result) use ($success, &$alreadyDone) {
if ($alreadyDone) {
return;
}
$alreadyDone = true;
$success($result);
},
- function($reason) use ($fail, &$alreadyDone) {
+ function ($reason) use ($fail, &$alreadyDone) {
if ($alreadyDone) {
return;
}
@@ -90,14 +92,10 @@ function race(array $promises) : Promise {
$fail($reason);
}
);
-
}
-
});
-
}
-
/**
* Returns a Promise that resolves with the given value.
*
@@ -106,25 +104,25 @@ function race(array $promises) : Promise {
*
* @param mixed $value
*/
-function resolve($value) : Promise {
-
+function resolve($value): Promise
+{
if ($value instanceof Promise) {
return $value->then();
} else {
$promise = new Promise();
$promise->fulfill($value);
+
return $promise;
}
-
}
/**
* Returns a Promise that will reject with the given reason.
*/
-function reject(Throwable $reason) : Promise {
-
+function reject(Throwable $reason): Promise
+{
$promise = new Promise();
$promise->reject($reason);
- return $promise;
+ return $promise;
}
diff --git a/htdocs/includes/sabre/sabre/event/lib/PromiseAlreadyResolvedException.php b/htdocs/includes/sabre/sabre/event/lib/PromiseAlreadyResolvedException.php
index 534a3d49416..abb6c108e5c 100644
--- a/htdocs/includes/sabre/sabre/event/lib/PromiseAlreadyResolvedException.php
+++ b/htdocs/includes/sabre/sabre/event/lib/PromiseAlreadyResolvedException.php
@@ -1,4 +1,6 @@
-wildcardListeners;
+ public function on(string $eventName, callable $callBack, int $priority = 100)
+ {
+ // If it ends with a wildcard, we use the wildcardListeners array
+ if ('*' === $eventName[\strlen($eventName) - 1]) {
+ $eventName = \substr($eventName, 0, -1);
+ $listeners = &$this->wildcardListeners;
} else {
- $listeners = & $this->listeners;
+ $listeners = &$this->listeners;
}
// Always fully reset the listener index. This is fairly sane for most
@@ -44,32 +44,27 @@ trait WildcardEmitterTrait {
$listeners[$eventName] = [];
}
$listeners[$eventName][] = [$priority, $callBack];
-
}
/**
* Subscribe to an event exactly once.
- *
- * @return void
*/
- function once(string $eventName, callable $callBack, int $priority = 100) {
-
+ public function once(string $eventName, callable $callBack, int $priority = 100)
+ {
$wrapper = null;
- $wrapper = function() use ($eventName, $callBack, &$wrapper) {
-
+ $wrapper = function () use ($eventName, $callBack, &$wrapper) {
$this->removeListener($eventName, $wrapper);
- return call_user_func_array($callBack, func_get_args());
+ return \call_user_func_array($callBack, \func_get_args());
};
$this->on($eventName, $wrapper, $priority);
-
}
/**
* Emits an event.
*
- * This method will return true if 0 or more listeners were succesfully
+ * This method will return true if 0 or more listeners were successfully
* handled. false is returned if one of the events broke the event chain.
*
* If the continueCallBack is specified, this callback will be called every
@@ -87,42 +82,35 @@ trait WildcardEmitterTrait {
* Lastly, if there are 5 event handlers for an event. The continueCallback
* will be called at most 4 times.
*/
- function emit(string $eventName, array $arguments = [], callable $continueCallBack = null) : bool {
-
- if (is_null($continueCallBack)) {
-
+ public function emit(string $eventName, array $arguments = [], callable $continueCallBack = null): bool
+ {
+ if (\is_null($continueCallBack)) {
foreach ($this->listeners($eventName) as $listener) {
-
- $result = call_user_func_array($listener, $arguments);
- if ($result === false) {
+ $result = \call_user_func_array($listener, $arguments);
+ if (false === $result) {
return false;
}
}
-
} else {
-
$listeners = $this->listeners($eventName);
- $counter = count($listeners);
+ $counter = \count($listeners);
foreach ($listeners as $listener) {
-
- $counter--;
- $result = call_user_func_array($listener, $arguments);
- if ($result === false) {
+ --$counter;
+ $result = \call_user_func_array($listener, $arguments);
+ if (false === $result) {
return false;
}
if ($counter > 0) {
- if (!$continueCallBack()) break;
+ if (!$continueCallBack()) {
+ break;
+ }
}
-
}
-
}
return true;
-
-
}
/**
@@ -133,46 +121,37 @@ trait WildcardEmitterTrait {
*
* @return callable[]
*/
- function listeners(string $eventName) : array {
-
- if (!array_key_exists($eventName, $this->listenerIndex)) {
-
+ public function listeners(string $eventName): array
+ {
+ if (!\array_key_exists($eventName, $this->listenerIndex)) {
// Create a new index.
$listeners = [];
$listenersPriority = [];
- if (isset($this->listeners[$eventName])) foreach ($this->listeners[$eventName] as $listener) {
-
- $listenersPriority[] = $listener[0];
- $listeners[] = $listener[1];
-
+ if (isset($this->listeners[$eventName])) {
+ foreach ($this->listeners[$eventName] as $listener) {
+ $listenersPriority[] = $listener[0];
+ $listeners[] = $listener[1];
+ }
}
foreach ($this->wildcardListeners as $wcEvent => $wcListeners) {
-
// Wildcard match
- if (substr($eventName, 0, strlen($wcEvent)) === $wcEvent) {
-
+ if (\substr($eventName, 0, \strlen($wcEvent)) === $wcEvent) {
foreach ($wcListeners as $listener) {
-
$listenersPriority[] = $listener[0];
$listeners[] = $listener[1];
-
}
-
}
-
}
// Sorting by priority
- array_multisort($listenersPriority, SORT_NUMERIC, $listeners);
+ \array_multisort($listenersPriority, SORT_NUMERIC, $listeners);
// Creating index
- $this->listenersIndex[$eventName] = $listeners;
-
+ $this->listenerIndex[$eventName] = $listeners;
}
- return $this->listenersIndex[$eventName];
-
+ return $this->listenerIndex[$eventName];
}
/**
@@ -181,14 +160,14 @@ trait WildcardEmitterTrait {
* If the listener could not be found, this method will return false. If it
* was removed it will return true.
*/
- function removeListener(string $eventName, callable $listener) : bool {
-
- // If it ends with a wildcard, we use the wildcardListeners array
- if ($eventName[strlen($eventName) - 1] === '*') {
- $eventName = substr($eventName, 0, -1);
- $listeners = & $this->wildcardListeners;
+ public function removeListener(string $eventName, callable $listener): bool
+ {
+ // If it ends with a wildcard, we use the wildcardListeners array
+ if ('*' === $eventName[\strlen($eventName) - 1]) {
+ $eventName = \substr($eventName, 0, -1);
+ $listeners = &$this->wildcardListeners;
} else {
- $listeners = & $this->listeners;
+ $listeners = &$this->listeners;
}
if (!isset($listeners[$eventName])) {
@@ -196,21 +175,17 @@ trait WildcardEmitterTrait {
}
foreach ($listeners[$eventName] as $index => $check) {
-
if ($check[1] === $listener) {
-
// Remove listener
unset($listeners[$eventName][$index]);
// Reset index
$this->listenerIndex = [];
+
return true;
-
}
-
}
return false;
-
}
/**
@@ -219,38 +194,32 @@ trait WildcardEmitterTrait {
* If the eventName argument is specified, all listeners for that event are
* removed. If it is not specified, every listener for every event is
* removed.
- *
- * @return void
*/
- function removeAllListeners(string $eventName = null) {
-
- if (is_null($eventName)) {
+ public function removeAllListeners(string $eventName = null)
+ {
+ if (\is_null($eventName)) {
$this->listeners = [];
$this->wildcardListeners = [];
-
} else {
-
- if ($eventName[strlen($eventName) - 1] === '*') {
+ if ('*' === $eventName[\strlen($eventName) - 1]) {
// Wildcard event
- unset($this->wildcardListeners[substr($eventName, 0, -1)]);
+ unset($this->wildcardListeners[\substr($eventName, 0, -1)]);
} else {
unset($this->listeners[$eventName]);
}
-
}
// Reset index
$this->listenerIndex = [];
-
}
/**
- * The list of listeners
+ * The list of listeners.
*/
protected $listeners = [];
/**
- * The list of "wildcard listeners".
+ * The list of "wildcard listeners".
*/
protected $wildcardListeners = [];
diff --git a/htdocs/includes/sabre/sabre/event/lib/coroutine.php b/htdocs/includes/sabre/sabre/event/lib/coroutine.php
index f571a8ba0c9..cdf2d3ecdb6 100644
--- a/htdocs/includes/sabre/sabre/event/lib/coroutine.php
+++ b/htdocs/includes/sabre/sabre/event/lib/coroutine.php
@@ -1,4 +1,6 @@
- $gen
+ * @psalm-return Promise
+ *
* @copyright Copyright (C) fruux GmbH (https://fruux.com/)
* @author Evert Pot (http://evertpot.com/)
* @license http://sabre.io/license/ Modified BSD License
*/
-function coroutine(callable $gen) : Promise {
-
+function coroutine(callable $gen): Promise
+{
$generator = $gen();
if (!$generator instanceof Generator) {
throw new \InvalidArgumentException('You must pass a generator function');
@@ -59,22 +66,20 @@ function coroutine(callable $gen) : Promise {
* So tempted to use the mythical y-combinator here, but it's not needed in
* PHP.
*/
- $advanceGenerator = function() use (&$advanceGenerator, $generator, $promise, &$lastYieldResult) {
-
+ $advanceGenerator = function () use (&$advanceGenerator, $generator, $promise) {
while ($generator->valid()) {
-
$yieldedValue = $generator->current();
if ($yieldedValue instanceof Promise) {
$yieldedValue->then(
- function($value) use ($generator, &$advanceGenerator, &$lastYieldResult) {
+ function ($value) use ($generator, &$advanceGenerator) {
$generator->send($value);
$advanceGenerator();
},
- function(Throwable $reason) use ($generator, $advanceGenerator) {
+ function (Throwable $reason) use ($generator, $advanceGenerator) {
$generator->throw($reason);
$advanceGenerator();
}
- )->otherwise(function(Throwable $reason) use ($promise) {
+ )->otherwise(function (Throwable $reason) use ($promise) {
// This error handler would be called, if something in the
// generator throws an exception, and it's not caught
// locally.
@@ -87,31 +92,25 @@ function coroutine(callable $gen) : Promise {
// If the value was not a promise, we'll just let it pass through.
$generator->send($yieldedValue);
}
-
}
// If the generator is at the end, and we didn't run into an exception,
// We're grabbing the "return" value and fulfilling our top-level
// promise with its value.
- if (!$generator->valid() && $promise->state === Promise::PENDING) {
- $returnValue = $generator->getReturn();
-
- // The return value is a promise.
- if ($returnValue instanceof Promise) {
- $returnValue->then(function($value) use ($promise) {
- $promise->fulfill($value);
- }, function(Throwable $reason) {
- $promise->reject($reason);
- });
- } else {
-
- $promise->fulfill($returnValue);
-
- }
-
+ if (!$generator->valid() && Promise::PENDING === $promise->state) {
+ $returnValue = $generator->getReturn();
+ // The return value is a promise.
+ if ($returnValue instanceof Promise) {
+ $returnValue->then(function ($value) use ($promise) {
+ $promise->fulfill($value);
+ }, function (Throwable $reason) use ($promise) {
+ $promise->reject($reason);
+ });
+ } else {
+ $promise->fulfill($returnValue);
+ }
}
-
};
try {
@@ -121,5 +120,4 @@ function coroutine(callable $gen) : Promise {
}
return $promise;
-
}
diff --git a/htdocs/includes/sabre/sabre/event/phpstan.neon b/htdocs/includes/sabre/sabre/event/phpstan.neon
new file mode 100644
index 00000000000..213da6dad2a
--- /dev/null
+++ b/htdocs/includes/sabre/sabre/event/phpstan.neon
@@ -0,0 +1,2 @@
+parameters:
+ level: 1
diff --git a/htdocs/includes/sabre/sabre/event/phpunit.xml.dist b/htdocs/includes/sabre/sabre/event/phpunit.xml.dist
deleted file mode 100644
index ccd59be9c2a..00000000000
--- a/htdocs/includes/sabre/sabre/event/phpunit.xml.dist
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
- tests/
-
-
-
-
- ./lib/
-
-
-
diff --git a/htdocs/includes/sabre/sabre/http/.gitignore b/htdocs/includes/sabre/sabre/http/.gitignore
index 5f85ecc1b98..367bba576a4 100644
--- a/htdocs/includes/sabre/sabre/http/.gitignore
+++ b/htdocs/includes/sabre/sabre/http/.gitignore
@@ -4,15 +4,5 @@ composer.lock
# Tests
tests/cov/
-
-# Composer binaries
-bin/phpunit*
-bin/phpcs*
-bin/php-cs-fixer*
-bin/sabre-cs-fixer*
-
-# Vim
-.*.swp
-
-# development stuff
+.phpunit.result.cache
.php_cs.cache
diff --git a/htdocs/includes/sabre/sabre/http/.php_cs.dist b/htdocs/includes/sabre/sabre/http/.php_cs.dist
index 8d61ee25924..c5c78a971df 100644
--- a/htdocs/includes/sabre/sabre/http/.php_cs.dist
+++ b/htdocs/includes/sabre/sabre/http/.php_cs.dist
@@ -6,7 +6,7 @@ $config->getFinder()
->in(__DIR__);
$config->setRules([
'@PSR1' => true,
- '@Symfony' =>true
+ '@Symfony' => true
]);
return $config;
\ No newline at end of file
diff --git a/htdocs/includes/sabre/sabre/http/.travis.yml b/htdocs/includes/sabre/sabre/http/.travis.yml
deleted file mode 100644
index 3b85d5f3913..00000000000
--- a/htdocs/includes/sabre/sabre/http/.travis.yml
+++ /dev/null
@@ -1,41 +0,0 @@
-language: php
-sudo: required
-php:
- - 7.0
- - 7.1
- - 7.2
- - 7.3
- - 7.4snapshot
-
-env:
- global:
- - RUN_PHPSTAN="FALSE"
- matrix:
- - PREFER_LOWEST="" WITH_COVERAGE="--coverage-clover=coverage.xml"
- - PREFER_LOWEST="--prefer-lowest" $WITH_COVERAGE=""
-
-matrix:
- include:
- - name: 'PHPStan'
- php: 7.2
- env: RUN_PHPSTAN="TRUE"
- fast_finish: true
-
-cache:
- directories:
- - $HOME/.composer/cache
-
-install:
- - if [ $RUN_PHPSTAN == "TRUE" ]; then composer require --dev phpstan/phpstan; fi
-
-before_script:
- - composer update --prefer-source $PREFER_LOWEST
- - PHP_BIN=$(phpenv which php)
- - sudo $PHP_BIN -S localhost:80 -t $TRAVIS_BUILD_DIR/tests/www 2>/dev/null &
-
-script:
- - if [ $RUN_PHPSTAN == "FALSE" ]; then ./bin/phpunit --configuration tests/phpunit.xml $WITH_COVERAGE; fi
- - if [ $RUN_PHPSTAN == "TRUE" ]; then php ./bin/phpstan analyse -c phpstan.neon lib; fi
-
-after_success:
- - bash <(curl -s https://codecov.io/bash)
diff --git a/htdocs/includes/sabre/sabre/http/CHANGELOG.md b/htdocs/includes/sabre/sabre/http/CHANGELOG.md
index e300aad09bc..7c6f4b6ec83 100644
--- a/htdocs/includes/sabre/sabre/http/CHANGELOG.md
+++ b/htdocs/includes/sabre/sabre/http/CHANGELOG.md
@@ -1,6 +1,68 @@
ChangeLog
=========
+5.1.10 (2023-08-18)
+------------------
+
+* #225 Enhance tests/bootstrap.php to find autoloader in more environments (@phil-davis)
+
+5.1.9 (2023-08-17)
+------------------
+
+* #223 skip testParseMimeTypeOnInvalidMimeType (@phil-davis)
+
+5.1.8 (2023-08-17)
+------------------
+
+* #215 Improve CURLOPT_HTTPHEADER Setting Assignment (@amrita-shrestha)
+
+5.1.7 (2023-06-26)
+------------------
+
+* #98 and #176 Add more tests (@peter279k)
+* #207 fix: handle client disconnect properly with ignore_user_abort true (@kesselb)
+
+5.1.6 (2022-07-15)
+------------------
+
+* #187 Allow testSendToGetLargeContent peak memory usage to be specified externally (@phil-davis)
+* #188 Fix various small typos and grammar (@phil-davis)
+* #189 Fix typo in text of status code 203 'Non-Authoritative Information' (@phil-davis)
+
+5.1.5 (2022-07-09)
+------------------
+
+* #184 Remove 4GB file size workaround for 32bit OS / Stream Videos on IOS (@schoetju)
+
+5.1.4 (2022-06-24)
+------------------
+
+* #182 Fix encoding detection on PHP 8.1 (@come-nc)
+
+5.1.3 (2021-11-04)
+------------------
+
+* #179 version bump that was missed in 5.1.2 (@phil-davis)
+
+5.1.2 (2021-11-04)
+-------------------------
+
+* #169 Ensure $_SERVER keys are read as strings (@fredrik-eriksson)
+* #170 Fix deprecated usages on PHP 8.1 (@cedric-anne)
+* #175 Add resource size to CURL options in client (from #172 ) (@Dartui)
+
+5.1.1 (2020-10-03)
+-------------------------
+
+* #160: Added support for PHP 8.0 (@phil-davis)
+
+5.1.0 (2020-01-31)
+-------------------------
+
+* Added support for PHP 7.4, dropped support for PHP 7.0 (@phil-davis)
+* Updated testsuite for phpunit8, added phpstan coverage (@phil-davis)
+* Added autoload-dev for test classes (@C0pyR1ght)
+
5.0.5 (2019-11-28)
-------------------------
@@ -48,7 +110,7 @@ ChangeLog
* #65: It's now possible to supply request/response bodies using a callback
functions. This allows very high-speed/low-memory responses to be created.
(@petrkotek).
-* Strict typing is used every where this is applicable.
+* Strict typing is used everywhere this is applicable.
* Removed `URLUtil` class. It was deprecated a long time ago, and most of
its functions moved to the `sabre/uri` package.
* Removed `Util` class. Most of its functions moved to the `functions.php`
@@ -67,7 +129,7 @@ ChangeLog
4.2.3 (2017-06-12)
------------------
-* #74, #77: Work around 4GB file size limit at 32 Bit systems
+* #74, #77: Work around 4GB file size limit at 32-Bit systems
4.2.2 (2017-01-02)
@@ -255,7 +317,7 @@ ChangeLog
* Changed: Response::send() is now Sapi::sendResponse($response).
* Changed: Request::createFromPHPRequest is now Sapi::getRequest().
* Changed: Message::getBodyAsStream and Message::getBodyAsString were added. The
- existing Message::getBody changed it's behavior, so be careful.
+ existing Message::getBody changed its behavior, so be careful.
2.0.0alpha5 (2013-11-07)
diff --git a/htdocs/includes/sabre/sabre/http/README.md b/htdocs/includes/sabre/sabre/http/README.md
index 8159b4d4976..2f01c144857 100644
--- a/htdocs/includes/sabre/sabre/http/README.md
+++ b/htdocs/includes/sabre/sabre/http/README.md
@@ -28,11 +28,11 @@ The objects are extendable and easily mockable.
Build status
------------
-| branch | status |
-| ------ | ------ |
+| branch | status |
+|--------|---------------------------------------------------------------------------------------------------------------|
| master | [](https://travis-ci.org/sabre-io/http) |
-| 4.2 | [](https://travis-ci.org/sabre-io/http) |
-| 3.0 | [](https://travis-ci.org/sabre-io/http) |
+| 4.2 | [](https://travis-ci.org/sabre-io/http) |
+| 3.0 | [](https://travis-ci.org/sabre-io/http) |
Installation
------------
@@ -84,7 +84,7 @@ $request = HTTP\Sapi::getRequest();
This line should only happen once in your entire application. Everywhere else
you should pass this request object around using dependency injection.
-You should always typehint on it's interface:
+You should always typehint on its interface:
```php
function handleRequest(HTTP\RequestInterface $request) {
@@ -133,9 +133,9 @@ Simply extending Request and Response may pose some problems:
1. You may want to extend the objects with new behaviors differently, in
different subsystems of your application,
-2. The `Sapi::getRequest` factory always returns a instance of
+2. The `Sapi::getRequest` factory always returns an instance of
`Request` so you would have to override the factory method as well,
-3. By controlling the instantation and depend on specific `Request` and
+3. By controlling the instantiation and depend on specific `Request` and
`Response` instances in your library or application, you make it harder to
work with other applications which also use `sabre/http`.
@@ -162,7 +162,7 @@ class MyRequest extends HTTP\RequestDecorator {
Our application assumes that the true `Request` object was instantiated
somewhere else, by some other subsystem. This could simply be a call like
`$request = Sapi::getRequest()` at the top of your application,
-but could also be somewhere in a unittest.
+but could also be somewhere in a unit test.
All we know in the current subsystem, is that we received a `$request` and
that it implements `Sabre\HTTP\RequestInterface`. To decorate this object,
@@ -296,7 +296,7 @@ $remoteUrl = 'http://example.org/';
// The url we're proxying from. Please note that this must be a relative url,
// and basically acts as the base url.
//
-// If youre $remoteUrl doesn't end with a slash, this one probably shouldn't
+// If your $remoteUrl doesn't end with a slash, this one probably shouldn't
// either.
$myBaseUrl = '/reverseproxy.php';
// $myBaseUrl = '/~evert/sabre/http/examples/reverseproxy.php/';
@@ -412,10 +412,10 @@ function setBaseUrl($url);
* If the full path is equal to the base url, this method will return an
* empty string.
*
- * This method will also urldecode the path, and if the url was incoded as
+ * This method will also urldecode the path, and if the url was encoded as
* ISO-8859-1, it will convert it to UTF-8.
*
- * If the path is outside of the base url, a LogicException will be thrown.
+ * If the path is outside the base url, a LogicException will be thrown.
*
* @return string
*/
@@ -491,7 +491,7 @@ function getBodyAsStream();
function getBodyAsString();
/**
- * Returns the message body, as it's internal representation.
+ * Returns the message body, as its internal representation.
*
* This could be either a string or a stream.
*
@@ -515,7 +515,7 @@ function setBody($body);
function getHeaders();
/**
- * Returns a specific HTTP header, based on it's name.
+ * Returns a specific HTTP header, based on its name.
*
* The name must be treated as case-insensitive.
*
@@ -529,7 +529,7 @@ function getHeader($name);
/**
* Updates a HTTP header.
*
- * The case-sensitity of the name value must be retained as-is.
+ * The case-sensitivity of the name value must be retained as-is.
*
* @param string $name
* @param string $value
@@ -561,7 +561,7 @@ function addHeaders(array $headers);
/**
* Removes a HTTP header.
*
- * The specified header name must be treated as case-insenstive.
+ * The specified header name must be treated as case-insensitive.
* This method should return true if the header was successfully deleted,
* and false if the header did not exist.
*
@@ -593,7 +593,7 @@ function getHttpVersion();
/**
* Returns the current HTTP status.
*
- * This is the status-code as well as the human readable string.
+ * This is the status-code as well as the human-readable string.
*
* @return string
*/
@@ -602,7 +602,7 @@ function getStatus();
/**
* Sets the HTTP status code.
*
- * This can be either the full HTTP status code with human readable string,
+ * This can be either the full HTTP status code with human-readable string,
* for example: "403 I can't let you do that, Dave".
*
* Or just the code, in which case the appropriate default message will be
@@ -635,7 +635,7 @@ function getBodyAsStream();
function getBodyAsString();
/**
- * Returns the message body, as it's internal representation.
+ * Returns the message body, as its internal representation.
*
* This could be either a string or a stream.
*
@@ -660,7 +660,7 @@ function setBody($body);
function getHeaders();
/**
- * Returns a specific HTTP header, based on it's name.
+ * Returns a specific HTTP header, based on its name.
*
* The name must be treated as case-insensitive.
*
@@ -674,7 +674,7 @@ function getHeader($name);
/**
* Updates a HTTP header.
*
- * The case-sensitity of the name value must be retained as-is.
+ * The case-sensitivity of the name value must be retained as-is.
*
* @param string $name
* @param string $value
@@ -706,7 +706,7 @@ function addHeaders(array $headers);
/**
* Removes a HTTP header.
*
- * The specified header name must be treated as case-insenstive.
+ * The specified header name must be treated as case-insensitive.
* This method should return true if the header was successfully deleted,
* and false if the header did not exist.
*
diff --git a/htdocs/includes/sabre/sabre/http/composer.json b/htdocs/includes/sabre/sabre/http/composer.json
index 851a08730ff..547a1b5efd9 100644
--- a/htdocs/includes/sabre/sabre/http/composer.json
+++ b/htdocs/includes/sabre/sabre/http/composer.json
@@ -1,44 +1,59 @@
{
- "name": "sabre/http",
- "description" : "The sabre/http library provides utilities for dealing with http requests and responses. ",
- "keywords" : [ "HTTP" ],
- "homepage" : "https://github.com/fruux/sabre-http",
- "license" : "BSD-3-Clause",
- "require" : {
- "php" : "^7.0",
- "ext-mbstring" : "*",
- "ext-ctype" : "*",
- "ext-curl" : "*",
- "sabre/event" : ">=4.0 <6.0",
- "sabre/uri" : "^2.0"
- },
- "require-dev" : {
- "phpunit/phpunit" : "^6.0 || ^7.0"
- },
- "suggest" : {
- "ext-curl" : " to make http requests with the Client class"
- },
- "authors" : [
- {
- "name" : "Evert Pot",
- "email" : "me@evertpot.com",
- "homepage" : "http://evertpot.com/",
- "role" : "Developer"
- }
- ],
- "support" : {
- "forum" : "https://groups.google.com/group/sabredav-discuss",
- "source" : "https://github.com/fruux/sabre-http"
- },
- "autoload" : {
- "files" : [
- "lib/functions.php"
- ],
- "psr-4" : {
- "Sabre\\HTTP\\" : "lib/"
- }
- },
- "config" : {
- "bin-dir" : "bin/"
- }
-}
+ "name" : "sabre/http",
+ "description" : "The sabre/http library provides utilities for dealing with http requests and responses. ",
+ "keywords" : [
+ "HTTP"
+ ],
+ "homepage" : "https://github.com/fruux/sabre-http",
+ "license" : "BSD-3-Clause",
+ "require" : {
+ "php" : "^7.1 || ^8.0",
+ "ext-mbstring" : "*",
+ "ext-ctype" : "*",
+ "ext-curl" : "*",
+ "sabre/event" : ">=4.0 <6.0",
+ "sabre/uri" : "^2.0"
+ },
+ "require-dev" : {
+ "friendsofphp/php-cs-fixer" : "~2.17.1",
+ "phpstan/phpstan" : "^0.12",
+ "phpunit/phpunit" : "^7.5 || ^8.5 || ^9.0"
+ },
+ "suggest" : {
+ "ext-curl" : " to make http requests with the Client class"
+ },
+ "authors" : [{
+ "name" : "Evert Pot",
+ "email" : "me@evertpot.com",
+ "homepage" : "http://evertpot.com/",
+ "role" : "Developer"
+ }
+ ],
+ "support" : {
+ "forum" : "https://groups.google.com/group/sabredav-discuss",
+ "source" : "https://github.com/fruux/sabre-http"
+ },
+ "autoload" : {
+ "files" : [
+ "lib/functions.php"
+ ],
+ "psr-4" : {
+ "Sabre\\HTTP\\" : "lib/"
+ }
+ },
+ "autoload-dev" : {
+ "psr-4" : {
+ "Sabre\\HTTP\\" : "tests/HTTP"
+ }
+ },
+ "scripts" : {
+ "phpstan" : "phpstan analyse lib tests",
+ "cs-fixer" : "php-cs-fixer fix",
+ "phpunit" : "phpunit --configuration tests/phpunit.xml",
+ "test" : [
+ "composer phpstan",
+ "composer cs-fixer",
+ "composer phpunit"
+ ]
+ }
+}
\ No newline at end of file
diff --git a/htdocs/includes/sabre/sabre/http/examples/asyncclient.php b/htdocs/includes/sabre/sabre/http/examples/asyncclient.php
deleted file mode 100644
index af98e253c8d..00000000000
--- a/htdocs/includes/sabre/sabre/http/examples/asyncclient.php
+++ /dev/null
@@ -1,62 +0,0 @@
-sendAsync(
- $request,
-
- // This is the 'success' callback
- function ($response) use ($i) {
- echo "$i -> ".$response->getStatus()."\n";
- },
-
- // This is the 'error' callback. It is called for general connection
- // problems (such as not being able to connect to a host, dns errors,
- // etc.) and also cases where a response was returned, but it had a
- // status code of 400 or higher.
- function ($error) use ($i) {
- if (Client::STATUS_CURLERROR === $error['status']) {
- // Curl errors
- echo "$i -> curl error: ".$error['curl_errmsg']."\n";
- } else {
- // HTTP errors
- echo "$i -> ".$error['response']->getStatus()."\n";
- }
- }
- );
-}
-
-// After everything is done, we call 'wait'. This causes the client to wait for
-// all outstanding http requests to complete.
-$client->wait();
diff --git a/htdocs/includes/sabre/sabre/http/examples/basicauth.php b/htdocs/includes/sabre/sabre/http/examples/basicauth.php
deleted file mode 100644
index 9c13da840b4..00000000000
--- a/htdocs/includes/sabre/sabre/http/examples/basicauth.php
+++ /dev/null
@@ -1,50 +0,0 @@
- 'password',
- 'user2' => 'password',
-];
-
-use Sabre\HTTP\Auth;
-use Sabre\HTTP\Response;
-use Sabre\HTTP\Sapi;
-
-// Find the autoloader
-$paths = [
- __DIR__.'/../vendor/autoload.php',
- __DIR__.'/../../../autoload.php',
- __DIR__.'/vendor/autoload.php',
-];
-
-foreach ($paths as $path) {
- if (file_exists($path)) {
- include $path;
- break;
- }
-}
-
-$request = Sapi::getRequest();
-$response = new Response();
-
-$basicAuth = new Auth\Basic('Locked down area', $request, $response);
-if (!$userPass = $basicAuth->getCredentials()) {
- // No username or password given
- $basicAuth->requireLogin();
-} elseif (!isset($userList[$userPass[0]]) || $userList[$userPass[0]] !== $userPass[1]) {
- // Username or password are incorrect
- $basicAuth->requireLogin();
-} else {
- // Success !
- $response->setBody('You are logged in!');
-}
-
-// Sending the response
-Sapi::sendResponse($response);
diff --git a/htdocs/includes/sabre/sabre/http/examples/client.php b/htdocs/includes/sabre/sabre/http/examples/client.php
deleted file mode 100644
index a7cbfc3b4e2..00000000000
--- a/htdocs/includes/sabre/sabre/http/examples/client.php
+++ /dev/null
@@ -1,37 +0,0 @@
-addCurlSetting(CURLOPT_PROXY,'localhost:8888');
-$response = $client->send($request);
-
-echo "Response:\n";
-
-echo (string) $response;
diff --git a/htdocs/includes/sabre/sabre/http/examples/digestauth.php b/htdocs/includes/sabre/sabre/http/examples/digestauth.php
deleted file mode 100644
index 5594306f510..00000000000
--- a/htdocs/includes/sabre/sabre/http/examples/digestauth.php
+++ /dev/null
@@ -1,51 +0,0 @@
- 'password',
- 'user2' => 'password',
-];
-
-use Sabre\HTTP\Auth;
-use Sabre\HTTP\Response;
-use Sabre\HTTP\Sapi;
-
-// Find the autoloader
-$paths = [
- __DIR__.'/../vendor/autoload.php',
- __DIR__.'/../../../autoload.php',
- __DIR__.'/vendor/autoload.php',
-];
-
-foreach ($paths as $path) {
- if (file_exists($path)) {
- include $path;
- break;
- }
-}
-
-$request = Sapi::getRequest();
-$response = new Response();
-
-$digestAuth = new Auth\Digest('Locked down area', $request, $response);
-$digestAuth->init();
-if (!$userName = $digestAuth->getUsername()) {
- // No username given
- $digestAuth->requireLogin();
-} elseif (!isset($userList[$userName]) || !$digestAuth->validatePassword($userList[$userName])) {
- // Username or password are incorrect
- $digestAuth->requireLogin();
-} else {
- // Success !
- $response->setBody('You are logged in!');
-}
-
-// Sending the response
-Sapi::sendResponse($response);
diff --git a/htdocs/includes/sabre/sabre/http/examples/reverseproxy.php b/htdocs/includes/sabre/sabre/http/examples/reverseproxy.php
deleted file mode 100644
index ce51ad43d23..00000000000
--- a/htdocs/includes/sabre/sabre/http/examples/reverseproxy.php
+++ /dev/null
@@ -1,48 +0,0 @@
-setBaseUrl($myBaseUrl);
-
-$subRequest = clone $request;
-
-// Removing the Host header.
-$subRequest->removeHeader('Host');
-
-// Rewriting the url.
-$subRequest->setUrl($remoteUrl.$request->getPath());
-
-$client = new Client();
-
-// Sends the HTTP request to the server
-$response = $client->send($subRequest);
-
-// Sends the response back to the client that connected to the proxy.
-Sapi::sendResponse($response);
diff --git a/htdocs/includes/sabre/sabre/http/examples/stringify.php b/htdocs/includes/sabre/sabre/http/examples/stringify.php
deleted file mode 100644
index 96f7da84b31..00000000000
--- a/htdocs/includes/sabre/sabre/http/examples/stringify.php
+++ /dev/null
@@ -1,50 +0,0 @@
-setHeaders([
- 'Host' => 'example.org',
- 'Content-Type' => 'application/json',
- ]);
-
-$request->setBody(json_encode(['foo' => 'bar']));
-
-echo $request;
-echo "\r\n\r\n";
-
-$response = new Response(424);
-$response->setHeaders([
- 'Content-Type' => 'text/plain',
- 'Connection' => 'close',
- ]);
-
-$response->setBody('ABORT! ABORT!');
-
-echo $response;
-
-echo "\r\n";
diff --git a/htdocs/includes/sabre/sabre/http/lib/Auth/AbstractAuth.php b/htdocs/includes/sabre/sabre/http/lib/Auth/AbstractAuth.php
index ada6bf0f0d3..07f451bc098 100644
--- a/htdocs/includes/sabre/sabre/http/lib/Auth/AbstractAuth.php
+++ b/htdocs/includes/sabre/sabre/http/lib/Auth/AbstractAuth.php
@@ -42,7 +42,7 @@ abstract class AbstractAuth
/**
* Creates the object.
*/
- public function __construct(string $realm = 'SabreTooth', RequestInterface $request, ResponseInterface $response)
+ public function __construct(string $realm, RequestInterface $request, ResponseInterface $response)
{
$this->realm = $realm;
$this->request = $request;
@@ -50,7 +50,7 @@ abstract class AbstractAuth
}
/**
- * This method sends the needed HTTP header and statuscode (401) to force
+ * This method sends the needed HTTP header and status code (401) to force
* the user to login.
*/
abstract public function requireLogin();
diff --git a/htdocs/includes/sabre/sabre/http/lib/Auth/Basic.php b/htdocs/includes/sabre/sabre/http/lib/Auth/Basic.php
index d04b4a81126..c1bad1a5bb0 100644
--- a/htdocs/includes/sabre/sabre/http/lib/Auth/Basic.php
+++ b/htdocs/includes/sabre/sabre/http/lib/Auth/Basic.php
@@ -49,7 +49,7 @@ class Basic extends AbstractAuth
}
/**
- * This method sends the needed HTTP header and statuscode (401) to force
+ * This method sends the needed HTTP header and status code (401) to force
* the user to login.
*/
public function requireLogin()
diff --git a/htdocs/includes/sabre/sabre/http/lib/Auth/Bearer.php b/htdocs/includes/sabre/sabre/http/lib/Auth/Bearer.php
index 988bb29d2a6..580e239410f 100644
--- a/htdocs/includes/sabre/sabre/http/lib/Auth/Bearer.php
+++ b/htdocs/includes/sabre/sabre/http/lib/Auth/Bearer.php
@@ -42,7 +42,7 @@ class Bearer extends AbstractAuth
}
/**
- * This method sends the needed HTTP header and statuscode (401) to force
+ * This method sends the needed HTTP header and status code (401) to force
* authentication.
*/
public function requireLogin()
diff --git a/htdocs/includes/sabre/sabre/http/lib/Auth/Digest.php b/htdocs/includes/sabre/sabre/http/lib/Auth/Digest.php
index dd35a0b7448..e80e7830532 100644
--- a/htdocs/includes/sabre/sabre/http/lib/Auth/Digest.php
+++ b/htdocs/includes/sabre/sabre/http/lib/Auth/Digest.php
@@ -46,7 +46,7 @@ class Digest extends AbstractAuth
/**
* Initializes the object.
*/
- public function __construct(string $realm = 'SabreTooth', RequestInterface $request, ResponseInterface $response)
+ public function __construct(string $realm, RequestInterface $request, ResponseInterface $response)
{
$this->nonce = uniqid();
$this->opaque = md5($realm);
@@ -133,7 +133,7 @@ class Digest extends AbstractAuth
return false;
}
// We need to add an md5 of the entire request body to the A2 part of the hash
- $body = $this->request->getBody($asString = true);
+ $body = $this->request->getBody();
$this->request->setBody($body);
$A2 .= ':'.md5($body);
} elseif (!($this->qop & self::QOP_AUTH)) {
@@ -174,7 +174,7 @@ class Digest extends AbstractAuth
/**
* This method returns the full digest string.
*
- * It should be compatibile with mod_php format and other webservers.
+ * It should be compatible with mod_php format and other webservers.
*
* If the header could not be found, null will be returned
*
diff --git a/htdocs/includes/sabre/sabre/http/lib/Client.php b/htdocs/includes/sabre/sabre/http/lib/Client.php
index 48862e7da4f..0837e8d2aa5 100644
--- a/htdocs/includes/sabre/sabre/http/lib/Client.php
+++ b/htdocs/includes/sabre/sabre/http/lib/Client.php
@@ -26,7 +26,7 @@ use Sabre\Uri;
* request before it's done, such as adding authentication headers.
*
* The afterRequest event will be emitted after the request is completed
- * succesfully.
+ * successfully.
*
* If a HTTP error is returned (status code higher than 399) the error event is
* triggered. It's possible using this event to retry the request, by setting
@@ -53,7 +53,7 @@ class Client extends EventEmitter
protected $curlSettings = [];
/**
- * Wether or not exceptions should be thrown when a HTTP error is returned.
+ * Whether exceptions should be thrown when a HTTP error is returned.
*
* @var bool
*/
@@ -376,11 +376,16 @@ class Client extends EventEmitter
default:
$body = $request->getBody();
if (is_resource($body)) {
+ $bodyStat = fstat($body);
+
// This needs to be set to PUT, regardless of the actual
// method used. Without it, INFILE will be ignored for some
// reason.
$settings[CURLOPT_PUT] = true;
- $settings[CURLOPT_INFILE] = $request->getBody();
+ $settings[CURLOPT_INFILE] = $body;
+ if (false !== $bodyStat && array_key_exists('size', $bodyStat)) {
+ $settings[CURLOPT_INFILESIZE] = $bodyStat['size'];
+ }
} else {
// For security we cast this to a string. If somehow an array could
// be passed here, it would be possible for an attacker to use @ to
@@ -397,7 +402,10 @@ class Client extends EventEmitter
$nHeaders[] = $key.': '.$value;
}
}
- $settings[CURLOPT_HTTPHEADER] = $nHeaders;
+
+ if ([] !== $nHeaders) {
+ $settings[CURLOPT_HTTPHEADER] = $nHeaders;
+ }
$settings[CURLOPT_URL] = $request->getUrl();
// FIXME: CURLOPT_PROTOCOLS is currently unsupported by HHVM
if (defined('CURLOPT_PROTOCOLS')) {
@@ -450,8 +458,6 @@ class Client extends EventEmitter
* * http_code - HTTP status code, as an int. Only set if Only set if
* status is STATUS_SUCCESS, or STATUS_HTTPERROR
*
- * @param array $headerLines
- * @param string $body
* @param resource $curlHandle
*/
protected function parseCurlResponse(array $headerLines, string $body, $curlHandle): array
diff --git a/htdocs/includes/sabre/sabre/http/lib/Message.php b/htdocs/includes/sabre/sabre/http/lib/Message.php
index fc34f8d7ff8..dc57ca9034e 100644
--- a/htdocs/includes/sabre/sabre/http/lib/Message.php
+++ b/htdocs/includes/sabre/sabre/http/lib/Message.php
@@ -88,7 +88,7 @@ abstract class Message implements MessageInterface
* @var string|int|null
*/
$contentLength = $this->getHeader('Content-Length');
- if (is_int($contentLength) || ctype_digit($contentLength)) {
+ if (null !== $contentLength && (is_int($contentLength) || ctype_digit($contentLength))) {
return stream_get_contents($body, (int) $contentLength);
}
@@ -96,7 +96,7 @@ abstract class Message implements MessageInterface
}
/**
- * Returns the message body, as it's internal representation.
+ * Returns the message body, as its internal representation.
*
* This could be either a string, a stream or a callback writing the body to php://output.
*
@@ -141,7 +141,7 @@ abstract class Message implements MessageInterface
}
/**
- * Returns a specific HTTP header, based on it's name.
+ * Returns a specific HTTP header, based on its name.
*
* The name must be treated as case-insensitive.
* If the header does not exist, this method must return null.
@@ -172,7 +172,7 @@ abstract class Message implements MessageInterface
* For every time the HTTP header appeared in the request or response, an
* item will appear in the array.
*
- * If the header did not exists, this method will return an empty array.
+ * If the header did not exist, this method will return an empty array.
*
* @return string[]
*/
@@ -283,8 +283,6 @@ abstract class Message implements MessageInterface
/**
* Returns the HTTP version.
- *
- * @return string
*/
public function getHttpVersion(): string
{
diff --git a/htdocs/includes/sabre/sabre/http/lib/MessageDecoratorTrait.php b/htdocs/includes/sabre/sabre/http/lib/MessageDecoratorTrait.php
index d5504ac7895..191ba0f745a 100644
--- a/htdocs/includes/sabre/sabre/http/lib/MessageDecoratorTrait.php
+++ b/htdocs/includes/sabre/sabre/http/lib/MessageDecoratorTrait.php
@@ -51,7 +51,7 @@ trait MessageDecoratorTrait
}
/**
- * Returns the message body, as it's internal representation.
+ * Returns the message body, as its internal representation.
*
* This could be either a string or a stream.
*
@@ -91,7 +91,7 @@ trait MessageDecoratorTrait
}
/**
- * Returns a specific HTTP header, based on it's name.
+ * Returns a specific HTTP header, based on its name.
*
* The name must be treated as case-insensitive.
* If the header does not exist, this method must return null.
@@ -116,7 +116,7 @@ trait MessageDecoratorTrait
* For every time the HTTP header appeared in the request or response, an
* item will appear in the array.
*
- * If the header did not exists, this method will return an empty array.
+ * If the header did not exist, this method will return an empty array.
*/
public function getHeaderAsArray(string $name): array
{
@@ -180,8 +180,6 @@ trait MessageDecoratorTrait
* The specified header name must be treated as case-insensitive.
* This method should return true if the header was successfully deleted,
* and false if the header did not exist.
- *
- * @return bool
*/
public function removeHeader(string $name): bool
{
diff --git a/htdocs/includes/sabre/sabre/http/lib/MessageInterface.php b/htdocs/includes/sabre/sabre/http/lib/MessageInterface.php
index 8070845d995..4531654bc86 100644
--- a/htdocs/includes/sabre/sabre/http/lib/MessageInterface.php
+++ b/htdocs/includes/sabre/sabre/http/lib/MessageInterface.php
@@ -29,13 +29,11 @@ interface MessageInterface
*
* Note that because the underlying data may be based on a stream, this
* method could only work correctly the first time.
- *
- * @return string
*/
public function getBodyAsString(): string;
/**
- * Returns the message body, as it's internal representation.
+ * Returns the message body, as its internal representation.
*
* This could be either a string, a stream or a callback writing the body to php://output
*
@@ -63,7 +61,7 @@ interface MessageInterface
public function hasHeader(string $name): bool;
/**
- * Returns a specific HTTP header, based on it's name.
+ * Returns a specific HTTP header, based on its name.
*
* The name must be treated as case-insensitive.
* If the header does not exist, this method must return null.
@@ -85,7 +83,7 @@ interface MessageInterface
* For every time the HTTP header appeared in the request or response, an
* item will appear in the array.
*
- * If the header did not exists, this method will return an empty array.
+ * If the header did not exist, this method will return an empty array.
*
* @return string[]
*/
@@ -94,7 +92,7 @@ interface MessageInterface
/**
* Updates a HTTP header.
*
- * The case-sensitity of the name value must be retained as-is.
+ * The case-sensitivity of the name value must be retained as-is.
*
* If the header already existed, it will be overwritten.
*
@@ -133,7 +131,7 @@ interface MessageInterface
/**
* Removes a HTTP header.
*
- * The specified header name must be treated as case-insenstive.
+ * The specified header name must be treated as case-insensitive.
* This method should return true if the header was successfully deleted,
* and false if the header did not exist.
*/
diff --git a/htdocs/includes/sabre/sabre/http/lib/Request.php b/htdocs/includes/sabre/sabre/http/lib/Request.php
index 496629a5b1e..b8395ff45c5 100644
--- a/htdocs/includes/sabre/sabre/http/lib/Request.php
+++ b/htdocs/includes/sabre/sabre/http/lib/Request.php
@@ -155,7 +155,7 @@ class Request extends Message implements RequestInterface
* If the full path is equal to the base url, this method will return an
* empty string.
*
- * This method will also urldecode the path, and if the url was incoded as
+ * This method will also urldecode the path, and if the url was encoded as
* ISO-8859-1, it will convert it to UTF-8.
*
* If the path is outside of the base url, a LogicException will be thrown.
diff --git a/htdocs/includes/sabre/sabre/http/lib/RequestDecorator.php b/htdocs/includes/sabre/sabre/http/lib/RequestDecorator.php
index 0ad24925f4e..23e790e7d3b 100644
--- a/htdocs/includes/sabre/sabre/http/lib/RequestDecorator.php
+++ b/htdocs/includes/sabre/sabre/http/lib/RequestDecorator.php
@@ -104,7 +104,7 @@ class RequestDecorator implements RequestInterface
* If the full path is equal to the base url, this method will return an
* empty string.
*
- * This method will also urldecode the path, and if the url was incoded as
+ * This method will also urldecode the path, and if the url was encoded as
* ISO-8859-1, it will convert it to UTF-8.
*
* If the path is outside of the base url, a LogicException will be thrown.
diff --git a/htdocs/includes/sabre/sabre/http/lib/RequestInterface.php b/htdocs/includes/sabre/sabre/http/lib/RequestInterface.php
index 83fa85bdc39..5ec7777c67e 100644
--- a/htdocs/includes/sabre/sabre/http/lib/RequestInterface.php
+++ b/htdocs/includes/sabre/sabre/http/lib/RequestInterface.php
@@ -67,7 +67,7 @@ interface RequestInterface extends MessageInterface
* If the full path is equal to the base url, this method will return an
* empty string.
*
- * This method will also urldecode the path, and if the url was incoded as
+ * This method will also urldecode the path, and if the url was encoded as
* ISO-8859-1, it will convert it to UTF-8.
*
* If the path is outside of the base url, a LogicException will be thrown.
diff --git a/htdocs/includes/sabre/sabre/http/lib/Response.php b/htdocs/includes/sabre/sabre/http/lib/Response.php
index 64dfbc0b2ec..c06c9637ea1 100644
--- a/htdocs/includes/sabre/sabre/http/lib/Response.php
+++ b/htdocs/includes/sabre/sabre/http/lib/Response.php
@@ -25,7 +25,7 @@ class Response extends Message implements ResponseInterface
200 => 'OK',
201 => 'Created',
202 => 'Accepted',
- 203 => 'Non-Authorative Information',
+ 203 => 'Non-Authoritative Information',
204 => 'No Content',
205 => 'Reset Content',
206 => 'Partial Content',
@@ -137,7 +137,7 @@ class Response extends Message implements ResponseInterface
/**
* Sets the HTTP status code.
*
- * This can be either the full HTTP status code with human readable string,
+ * This can be either the full HTTP status code with human-readable string,
* for example: "403 I can't let you do that, Dave".
*
* Or just the code, in which case the appropriate default message will be
@@ -149,7 +149,7 @@ class Response extends Message implements ResponseInterface
*/
public function setStatus($status)
{
- if (ctype_digit($status) || is_int($status)) {
+ if (is_int($status) || ctype_digit($status)) {
$statusCode = $status;
$statusText = self::$statusCodes[$status] ?? 'Unknown';
} else {
diff --git a/htdocs/includes/sabre/sabre/http/lib/ResponseDecorator.php b/htdocs/includes/sabre/sabre/http/lib/ResponseDecorator.php
index 289dba5cc59..30b9ec0e58c 100644
--- a/htdocs/includes/sabre/sabre/http/lib/ResponseDecorator.php
+++ b/htdocs/includes/sabre/sabre/http/lib/ResponseDecorator.php
@@ -47,7 +47,7 @@ class ResponseDecorator implements ResponseInterface
/**
* Sets the HTTP status code.
*
- * This can be either the full HTTP status code with human readable string,
+ * This can be either the full HTTP status code with human-readable string,
* for example: "403 I can't let you do that, Dave".
*
* Or just the code, in which case the appropriate default message will be
@@ -64,8 +64,6 @@ class ResponseDecorator implements ResponseInterface
* Serializes the request object as a string.
*
* This is useful for debugging purposes.
- *
- * @return string
*/
public function __toString(): string
{
diff --git a/htdocs/includes/sabre/sabre/http/lib/ResponseInterface.php b/htdocs/includes/sabre/sabre/http/lib/ResponseInterface.php
index 9bd93f179ad..fd73d25cdd2 100644
--- a/htdocs/includes/sabre/sabre/http/lib/ResponseInterface.php
+++ b/htdocs/includes/sabre/sabre/http/lib/ResponseInterface.php
@@ -28,7 +28,7 @@ interface ResponseInterface extends MessageInterface
/**
* Sets the HTTP status code.
*
- * This can be either the full HTTP status code with human readable string,
+ * This can be either the full HTTP status code with human-readable string,
* for example: "403 I can't let you do that, Dave".
*
* Or just the code, in which case the appropriate default message will be
diff --git a/htdocs/includes/sabre/sabre/http/lib/Sapi.php b/htdocs/includes/sabre/sabre/http/lib/Sapi.php
index 73674a5a131..55a4c46e7e3 100644
--- a/htdocs/includes/sabre/sabre/http/lib/Sapi.php
+++ b/htdocs/includes/sabre/sabre/http/lib/Sapi.php
@@ -26,7 +26,7 @@ use InvalidArgumentException;
* * php://output
*
* You can choose to either call all these methods statically, but you can also
- * instantiate this as an object to allow for polymorhpism.
+ * instantiate this as an object to allow for polymorphism.
*
* @copyright Copyright (C) fruux GmbH (https://fruux.com/)
* @author Evert Pot (http://evertpot.com/)
@@ -89,41 +89,39 @@ class Sapi
if (null !== $contentLength) {
$output = fopen('php://output', 'wb');
if (is_resource($body) && 'stream' == get_resource_type($body)) {
- if (PHP_INT_SIZE > 4) {
- // use the dedicated function on 64 Bit systems
- // a workaround to make PHP more possible to use mmap based copy, see https://github.com/sabre-io/http/pull/119
- $left = (int) $contentLength;
- // copy with 4MiB chunks
- $chunk_size = 4 * 1024 * 1024;
- stream_set_chunk_size($output, $chunk_size);
- // If this is a partial response, flush the beginning bytes until the first position that is a multiple of the page size.
- $contentRange = $response->getHeader('Content-Range');
- // Matching "Content-Range: bytes 1234-5678/7890"
- if (null !== $contentRange && preg_match('/^bytes\s([0-9]+)-([0-9]+)\//i', $contentRange, $matches)) {
- // 4kB should be the default page size on most architectures
- $pageSize = 4096;
- $offset = (int) $matches[1];
- $delta = ($offset % $pageSize) > 0 ? ($pageSize - $offset % $pageSize) : 0;
- if ($delta > 0) {
- $left -= stream_copy_to_stream($body, $output, min($delta, $left));
- }
+ // a workaround to make PHP more possible to use mmap based copy, see https://github.com/sabre-io/http/pull/119
+ $left = (int) $contentLength;
+ // copy with 4MiB chunks
+ $chunk_size = 4 * 1024 * 1024;
+ stream_set_chunk_size($output, $chunk_size);
+ // If this is a partial response, flush the beginning bytes until the first position that is a multiple of the page size.
+ $contentRange = $response->getHeader('Content-Range');
+ // Matching "Content-Range: bytes 1234-5678/7890"
+ if (null !== $contentRange && preg_match('/^bytes\s([0-9]+)-([0-9]+)\//i', $contentRange, $matches)) {
+ // 4kB should be the default page size on most architectures
+ $pageSize = 4096;
+ $offset = (int) $matches[1];
+ $delta = ($offset % $pageSize) > 0 ? ($pageSize - $offset % $pageSize) : 0;
+ if ($delta > 0) {
+ $left -= stream_copy_to_stream($body, $output, min($delta, $left));
}
- while ($left > 0) {
- $copied = stream_copy_to_stream($body, $output, min($left, $chunk_size));
- // stream_copy_to_stream($src, $dest, $maxLength) must return the number of bytes copied or false in case of failure
- // But when the $maxLength is greater than the total number of bytes remaining in the stream,
- // It returns the negative number of bytes copied
- // So break the loop in such cases.
- if ($copied <= 0) {
- break;
- }
- $left -= $copied;
+ }
+ while ($left > 0) {
+ $copied = stream_copy_to_stream($body, $output, min($left, $chunk_size));
+ // stream_copy_to_stream($src, $dest, $maxLength) must return the number of bytes copied or false in case of failure
+ // But when the $maxLength is greater than the total number of bytes remaining in the stream,
+ // It returns the negative number of bytes copied
+ // So break the loop in such cases.
+ if ($copied <= 0) {
+ break;
}
- } else {
- // workaround for 32 Bit systems to avoid stream_copy_to_stream
- while (!feof($body)) {
- fwrite($output, fread($body, 8192));
+ // Abort on client disconnect.
+ // With ignore_user_abort(true), the script is not aborted on client disconnect.
+ // To avoid reading the entire stream and dismissing the data afterward, check between the chunks if the client is still there.
+ if (1 === ignore_user_abort() && 1 === connection_aborted()) {
+ break;
}
+ $left -= $copied;
}
} else {
fwrite($output, $body, (int) $contentLength);
@@ -154,6 +152,7 @@ class Sapi
$hostName = 'localhost';
foreach ($serverArray as $key => $value) {
+ $key = (string) $key;
switch ($key) {
case 'SERVER_PROTOCOL':
if ('HTTP/1.0' === $value) {
@@ -214,7 +213,7 @@ class Sapi
// Normalizing it to be prettier
$header = strtolower(substr($key, 5));
- // Transforming dashes into spaces, and uppercasing
+ // Transforming dashes into spaces, and upper-casing
// every first letter.
$header = ucwords(str_replace('_', ' ', $header));
diff --git a/htdocs/includes/sabre/sabre/http/lib/Version.php b/htdocs/includes/sabre/sabre/http/lib/Version.php
index 655753acfc4..93c64797bc6 100644
--- a/htdocs/includes/sabre/sabre/http/lib/Version.php
+++ b/htdocs/includes/sabre/sabre/http/lib/Version.php
@@ -16,5 +16,5 @@ class Version
/**
* Full version number.
*/
- const VERSION = '5.0.5';
+ const VERSION = '5.1.10';
}
diff --git a/htdocs/includes/sabre/sabre/http/lib/functions.php b/htdocs/includes/sabre/sabre/http/lib/functions.php
index 728bbc13240..d0477d9434b 100644
--- a/htdocs/includes/sabre/sabre/http/lib/functions.php
+++ b/htdocs/includes/sabre/sabre/http/lib/functions.php
@@ -29,8 +29,6 @@ use InvalidArgumentException;
* See:
* http://tools.ietf.org/html/rfc7231#section-7.1.1.1
*
- * @param string $dateString
- *
* @return bool|DateTime
*/
function parseDate(string $dateString)
@@ -75,10 +73,6 @@ function parseDate(string $dateString)
/**
* Transforms a DateTime object to a valid HTTP/1.1 Date header value.
- *
- * @param DateTime $dateTime
- *
- * @return string
*/
function toDate(DateTime $dateTime): string
{
@@ -107,7 +101,6 @@ function toDate(DateTime $dateTime): string
* implying that no accept header was sent.
*
* @param string|null $acceptHeaderValue
- * @param array $availableOptions
*
* @return string|null
*/
@@ -218,8 +211,6 @@ function negotiateContentType($acceptHeaderValue, array $availableOptions)
* uses them.
*
* @param string|string[] $input
- *
- * @return array
*/
function parsePrefer($input): array
{
@@ -303,7 +294,7 @@ function getHeaderValues($values, $values2 = null): array
$values = array_merge($values, (array) $values2);
}
- $result = array();
+ $result = [];
foreach ($values as $l1) {
foreach (explode(',', $l1) as $l2) {
$result[] = trim($l2);
@@ -320,10 +311,6 @@ function getHeaderValues($values, $values2 = null): array
* 2. subtype
* 3. quality
* 4. parameters
- *
- * @param string $str
- *
- * @return array
*/
function parseMimeType(string $str): array
{
@@ -344,8 +331,8 @@ function parseMimeType(string $str): array
if (2 !== count($mimeType)) {
// Illegal value
var_dump($mimeType);
- die();
- throw new InvalidArgumentException('Not a valid mime-type: '.$str);
+ exit();
+ // throw new InvalidArgumentException('Not a valid mime-type: '.$str);
}
list($type, $subType) = $mimeType;
@@ -362,7 +349,7 @@ function parseMimeType(string $str): array
// The quality parameter, if it appears, also marks the end of
// the parameter list. Anything after the q= counts as an
// 'accept extension' and could introduce new semantics in
- // content-negotation.
+ // content-negotiation.
if ('q' !== $partName) {
$parameters[$partName] = $part;
} else {
@@ -417,11 +404,9 @@ function decodePath(string $path): string
function decodePathSegment(string $path): string
{
$path = rawurldecode($path);
- $encoding = mb_detect_encoding($path, ['UTF-8', 'ISO-8859-1']);
- switch ($encoding) {
- case 'ISO-8859-1':
- $path = mb_convert_encoding($path, 'UTF-8', 'ISO-8859-1');
+ if (!mb_check_encoding($path, 'UTF-8') && mb_check_encoding($path, 'ISO-8859-1')) {
+ $path = mb_convert_encoding($path, 'UTF-8', 'ISO-8859-1');
}
return $path;
diff --git a/htdocs/includes/sabre/sabre/http/phpstan.neon b/htdocs/includes/sabre/sabre/http/phpstan.neon
index 241663a7271..213da6dad2a 100644
--- a/htdocs/includes/sabre/sabre/http/phpstan.neon
+++ b/htdocs/includes/sabre/sabre/http/phpstan.neon
@@ -1,3 +1,2 @@
parameters:
level: 1
- bootstrap: %currentWorkingDirectory%/vendor/autoload.php
diff --git a/htdocs/includes/sabre/sabre/uri/lib/Version.php b/htdocs/includes/sabre/sabre/uri/lib/Version.php
index 04aa30f154a..4f05b2adef7 100644
--- a/htdocs/includes/sabre/sabre/uri/lib/Version.php
+++ b/htdocs/includes/sabre/sabre/uri/lib/Version.php
@@ -16,5 +16,5 @@ class Version
/**
* Full version number.
*/
- const VERSION = '2.2.3';
+ const VERSION = '2.2.4';
}
diff --git a/htdocs/includes/sabre/sabre/uri/lib/functions.php b/htdocs/includes/sabre/sabre/uri/lib/functions.php
index cf30136b767..fd656832bb4 100644
--- a/htdocs/includes/sabre/sabre/uri/lib/functions.php
+++ b/htdocs/includes/sabre/sabre/uri/lib/functions.php
@@ -196,19 +196,6 @@ function parse(string $uri): array
$result = parse_url($uri);
if (!$result) {
$result = _parse_fallback($uri);
- } else {
- // Add empty host and trailing slash to Windows file paths
- // file:///C:/path or file:///C:\path
- // Note: the regex fragment [a-zA-Z]:[\/\\\\].* end up being
- // [a-zA-Z]:[\/\\].*
- // The 4 backslash in a row are the way to get 2 backslash into the actual string
- // that is used as the regex. The 2 backslash are then the way to get 1 backslash
- // character into the character set "a forward slash or a backslash"
- if (isset($result['scheme']) && 'file' === $result['scheme'] && isset($result['path']) &&
- preg_match('/^(? [a-zA-Z]:([\/\\\\].*)?)$/x', $result['path'])) {
- $result['path'] = '/'.$result['path'];
- $result['host'] = '';
- }
}
return
diff --git a/htdocs/includes/sabre/sabre/vobject/composer.json b/htdocs/includes/sabre/sabre/vobject/composer.json
index b745b1fa6a9..b08684bce8b 100644
--- a/htdocs/includes/sabre/sabre/vobject/composer.json
+++ b/htdocs/includes/sabre/sabre/vobject/composer.json
@@ -34,7 +34,7 @@
"require" : {
"php" : "^7.1 || ^8.0",
"ext-mbstring" : "*",
- "sabre/xml" : "^2.1"
+ "sabre/xml" : "^2.1 || ^3.0 || ^4.0"
},
"require-dev" : {
"friendsofphp/php-cs-fixer": "~2.17.1",
diff --git a/htdocs/includes/sabre/sabre/vobject/lib/Component.php b/htdocs/includes/sabre/sabre/vobject/lib/Component.php
index a929387a3ce..ca82ad49bcb 100644
--- a/htdocs/includes/sabre/sabre/vobject/lib/Component.php
+++ b/htdocs/includes/sabre/sabre/vobject/lib/Component.php
@@ -368,7 +368,7 @@ class Component extends Node
*
* @param Xml\Writer $writer XML writer
*/
- public function xmlSerialize(Xml\Writer $writer)
+ public function xmlSerialize(Xml\Writer $writer): void
{
$components = [];
$properties = [];
diff --git a/htdocs/includes/sabre/sabre/vobject/lib/Component/VCard.php b/htdocs/includes/sabre/sabre/vobject/lib/Component/VCard.php
index 90a6df72f76..82fab82bb28 100644
--- a/htdocs/includes/sabre/sabre/vobject/lib/Component/VCard.php
+++ b/htdocs/includes/sabre/sabre/vobject/lib/Component/VCard.php
@@ -473,7 +473,7 @@ class VCard extends VObject\Document
*
* @param Xml\Writer $writer XML writer
*/
- public function xmlSerialize(Xml\Writer $writer)
+ public function xmlSerialize(Xml\Writer $writer): void
{
$propertiesByGroup = [];
diff --git a/htdocs/includes/sabre/sabre/vobject/lib/DateTimeParser.php b/htdocs/includes/sabre/sabre/vobject/lib/DateTimeParser.php
index 1c253437abd..c5dbac97d3a 100644
--- a/htdocs/includes/sabre/sabre/vobject/lib/DateTimeParser.php
+++ b/htdocs/includes/sabre/sabre/vobject/lib/DateTimeParser.php
@@ -104,7 +104,7 @@ class DateTimeParser
if (!$asString) {
$invert = false;
- if ('-' === $matches['plusminus']) {
+ if (isset($matches['plusminus']) && '-' === $matches['plusminus']) {
$invert = true;
}
diff --git a/htdocs/includes/sabre/sabre/vobject/lib/ITip/Broker.php b/htdocs/includes/sabre/sabre/vobject/lib/ITip/Broker.php
index b66a59f545f..80d9a5b3162 100644
--- a/htdocs/includes/sabre/sabre/vobject/lib/ITip/Broker.php
+++ b/htdocs/includes/sabre/sabre/vobject/lib/ITip/Broker.php
@@ -156,9 +156,9 @@ class Broker
* people. If the user was an attendee, we need to make sure that the
* organizer gets the 'declined' message.
*
- * @param VCalendar|string $calendar
- * @param string|array $userHref
- * @param VCalendar|string $oldCalendar
+ * @param VCalendar|string $calendar
+ * @param string|array $userHref
+ * @param VCalendar|string|null $oldCalendar
*
* @return array
*/
diff --git a/htdocs/includes/sabre/sabre/vobject/lib/Node.php b/htdocs/includes/sabre/sabre/vobject/lib/Node.php
index 2041b2ac7b9..852ffced05a 100644
--- a/htdocs/includes/sabre/sabre/vobject/lib/Node.php
+++ b/htdocs/includes/sabre/sabre/vobject/lib/Node.php
@@ -82,7 +82,7 @@ abstract class Node implements \IteratorAggregate, \ArrayAccess, \Countable, \Js
*
* @param Xml\Writer $writer XML writer
*/
- abstract public function xmlSerialize(Xml\Writer $writer);
+ abstract public function xmlSerialize(Xml\Writer $writer): void;
/**
* Call this method on a document if you're done using it.
diff --git a/htdocs/includes/sabre/sabre/vobject/lib/Parameter.php b/htdocs/includes/sabre/sabre/vobject/lib/Parameter.php
index c27b2aa47cb..0f0b5860cde 100644
--- a/htdocs/includes/sabre/sabre/vobject/lib/Parameter.php
+++ b/htdocs/includes/sabre/sabre/vobject/lib/Parameter.php
@@ -334,7 +334,7 @@ class Parameter extends Node
*
* @param Xml\Writer $writer XML writer
*/
- public function xmlSerialize(Xml\Writer $writer)
+ public function xmlSerialize(Xml\Writer $writer): void
{
foreach (explode(',', $this->value) as $value) {
$writer->writeElement('text', $value);
diff --git a/htdocs/includes/sabre/sabre/vobject/lib/Parser/XML/Element/KeyValue.php b/htdocs/includes/sabre/sabre/vobject/lib/Parser/XML/Element/KeyValue.php
index c0bbf0d9b34..e01772510b6 100644
--- a/htdocs/includes/sabre/sabre/vobject/lib/Parser/XML/Element/KeyValue.php
+++ b/htdocs/includes/sabre/sabre/vobject/lib/Parser/XML/Element/KeyValue.php
@@ -34,10 +34,8 @@ class KeyValue extends SabreXml\Element\KeyValue
* the next element.
*
* @param XML\Reader $reader
- *
- * @return mixed
*/
- public static function xmlDeserialize(SabreXml\Reader $reader)
+ public static function xmlDeserialize(SabreXml\Reader $reader): array
{
// If there's no children, we don't do anything.
if ($reader->isEmptyElement) {
diff --git a/htdocs/includes/sabre/sabre/vobject/lib/Property.php b/htdocs/includes/sabre/sabre/vobject/lib/Property.php
index 56096dafea6..f6550246a7a 100644
--- a/htdocs/includes/sabre/sabre/vobject/lib/Property.php
+++ b/htdocs/includes/sabre/sabre/vobject/lib/Property.php
@@ -318,7 +318,7 @@ abstract class Property extends Node
*
* @param Xml\Writer $writer XML writer
*/
- public function xmlSerialize(Xml\Writer $writer)
+ public function xmlSerialize(Xml\Writer $writer): void
{
$parameters = [];
diff --git a/htdocs/includes/sabre/sabre/vobject/lib/Version.php b/htdocs/includes/sabre/sabre/vobject/lib/Version.php
index 92882f2f1e2..c7ca69e14a4 100644
--- a/htdocs/includes/sabre/sabre/vobject/lib/Version.php
+++ b/htdocs/includes/sabre/sabre/vobject/lib/Version.php
@@ -14,5 +14,5 @@ class Version
/**
* Full version number.
*/
- const VERSION = '4.5.1';
+ public const VERSION = '4.5.4';
}
diff --git a/htdocs/includes/sabre/sabre/vobject/lib/timezonedata/exchangezones.php b/htdocs/includes/sabre/sabre/vobject/lib/timezonedata/exchangezones.php
index debbf438ce1..89bddc27c5b 100644
--- a/htdocs/includes/sabre/sabre/vobject/lib/timezonedata/exchangezones.php
+++ b/htdocs/includes/sabre/sabre/vobject/lib/timezonedata/exchangezones.php
@@ -71,7 +71,7 @@ return [
'Mid-Atlantic' => 'America/Noronha',
'Brasilia' => 'America/Sao_Paulo', // Best guess
'Buenos Aires' => 'America/Argentina/Buenos_Aires',
- 'Greenland' => 'America/Nuuk',
+ 'Greenland' => 'America/Godthab',
'Newfoundland' => 'America/St_Johns',
'Atlantic Time (Canada)' => 'America/Halifax',
'Caracas, La Paz' => 'America/Caracas',
diff --git a/htdocs/includes/sabre/sabre/vobject/lib/timezonedata/lotuszones.php b/htdocs/includes/sabre/sabre/vobject/lib/timezonedata/lotuszones.php
index 9740f6aa8d7..4b50808f908 100644
--- a/htdocs/includes/sabre/sabre/vobject/lib/timezonedata/lotuszones.php
+++ b/htdocs/includes/sabre/sabre/vobject/lib/timezonedata/lotuszones.php
@@ -34,7 +34,7 @@ return [
'Newfoundland' => 'America/St_Johns',
'Argentina' => 'America/Argentina/Buenos_Aires',
'E. South America' => 'America/Belem',
- 'Greenland' => 'America/Nuuk',
+ 'Greenland' => 'America/Godthab',
'Montevideo' => 'America/Montevideo',
'SA Eastern' => 'America/Belem',
// 'Mid-Atlantic' => 'Etc/GMT-2', // conflict with windows timezones.
diff --git a/htdocs/includes/sabre/sabre/vobject/lib/timezonedata/php-bc.php b/htdocs/includes/sabre/sabre/vobject/lib/timezonedata/php-bc.php
index ea2366cf66c..3116c6868e6 100644
--- a/htdocs/includes/sabre/sabre/vobject/lib/timezonedata/php-bc.php
+++ b/htdocs/includes/sabre/sabre/vobject/lib/timezonedata/php-bc.php
@@ -16,319 +16,67 @@
* @license http://sabre.io/license/ Modified BSD License
*/
return [
- 'Africa/Abidjan',
- 'Africa/Accra',
- 'Africa/Addis_Ababa',
- 'Africa/Algiers',
- 'Africa/Asmara',
- 'Africa/Bamako',
- 'Africa/Bangui',
- 'Africa/Banjul',
- 'Africa/Bissau',
- 'Africa/Blantyre',
- 'Africa/Brazzaville',
- 'Africa/Bujumbura',
- 'Africa/Cairo',
- 'Africa/Casablanca',
- 'Africa/Ceuta',
- 'Africa/Conakry',
- 'Africa/Dakar',
- 'Africa/Dar_es_Salaam',
- 'Africa/Djibouti',
- 'Africa/Douala',
- 'Africa/El_Aaiun',
- 'Africa/Freetown',
- 'Africa/Gaborone',
- 'Africa/Harare',
- 'Africa/Johannesburg',
- 'Africa/Juba',
- 'Africa/Kampala',
- 'Africa/Khartoum',
- 'Africa/Kigali',
- 'Africa/Kinshasa',
- 'Africa/Lagos',
- 'Africa/Libreville',
- 'Africa/Lome',
- 'Africa/Luanda',
- 'Africa/Lubumbashi',
- 'Africa/Lusaka',
- 'Africa/Malabo',
- 'Africa/Maputo',
- 'Africa/Maseru',
- 'Africa/Mbabane',
- 'Africa/Mogadishu',
- 'Africa/Monrovia',
- 'Africa/Nairobi',
- 'Africa/Ndjamena',
- 'Africa/Niamey',
- 'Africa/Nouakchott',
- 'Africa/Ouagadougou',
- 'Africa/Porto-Novo',
- 'Africa/Sao_Tome',
- 'Africa/Tripoli',
- 'Africa/Tunis',
- 'Africa/Windhoek',
- 'America/Adak',
- 'America/Anchorage',
- 'America/Anguilla',
- 'America/Antigua',
- 'America/Araguaina',
- 'America/Argentina/Buenos_Aires',
- 'America/Argentina/Catamarca',
- 'America/Argentina/Cordoba',
- 'America/Argentina/Jujuy',
- 'America/Argentina/La_Rioja',
- 'America/Argentina/Mendoza',
- 'America/Argentina/Rio_Gallegos',
- 'America/Argentina/Salta',
- 'America/Argentina/San_Juan',
- 'America/Argentina/San_Luis',
- 'America/Argentina/Tucuman',
- 'America/Argentina/Ushuaia',
- 'America/Aruba',
- 'America/Asuncion',
- 'America/Atikokan',
- 'America/Bahia',
- 'America/Bahia_Banderas',
- 'America/Barbados',
- 'America/Belem',
- 'America/Belize',
- 'America/Blanc-Sablon',
- 'America/Boa_Vista',
- 'America/Bogota',
- 'America/Boise',
- 'America/Cambridge_Bay',
- 'America/Campo_Grande',
- 'America/Cancun',
- 'America/Caracas',
- 'America/Cayenne',
- 'America/Cayman',
- 'America/Chicago',
- 'America/Chihuahua',
- 'America/Ciudad_Juarez',
- 'America/Costa_Rica',
- 'America/Creston',
- 'America/Cuiaba',
- 'America/Curacao',
- 'America/Danmarkshavn',
- 'America/Dawson',
- 'America/Dawson_Creek',
- 'America/Denver',
- 'America/Detroit',
- 'America/Dominica',
- 'America/Edmonton',
- 'America/Eirunepe',
- 'America/El_Salvador',
- 'America/Fort_Nelson',
- 'America/Fortaleza',
- 'America/Glace_Bay',
- 'America/Goose_Bay',
- 'America/Grand_Turk',
- 'America/Grenada',
- 'America/Guadeloupe',
- 'America/Guatemala',
- 'America/Guayaquil',
- 'America/Guyana',
- 'America/Halifax',
- 'America/Havana',
- 'America/Hermosillo',
- 'America/Indiana/Indianapolis',
- 'America/Indiana/Knox',
- 'America/Indiana/Marengo',
- 'America/Indiana/Petersburg',
- 'America/Indiana/Tell_City',
- 'America/Indiana/Vevay',
- 'America/Indiana/Vincennes',
- 'America/Indiana/Winamac',
- 'America/Inuvik',
- 'America/Iqaluit',
- 'America/Jamaica',
- 'America/Juneau',
- 'America/Kentucky/Louisville',
- 'America/Kentucky/Monticello',
- 'America/Kralendijk',
- 'America/La_Paz',
- 'America/Lima',
- 'America/Los_Angeles',
- 'America/Lower_Princes',
- 'America/Maceio',
- 'America/Managua',
- 'America/Manaus',
- 'America/Marigot',
- 'America/Martinique',
- 'America/Matamoros',
- 'America/Mazatlan',
- 'America/Menominee',
- 'America/Merida',
- 'America/Metlakatla',
- 'America/Mexico_City',
- 'America/Miquelon',
- 'America/Moncton',
- 'America/Monterrey',
- 'America/Montevideo',
- 'America/Montserrat',
- 'America/Nassau',
- 'America/New_York',
- 'America/Nome',
- 'America/Noronha',
- 'America/North_Dakota/Beulah',
- 'America/North_Dakota/Center',
- 'America/North_Dakota/New_Salem',
- 'America/Nuuk',
- 'America/Ojinaga',
- 'America/Panama',
- 'America/Paramaribo',
- 'America/Phoenix',
- 'America/Port-au-Prince',
- 'America/Port_of_Spain',
- 'America/Porto_Velho',
- 'America/Puerto_Rico',
- 'America/Punta_Arenas',
- 'America/Rankin_Inlet',
- 'America/Recife',
- 'America/Regina',
- 'America/Resolute',
- 'America/Rio_Branco',
- 'America/Santarem',
- 'America/Santiago',
- 'America/Santo_Domingo',
- 'America/Sao_Paulo',
- 'America/Scoresbysund',
- 'America/Sitka',
- 'America/St_Barthelemy',
- 'America/St_Johns',
- 'America/St_Kitts',
- 'America/St_Lucia',
- 'America/St_Thomas',
- 'America/St_Vincent',
- 'America/Swift_Current',
- 'America/Tegucigalpa',
- 'America/Thule',
- 'America/Tijuana',
- 'America/Toronto',
- 'America/Tortola',
- 'America/Vancouver',
- 'America/Whitehorse',
- 'America/Winnipeg',
- 'America/Yakutat',
- 'Antarctica/Casey',
- 'Antarctica/Davis',
- 'Antarctica/DumontDUrville',
- 'Antarctica/Macquarie',
- 'Antarctica/Mawson',
- 'Antarctica/McMurdo',
- 'Antarctica/Palmer',
- 'Antarctica/Rothera',
- 'Antarctica/Syowa',
- 'Antarctica/Troll',
- 'Antarctica/Vostok',
- 'Arctic/Longyearbyen',
- 'Asia/Aden',
- 'Asia/Almaty',
- 'Asia/Amman',
- 'Asia/Anadyr',
- 'Asia/Aqtau',
- 'Asia/Aqtobe',
- 'Asia/Ashgabat',
- 'Asia/Atyrau',
- 'Asia/Baghdad',
- 'Asia/Bahrain',
- 'Asia/Baku',
- 'Asia/Bangkok',
- 'Asia/Barnaul',
- 'Asia/Beirut',
- 'Asia/Bishkek',
- 'Asia/Brunei',
+ 'Africa/Asmera',
+ 'Africa/Timbuktu',
+ 'America/Argentina/ComodRivadavia',
+ 'America/Atka',
+ 'America/Buenos_Aires',
+ 'America/Catamarca',
+ 'America/Coral_Harbour',
+ 'America/Cordoba',
+ 'America/Ensenada',
+ 'America/Fort_Wayne',
+ 'America/Indianapolis',
+ 'America/Jujuy',
+ 'America/Knox_IN',
+ 'America/Louisville',
+ 'America/Mendoza',
+ 'America/Montreal',
+ 'America/Porto_Acre',
+ 'America/Rosario',
+ 'America/Shiprock',
+ 'America/Virgin',
+ 'Antarctica/South_Pole',
+ 'Asia/Ashkhabad',
'Asia/Calcutta',
- 'Asia/Chita',
- 'Asia/Choibalsan',
- 'Asia/Colombo',
- 'Asia/Damascus',
- 'Asia/Dhaka',
- 'Asia/Dili',
- 'Asia/Dubai',
- 'Asia/Dushanbe',
- 'Asia/Famagusta',
- 'Asia/Gaza',
- 'Asia/Hebron',
- 'Asia/Ho_Chi_Minh',
- 'Asia/Hong_Kong',
- 'Asia/Hovd',
- 'Asia/Irkutsk',
- 'Asia/Jakarta',
- 'Asia/Jayapura',
- 'Asia/Jerusalem',
- 'Asia/Kabul',
- 'Asia/Kamchatka',
- 'Asia/Karachi',
- 'Asia/Kathmandu',
+ 'Asia/Chungking',
+ 'Asia/Dacca',
+ 'Asia/Istanbul',
'Asia/Katmandu',
- 'Asia/Khandyga',
- 'Asia/Kolkata',
- 'Asia/Krasnoyarsk',
- 'Asia/Kuala_Lumpur',
- 'Asia/Kuching',
- 'Asia/Kuwait',
- 'Asia/Macau',
- 'Asia/Magadan',
- 'Asia/Makassar',
- 'Asia/Manila',
- 'Asia/Muscat',
- 'Asia/Nicosia',
- 'Asia/Novokuznetsk',
- 'Asia/Novosibirsk',
- 'Asia/Omsk',
- 'Asia/Oral',
- 'Asia/Phnom_Penh',
- 'Asia/Pontianak',
- 'Asia/Pyongyang',
- 'Asia/Qatar',
- 'Asia/Qostanay',
- 'Asia/Qyzylorda',
- 'Asia/Riyadh',
- 'Asia/Sakhalin',
- 'Asia/Samarkand',
- 'Asia/Seoul',
- 'Asia/Shanghai',
- 'Asia/Singapore',
- 'Asia/Srednekolymsk',
- 'Asia/Taipei',
- 'Asia/Tashkent',
- 'Asia/Tbilisi',
- 'Asia/Tehran',
- 'Asia/Thimphu',
- 'Asia/Tokyo',
- 'Asia/Tomsk',
- 'Asia/Ulaanbaatar',
- 'Asia/Urumqi',
- 'Asia/Ust-Nera',
- 'Asia/Vientiane',
- 'Asia/Vladivostok',
- 'Asia/Yakutsk',
- 'Asia/Yangon',
- 'Asia/Yekaterinburg',
- 'Asia/Yerevan',
- 'Atlantic/Azores',
- 'Atlantic/Bermuda',
- 'Atlantic/Canary',
- 'Atlantic/Cape_Verde',
- 'Atlantic/Faroe',
- 'Atlantic/Madeira',
- 'Atlantic/Reykjavik',
- 'Atlantic/South_Georgia',
- 'Atlantic/St_Helena',
- 'Atlantic/Stanley',
- 'Australia/Adelaide',
- 'Australia/Brisbane',
- 'Australia/Broken_Hill',
- 'Australia/Darwin',
- 'Australia/Eucla',
- 'Australia/Hobart',
- 'Australia/Lindeman',
- 'Australia/Lord_Howe',
- 'Australia/Melbourne',
- 'Australia/Perth',
- 'Australia/Sydney',
+ 'Asia/Macao',
+ 'Asia/Saigon',
+ 'Asia/Tel_Aviv',
+ 'Asia/Thimbu',
+ 'Asia/Ujung_Pandang',
+ 'Asia/Ulan_Bator',
+ 'Atlantic/Faeroe',
+ 'Atlantic/Jan_Mayen',
+ 'Australia/ACT',
+ 'Australia/Canberra',
+ 'Australia/LHI',
+ 'Australia/North',
+ 'Australia/NSW',
+ 'Australia/Queensland',
+ 'Australia/South',
+ 'Australia/Tasmania',
+ 'Australia/Victoria',
+ 'Australia/West',
+ 'Australia/Yancowinna',
+ 'Brazil/Acre',
+ 'Brazil/DeNoronha',
+ 'Brazil/East',
+ 'Brazil/West',
+ 'Canada/Atlantic',
+ 'Canada/Central',
+ 'Canada/Eastern',
+ 'Canada/Mountain',
+ 'Canada/Newfoundland',
+ 'Canada/Pacific',
+ 'Canada/Saskatchewan',
+ 'Canada/Yukon',
+ 'CET',
+ 'Chile/Continental',
+ 'Chile/EasterIsland',
'EET',
'EST',
'Etc/GMT',
@@ -363,127 +111,42 @@ return [
'Etc/GMT0',
'Etc/Greenwich',
'Etc/UCT',
- 'Etc/UTC',
'Etc/Universal',
+ 'Etc/UTC',
'Etc/Zulu',
- 'Europe/Amsterdam',
- 'Europe/Andorra',
- 'Europe/Astrakhan',
- 'Europe/Athens',
- 'Europe/Belgrade',
- 'Europe/Berlin',
- 'Europe/Bratislava',
- 'Europe/Brussels',
- 'Europe/Bucharest',
- 'Europe/Budapest',
- 'Europe/Busingen',
- 'Europe/Chisinau',
- 'Europe/Copenhagen',
- 'Europe/Dublin',
- 'Europe/Gibraltar',
- 'Europe/Guernsey',
- 'Europe/Helsinki',
- 'Europe/Isle_of_Man',
- 'Europe/Istanbul',
- 'Europe/Jersey',
- 'Europe/Kaliningrad',
- 'Europe/Kirov',
- 'Europe/Kyiv',
- 'Europe/Lisbon',
- 'Europe/Ljubljana',
- 'Europe/London',
- 'Europe/Luxembourg',
- 'Europe/Madrid',
- 'Europe/Malta',
- 'Europe/Mariehamn',
- 'Europe/Minsk',
- 'Europe/Monaco',
- 'Europe/Moscow',
- 'Europe/Oslo',
- 'Europe/Paris',
- 'Europe/Podgorica',
- 'Europe/Prague',
- 'Europe/Riga',
- 'Europe/Rome',
- 'Europe/Samara',
- 'Europe/San_Marino',
- 'Europe/Sarajevo',
- 'Europe/Saratov',
- 'Europe/Simferopol',
- 'Europe/Skopje',
- 'Europe/Sofia',
- 'Europe/Stockholm',
- 'Europe/Tallinn',
- 'Europe/Tirane',
- 'Europe/Ulyanovsk',
- 'Europe/Vaduz',
- 'Europe/Vatican',
- 'Europe/Vienna',
- 'Europe/Vilnius',
- 'Europe/Volgograd',
- 'Europe/Warsaw',
- 'Europe/Zagreb',
- 'Europe/Zurich',
+ 'Europe/Belfast',
+ 'Europe/Nicosia',
+ 'Europe/Tiraspol',
'GB',
'GMT',
'GMT+0',
'GMT-0',
'HST',
- 'Indian/Antananarivo',
- 'Indian/Chagos',
- 'Indian/Christmas',
- 'Indian/Cocos',
- 'Indian/Comoro',
- 'Indian/Kerguelen',
- 'Indian/Mahe',
- 'Indian/Maldives',
- 'Indian/Mauritius',
- 'Indian/Mayotte',
- 'Indian/Reunion',
'MET',
+ 'Mexico/BajaNorte',
+ 'Mexico/BajaSur',
+ 'Mexico/General',
'MST',
'NZ',
+ 'Pacific/Ponape',
+ 'Pacific/Samoa',
+ 'Pacific/Truk',
+ 'Pacific/Yap',
'PRC',
- 'Pacific/Apia',
- 'Pacific/Auckland',
- 'Pacific/Bougainville',
- 'Pacific/Chatham',
- 'Pacific/Chuuk',
- 'Pacific/Easter',
- 'Pacific/Efate',
- 'Pacific/Fakaofo',
- 'Pacific/Fiji',
- 'Pacific/Funafuti',
- 'Pacific/Galapagos',
- 'Pacific/Gambier',
- 'Pacific/Guadalcanal',
- 'Pacific/Guam',
- 'Pacific/Honolulu',
- 'Pacific/Kanton',
- 'Pacific/Kiritimati',
- 'Pacific/Kosrae',
- 'Pacific/Kwajalein',
- 'Pacific/Majuro',
- 'Pacific/Marquesas',
- 'Pacific/Midway',
- 'Pacific/Nauru',
- 'Pacific/Niue',
- 'Pacific/Norfolk',
- 'Pacific/Noumea',
- 'Pacific/Pago_Pago',
- 'Pacific/Palau',
- 'Pacific/Pitcairn',
- 'Pacific/Pohnpei',
- 'Pacific/Port_Moresby',
- 'Pacific/Rarotonga',
- 'Pacific/Saipan',
- 'Pacific/Tahiti',
- 'Pacific/Tarawa',
- 'Pacific/Tongatapu',
- 'Pacific/Wake',
- 'Pacific/Wallis',
'ROC',
'ROK',
'UCT',
+ 'US/Alaska',
+ 'US/Aleutian',
+ 'US/Arizona',
+ 'US/Central',
+ 'US/East-Indiana',
+ 'US/Eastern',
+ 'US/Hawaii',
+ 'US/Indiana-Starke',
+ 'US/Michigan',
+ 'US/Mountain',
+ 'US/Pacific',
+ 'US/Samoa',
'WET',
];
diff --git a/htdocs/includes/sabre/sabre/vobject/lib/timezonedata/windowszones.php b/htdocs/includes/sabre/sabre/vobject/lib/timezonedata/windowszones.php
index be1eceb6520..2049a95c185 100644
--- a/htdocs/includes/sabre/sabre/vobject/lib/timezonedata/windowszones.php
+++ b/htdocs/includes/sabre/sabre/vobject/lib/timezonedata/windowszones.php
@@ -20,7 +20,7 @@ return [
'Arab Standard Time' => 'Asia/Riyadh',
'Arabian Standard Time' => 'Asia/Dubai',
'Arabic Standard Time' => 'Asia/Baghdad',
- 'Argentina Standard Time' => 'America/Argentina/Buenos_Aires',
+ 'Argentina Standard Time' => 'America/Buenos_Aires',
'Astrakhan Standard Time' => 'Europe/Astrakhan',
'Atlantic Standard Time' => 'America/Halifax',
'Aus Central W. Standard Time' => 'Australia/Eucla',
@@ -60,7 +60,7 @@ return [
'GMT Standard Time' => 'Europe/London',
'GTB Standard Time' => 'Europe/Bucharest',
'Georgian Standard Time' => 'Asia/Tbilisi',
- 'Greenland Standard Time' => 'America/Nuuk',
+ 'Greenland Standard Time' => 'America/Godthab',
'Greenwich Standard Time' => 'Atlantic/Reykjavik',
'Haiti Standard Time' => 'America/Port-au-Prince',
'Hawaiian Standard Time' => 'Pacific/Honolulu',
@@ -127,7 +127,7 @@ return [
'Transbaikal Standard Time' => 'Asia/Chita',
'Turkey Standard Time' => 'Europe/Istanbul',
'Turks And Caicos Standard Time' => 'America/Grand_Turk',
- 'US Eastern Standard Time' => 'America/Indiana/Indianapolis',
+ 'US Eastern Standard Time' => 'America/Indianapolis',
'US Mountain Standard Time' => 'America/Phoenix',
'UTC' => 'Etc/GMT',
'UTC+12' => 'Etc/GMT-12',
diff --git a/htdocs/includes/sabre/sabre/xml/lib/Deserializer/functions.php b/htdocs/includes/sabre/sabre/xml/lib/Deserializer/functions.php
index c4f240970ec..62d4d0e0790 100644
--- a/htdocs/includes/sabre/sabre/xml/lib/Deserializer/functions.php
+++ b/htdocs/includes/sabre/sabre/xml/lib/Deserializer/functions.php
@@ -216,7 +216,7 @@ function valueObject(Reader $reader, string $className, string $namespace)
$reader->next();
}
} else {
- if (!$reader->read()) {
+ if (Reader::END_ELEMENT !== $reader->nodeType && !$reader->read()) {
break;
}
}
diff --git a/htdocs/includes/sabre/sabre/xml/lib/Version.php b/htdocs/includes/sabre/sabre/xml/lib/Version.php
index 1144bf08545..6b6c53b182d 100644
--- a/htdocs/includes/sabre/sabre/xml/lib/Version.php
+++ b/htdocs/includes/sabre/sabre/xml/lib/Version.php
@@ -16,5 +16,5 @@ class Version
/**
* Full version number.
*/
- const VERSION = '2.2.5';
+ const VERSION = '2.2.6';
}
diff --git a/htdocs/install/doctemplates/supplier_orders/template_supplier_order.odt b/htdocs/install/doctemplates/supplier_orders/template_supplier_order.odt
index e5020aef036..c64de7fa1a7 100644
Binary files a/htdocs/install/doctemplates/supplier_orders/template_supplier_order.odt and b/htdocs/install/doctemplates/supplier_orders/template_supplier_order.odt differ
diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php
index f0a3c8f3887..da8f2daae3b 100644
--- a/htdocs/modulebuilder/template/class/myobject.class.php
+++ b/htdocs/modulebuilder/template/class/myobject.class.php
@@ -432,17 +432,20 @@ class MyObject extends CommonObject
/**
- * Load list of objects in memory from the database. Using a fetchAll is a bad practice, instead try to forge you optimized and limited SQL request.
+ * Load list of objects in memory from the database.
+ * Using a fetchAll() with limit = 0 is a very bad practice. Instead try to forge yourself an optimized SQL request with
+ * your own loop with start and stop pagination.
*
- * @param string $sortorder Sort Order
- * @param string $sortfield Sort field
- * @param int $limit limit
- * @param int $offset Offset
- * @param array $filter Filter array. Example array('mystringfield'=>'value', 'myintfield'=>4, 'customsql'=>...)
- * @param string $filtermode Filter mode (AND or OR)
- * @return array|int int <0 if KO, array of pages if OK
+ * @param string $sortorder Sort Order
+ * @param string $sortfield Sort field
+ * @param int $limit Limit the number of lines returned
+ * @param int $offset Offset
+ * @param string $filter Filter as an Universal Search string.
+ * Example: '((client:=:1) OR ((client:>=:2) AND (client:<=:3))) AND (client:!=:8) AND (nom:like:'a%')'
+ * @param string $filtermode Filter mode (AND or OR)
+ * @return array|int int <0 if KO, array of pages if OK
*/
- public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, array $filter = array(), $filtermode = 'AND')
+ public function fetchAll($sortorder = '', $sortfield = '', $limit = 1000, $offset = 0, string $filter = '', $filtermode = 'AND')
{
dol_syslog(__METHOD__, LOG_DEBUG);
@@ -460,12 +463,14 @@ class MyObject extends CommonObject
$sql .= " WHERE 1 = 1";
}
// Manage filter
+ /* We keep this part of code that is still used by a lot of old class. The 'else" shows how to switch to Universal Search filters
$sqlwhere = array();
- if (count($filter) > 0) {
+ if (is_array($filter) && count($filter) > 0) {
+ dol_syslog("Warning: Use of an array as filter is now forbidden and deprecated. Use an universal SQL filter string instead", LOG_WARNING);
foreach ($filter as $key => $value) {
$columnName = preg_replace('/^t\./', '', $key);
if ($key === 'customsql') {
- // Never use 'customsql' with a value from user input since it is injected as is. The value must be hard coded.
+ // Never use 'customsql' with a value from a user input since it is injected as is. The value must be hard coded.
$sqlwhere[] = $value;
continue;
} elseif (isset($this->fields[$columnName])) {
@@ -501,10 +506,19 @@ class MyObject extends CommonObject
}
}
}
+ } else { */
+ $errormessage = '';
+ $sql .= forgeSQLFromUniversalSearchCriteria($filter, $errormessage);
+ if ($errormessage) {
+ $this->errors[] = $errormessage;
+ dol_syslog(__METHOD__.' '.join(',', $this->errors), LOG_ERR);
+
+ return -1;
}
+ /*}
if (count($sqlwhere) > 0) {
$sql .= " AND (".implode(" ".$filtermode." ", $sqlwhere).")";
- }
+ }*/
if (!empty($sortfield)) {
$sql .= $this->db->order($sortfield, $sortorder);
diff --git a/htdocs/resource/class/dolresource.class.php b/htdocs/resource/class/dolresource.class.php
index ccebbb2f12c..92097ca3e1f 100644
--- a/htdocs/resource/class/dolresource.class.php
+++ b/htdocs/resource/class/dolresource.class.php
@@ -502,12 +502,12 @@ class Dolresource extends CommonObject
/**
* Load resource objects into $this->lines
*
- * @param string $sortorder sort order
- * @param string $sortfield sort field
- * @param int $limit limit page
- * @param int $offset page
- * @param array $filter filter output
- * @return int Return integer <0 if KO, Number of lines loaded if OK
+ * @param string $sortorder sort order
+ * @param string $sortfield sort field
+ * @param int $limit limit page
+ * @param int $offset page
+ * @param array $filter filter output
+ * @return int Return integer <0 if KO, Number of lines loaded if OK
*/
public function fetchAll($sortorder, $sortfield, $limit, $offset, $filter = [])
{
diff --git a/htdocs/resource/class/html.formresource.class.php b/htdocs/resource/class/html.formresource.class.php
index 03941f84573..2d4d3b96b3f 100644
--- a/htdocs/resource/class/html.formresource.class.php
+++ b/htdocs/resource/class/html.formresource.class.php
@@ -65,21 +65,21 @@ class FormResource
/**
* Output html form to select a resource
*
- * @param int $selected Preselected resource id
- * @param string $htmlname Name of field in form
- * @param string $filter Optional filters criteras (example: 's.rowid <> x')
+ * @param int $selected Preselected resource id
+ * @param string $htmlname Name of field in form
+ * @param array $filter Optional filters criteria (example: 's.rowid <> x')
* @param int $showempty Add an empty field
- * @param int $showtype Show third party type in combolist (customer, prospect or supplier)
+ * @param int $showtype Show third party type in combo list (customer, prospect or supplier)
* @param int $forcecombo Force to use combo box
* @param array $event Event options. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled')))
* @param string $filterkey Filter on key value
* @param int $outputmode 0=HTML select string, 1=Array, 2=without form tag
* @param int $limit Limit number of answers
* @param string $morecss More css
- * @param bool $multiple add [] in the name of element and add 'multiple' attribute
+ * @param bool $multiple add [] in the name of element and add 'multiple' attribute
* @return string|array HTML string with
*/
- public function select_resource_list($selected = '', $htmlname = 'fk_resource', $filter = '', $showempty = 0, $showtype = 0, $forcecombo = 0, $event = array(), $filterkey = '', $outputmode = 0, $limit = 20, $morecss = '', $multiple = false)
+ public function select_resource_list($selected = 0, $htmlname = 'fk_resource', $filter = [], $showempty = 0, $showtype = 0, $forcecombo = 0, $event = array(), $filterkey = '', $outputmode = 0, $limit = 20, $morecss = '', $multiple = false)
{
// phpcs:enable
global $conf, $user, $langs;