diff --git a/composer.json b/composer.json index d2110959f..90377e1de 100644 --- a/composer.json +++ b/composer.json @@ -44,6 +44,7 @@ "php-opencloud/openstack": "^3.1", "phpseclib/phpseclib": "^2.0.40", "pimple/pimple": "^3.5.0", + "psr/clock": "^1.0", "psr/container": "^1.1.1", "psr/event-dispatcher": "^1.0", "punic/punic": "^1.6", diff --git a/composer.lock b/composer.lock index e43dc795e..a4b1a80b8 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "19a01a2628720d5764de13e4c4ab3d2d", + "content-hash": "37c6c04e5ec92ee724b453f80940f172", "packages": [ { "name": "aws/aws-crt-php", @@ -3282,6 +3282,54 @@ }, "time": "2016-08-06T20:24:11+00:00" }, + { + "name": "psr/clock", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/clock.git", + "reference": "e41a24703d4560fd0acb709162f73b8adfc3aa0d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/clock/zipball/e41a24703d4560fd0acb709162f73b8adfc3aa0d", + "reference": "e41a24703d4560fd0acb709162f73b8adfc3aa0d", + "shasum": "" + }, + "require": { + "php": "^7.0 || ^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Psr\\Clock\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for reading the clock.", + "homepage": "https://github.com/php-fig/clock", + "keywords": [ + "clock", + "now", + "psr", + "psr-20", + "time" + ], + "support": { + "issues": "https://github.com/php-fig/clock/issues", + "source": "https://github.com/php-fig/clock/tree/1.0.0" + }, + "time": "2022-11-25T14:36:26+00:00" + }, { "name": "psr/container", "version": "1.1.1", diff --git a/composer/ClassLoader.php b/composer/ClassLoader.php index afef3fa2a..fd56bd7d8 100644 --- a/composer/ClassLoader.php +++ b/composer/ClassLoader.php @@ -42,6 +42,9 @@ */ class ClassLoader { + /** @var \Closure(string):void */ + private static $includeFile; + /** @var ?string */ private $vendorDir; @@ -106,6 +109,7 @@ class ClassLoader public function __construct($vendorDir = null) { $this->vendorDir = $vendorDir; + self::initializeIncludeClosure(); } /** @@ -425,7 +429,7 @@ public function unregister() public function loadClass($class) { if ($file = $this->findFile($class)) { - includeFile($file); + (self::$includeFile)($file); return true; } @@ -555,18 +559,23 @@ private function findFileWithExtension($class, $ext) return false; } -} -/** - * Scope isolated include. - * - * Prevents access to $this/self from included files. - * - * @param string $file - * @return void - * @private - */ -function includeFile($file) -{ - include $file; + private static function initializeIncludeClosure(): void + { + if (self::$includeFile !== null) { + return; + } + + /** + * Scope isolated include. + * + * Prevents access to $this/self from included files. + * + * @param string $file + * @return void + */ + self::$includeFile = static function($file) { + include $file; + }; + } } diff --git a/composer/autoload_classmap.php b/composer/autoload_classmap.php index a94129508..a12be7165 100644 --- a/composer/autoload_classmap.php +++ b/composer/autoload_classmap.php @@ -2287,6 +2287,7 @@ 'Psr\\Cache\\CacheItemInterface' => $vendorDir . '/psr/cache/src/CacheItemInterface.php', 'Psr\\Cache\\CacheItemPoolInterface' => $vendorDir . '/psr/cache/src/CacheItemPoolInterface.php', 'Psr\\Cache\\InvalidArgumentException' => $vendorDir . '/psr/cache/src/InvalidArgumentException.php', + 'Psr\\Clock\\ClockInterface' => $vendorDir . '/psr/clock/src/ClockInterface.php', 'Psr\\Container\\ContainerExceptionInterface' => $vendorDir . '/psr/container/src/ContainerExceptionInterface.php', 'Psr\\Container\\ContainerInterface' => $vendorDir . '/psr/container/src/ContainerInterface.php', 'Psr\\Container\\NotFoundExceptionInterface' => $vendorDir . '/psr/container/src/NotFoundExceptionInterface.php', diff --git a/composer/autoload_psr4.php b/composer/autoload_psr4.php index e845bb85e..a62ecbef1 100644 --- a/composer/autoload_psr4.php +++ b/composer/autoload_psr4.php @@ -55,6 +55,7 @@ 'Psr\\Http\\Client\\' => array($vendorDir . '/psr/http-client/src'), 'Psr\\EventDispatcher\\' => array($vendorDir . '/psr/event-dispatcher/src'), 'Psr\\Container\\' => array($vendorDir . '/psr/container/src'), + 'Psr\\Clock\\' => array($vendorDir . '/psr/clock/src'), 'Psr\\Cache\\' => array($vendorDir . '/psr/cache/src'), 'PhpParser\\' => array($vendorDir . '/nikic/php-parser/lib/PhpParser'), 'Opis\\Closure\\' => array($vendorDir . '/opis/closure/src'), diff --git a/composer/autoload_real.php b/composer/autoload_real.php index 2703bd367..ca7d2ad3c 100644 --- a/composer/autoload_real.php +++ b/composer/autoload_real.php @@ -38,25 +38,18 @@ public static function getLoader() $loader->setClassMapAuthoritative(true); $loader->register(true); - $includeFiles = \Composer\Autoload\ComposerStaticInit2f23f73bc0cc116b4b1eee1521aa8652::$files; - foreach ($includeFiles as $fileIdentifier => $file) { - composerRequire2f23f73bc0cc116b4b1eee1521aa8652($fileIdentifier, $file); + $filesToLoad = \Composer\Autoload\ComposerStaticInit2f23f73bc0cc116b4b1eee1521aa8652::$files; + $requireFile = static function ($fileIdentifier, $file) { + if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { + $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; + + require $file; + } + }; + foreach ($filesToLoad as $fileIdentifier => $file) { + ($requireFile)($fileIdentifier, $file); } return $loader; } } - -/** - * @param string $fileIdentifier - * @param string $file - * @return void - */ -function composerRequire2f23f73bc0cc116b4b1eee1521aa8652($fileIdentifier, $file) -{ - if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { - $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; - - require $file; - } -} diff --git a/composer/autoload_static.php b/composer/autoload_static.php index ba7fadf72..6e7224226 100644 --- a/composer/autoload_static.php +++ b/composer/autoload_static.php @@ -204,6 +204,7 @@ class ComposerStaticInit2f23f73bc0cc116b4b1eee1521aa8652 'Psr\\Http\\Client\\' => 16, 'Psr\\EventDispatcher\\' => 20, 'Psr\\Container\\' => 14, + 'Psr\\Clock\\' => 10, 'Psr\\Cache\\' => 10, 'PhpParser\\' => 10, ), @@ -486,6 +487,10 @@ class ComposerStaticInit2f23f73bc0cc116b4b1eee1521aa8652 array ( 0 => __DIR__ . '/..' . '/psr/container/src', ), + 'Psr\\Clock\\' => + array ( + 0 => __DIR__ . '/..' . '/psr/clock/src', + ), 'Psr\\Cache\\' => array ( 0 => __DIR__ . '/..' . '/psr/cache/src', @@ -2954,6 +2959,7 @@ class ComposerStaticInit2f23f73bc0cc116b4b1eee1521aa8652 'Psr\\Cache\\CacheItemInterface' => __DIR__ . '/..' . '/psr/cache/src/CacheItemInterface.php', 'Psr\\Cache\\CacheItemPoolInterface' => __DIR__ . '/..' . '/psr/cache/src/CacheItemPoolInterface.php', 'Psr\\Cache\\InvalidArgumentException' => __DIR__ . '/..' . '/psr/cache/src/InvalidArgumentException.php', + 'Psr\\Clock\\ClockInterface' => __DIR__ . '/..' . '/psr/clock/src/ClockInterface.php', 'Psr\\Container\\ContainerExceptionInterface' => __DIR__ . '/..' . '/psr/container/src/ContainerExceptionInterface.php', 'Psr\\Container\\ContainerInterface' => __DIR__ . '/..' . '/psr/container/src/ContainerInterface.php', 'Psr\\Container\\NotFoundExceptionInterface' => __DIR__ . '/..' . '/psr/container/src/NotFoundExceptionInterface.php', diff --git a/composer/installed.json b/composer/installed.json index b0f5f8cd5..535b0da56 100644 --- a/composer/installed.json +++ b/composer/installed.json @@ -3426,6 +3426,57 @@ }, "install-path": "../psr/cache" }, + { + "name": "psr/clock", + "version": "1.0.0", + "version_normalized": "1.0.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/clock.git", + "reference": "e41a24703d4560fd0acb709162f73b8adfc3aa0d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/clock/zipball/e41a24703d4560fd0acb709162f73b8adfc3aa0d", + "reference": "e41a24703d4560fd0acb709162f73b8adfc3aa0d", + "shasum": "" + }, + "require": { + "php": "^7.0 || ^8.0" + }, + "time": "2022-11-25T14:36:26+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Psr\\Clock\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for reading the clock.", + "homepage": "https://github.com/php-fig/clock", + "keywords": [ + "clock", + "now", + "psr", + "psr-20", + "time" + ], + "support": { + "issues": "https://github.com/php-fig/clock/issues", + "source": "https://github.com/php-fig/clock/tree/1.0.0" + }, + "install-path": "../psr/clock" + }, { "name": "psr/container", "version": "1.1.1", diff --git a/composer/installed.php b/composer/installed.php index 59c95a3d1..2caee8ab0 100644 --- a/composer/installed.php +++ b/composer/installed.php @@ -3,7 +3,7 @@ 'name' => 'nextcloud/3rdparty', 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => '9ef27e13d670f2afe61c08f9662731e727ff00ee', + 'reference' => 'e84c6c487dd19a023cd66af7dc5b6005222e5821', 'type' => 'library', 'install_path' => __DIR__ . '/../', 'aliases' => array(), @@ -328,7 +328,7 @@ 'nextcloud/3rdparty' => array( 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => '9ef27e13d670f2afe61c08f9662731e727ff00ee', + 'reference' => 'e84c6c487dd19a023cd66af7dc5b6005222e5821', 'type' => 'library', 'install_path' => __DIR__ . '/../', 'aliases' => array(), @@ -481,6 +481,15 @@ 'aliases' => array(), 'dev_requirement' => false, ), + 'psr/clock' => array( + 'pretty_version' => '1.0.0', + 'version' => '1.0.0.0', + 'reference' => 'e41a24703d4560fd0acb709162f73b8adfc3aa0d', + 'type' => 'library', + 'install_path' => __DIR__ . '/../psr/clock', + 'aliases' => array(), + 'dev_requirement' => false, + ), 'psr/container' => array( 'pretty_version' => '1.1.1', 'version' => '1.1.1.0', diff --git a/psr/clock/LICENSE b/psr/clock/LICENSE new file mode 100644 index 000000000..be6834212 --- /dev/null +++ b/psr/clock/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2017 PHP Framework Interoperability Group + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/psr/clock/src/ClockInterface.php b/psr/clock/src/ClockInterface.php new file mode 100644 index 000000000..7b6d8d8aa --- /dev/null +++ b/psr/clock/src/ClockInterface.php @@ -0,0 +1,13 @@ +