diff --git a/system/vendor/akrabat/proxy-detection-middleware/.gitignore b/system/vendor/akrabat/proxy-detection-middleware/.gitignore deleted file mode 100644 index cf18dbe..0000000 --- a/system/vendor/akrabat/proxy-detection-middleware/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -build -vendor -.phpunit.result.cache diff --git a/system/vendor/akrabat/proxy-detection-middleware/.travis.yml b/system/vendor/akrabat/proxy-detection-middleware/.travis.yml deleted file mode 100644 index 70272da..0000000 --- a/system/vendor/akrabat/proxy-detection-middleware/.travis.yml +++ /dev/null @@ -1,25 +0,0 @@ -sudo: false - -language: php - -php: - - 7.0 - - 7.1 - - 7.2 - - nightly - -matrix: - allow_failures: - - php: nightly - - -before_install: - - composer self-update - -install: - - travis_retry composer install --no-interaction --ignore-platform-reqs --prefer-source - - composer info -i - -script: - - vendor/bin/phpcs - - vendor/bin/phpunit diff --git a/system/vendor/akrabat/proxy-detection-middleware/LICENSE b/system/vendor/akrabat/proxy-detection-middleware/LICENSE deleted file mode 100644 index 1f8a265..0000000 --- a/system/vendor/akrabat/proxy-detection-middleware/LICENSE +++ /dev/null @@ -1,26 +0,0 @@ -Copyright (c) 2015, Rob Allen (rob@akrabat.com) -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - * The name of Rob Allen may not be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/system/vendor/akrabat/proxy-detection-middleware/README.md b/system/vendor/akrabat/proxy-detection-middleware/README.md deleted file mode 100644 index bfd35e8..0000000 --- a/system/vendor/akrabat/proxy-detection-middleware/README.md +++ /dev/null @@ -1,40 +0,0 @@ -# Proxy Scheme, Host and Port detection middleware - -[![Build status][Master image]][Master] - -PSR-7 Middleware that determines the scheme, host and port from the 'X-Forwarded-Proto', 'X-Forwarded-Host' and 'X-Forwarded-Port' headers and updates the Request's Uri object. - -You can set a list of proxies that are trusted as the second constructor parameter. If this list is set, then the proxy headers will only be checked if the `REMOTE_ADDR` is in the trusted list. - - -## Installation - -`composer require akrabat/proxy-detection-middleware` - - -## Usage - -In Slim 3: - -```php -$trustedProxies = ['10.0.0.1', '10.0.0.2']; -$app->add(new RKA\Middleware\ProxyDetection($trustedProxies)); - -$app->get('/', function ($request, $response, $args) { - $scheme = $request->getUri()->getScheme(); - $host = $request->getUri()->getHost(); - $port = $request->getUri()->getPort(); - - return $response; -}); -``` - -## Testing - -* Code coverage: ``$ vendor/bin/phpcs`` -* Unit tests: ``$ vendor/bin/phpunit`` -* Code coverage: ``$ vendor/bin/phpunit --coverage-html ./build`` - - -[Master]: https://travis-ci.org/akrabat/rka-content-type-renderer -[Master image]: https://secure.travis-ci.org/akrabat/rka-content-type-renderer.svg?branch=master diff --git a/system/vendor/akrabat/proxy-detection-middleware/composer.json b/system/vendor/akrabat/proxy-detection-middleware/composer.json deleted file mode 100644 index a515f8b..0000000 --- a/system/vendor/akrabat/proxy-detection-middleware/composer.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "akrabat/proxy-detection-middleware", - "description": "PSR-7/PSR-15 Middleware that determines the scheme, host and port from the 'X-Forwarded-Proto', 'X-Forwarded-Host' and 'X-Forwarded-Port' headers and updates the Request's Uri object.", - "keywords": [ - "psr7", "middleware", "ip" - ], - "homepage": "http://github.com/akrabat/proxy-detection-middleware", - "type": "library", - "license": "BSD-3-Clause", - "authors": [ - { - "name": "Rob Allen", - "email": "rob@akrabat.com", - "homepage": "http://akrabat.com" - } - ], - "require": { - "psr/http-message": "^1.0", - "psr/http-server-middleware": "^1.0" - }, - "require-dev": { - "php": "^8.0", - "phpunit/phpunit": "^9.6", - "squizlabs/php_codesniffer": "^3.7", - "laminas/laminas-diactoros": "^2.24" - }, - "autoload": { - "psr-4": { - "RKA\\Middleware\\": "src" - } - } -} diff --git a/system/vendor/akrabat/proxy-detection-middleware/composer.lock b/system/vendor/akrabat/proxy-detection-middleware/composer.lock deleted file mode 100644 index e7b2831..0000000 --- a/system/vendor/akrabat/proxy-detection-middleware/composer.lock +++ /dev/null @@ -1,2127 +0,0 @@ -{ - "_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": "5d170d5a702ea4455f3d379f1299ed31", - "packages": [ - { - "name": "psr/http-message", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-message.git", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Http\\Message\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for HTTP messages", - "homepage": "https://github.com/php-fig/http-message", - "keywords": [ - "http", - "http-message", - "psr", - "psr-7", - "request", - "response" - ], - "support": { - "source": "https://github.com/php-fig/http-message/tree/master" - }, - "time": "2016-08-06T14:39:51+00:00" - }, - { - "name": "psr/http-server-handler", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-server-handler.git", - "reference": "aff2f80e33b7f026ec96bb42f63242dc50ffcae7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-server-handler/zipball/aff2f80e33b7f026ec96bb42f63242dc50ffcae7", - "reference": "aff2f80e33b7f026ec96bb42f63242dc50ffcae7", - "shasum": "" - }, - "require": { - "php": ">=7.0", - "psr/http-message": "^1.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Http\\Server\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for HTTP server-side request handler", - "keywords": [ - "handler", - "http", - "http-interop", - "psr", - "psr-15", - "psr-7", - "request", - "response", - "server" - ], - "support": { - "issues": "https://github.com/php-fig/http-server-handler/issues", - "source": "https://github.com/php-fig/http-server-handler/tree/master" - }, - "time": "2018-10-30T16:46:14+00:00" - }, - { - "name": "psr/http-server-middleware", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-server-middleware.git", - "reference": "2296f45510945530b9dceb8bcedb5cb84d40c5f5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-server-middleware/zipball/2296f45510945530b9dceb8bcedb5cb84d40c5f5", - "reference": "2296f45510945530b9dceb8bcedb5cb84d40c5f5", - "shasum": "" - }, - "require": { - "php": ">=7.0", - "psr/http-message": "^1.0", - "psr/http-server-handler": "^1.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Http\\Server\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for HTTP server-side middleware", - "keywords": [ - "http", - "http-interop", - "middleware", - "psr", - "psr-15", - "psr-7", - "request", - "response" - ], - "support": { - "issues": "https://github.com/php-fig/http-server-middleware/issues", - "source": "https://github.com/php-fig/http-server-middleware/tree/master" - }, - "time": "2018-10-30T17:12:04+00:00" - } - ], - "packages-dev": [ - { - "name": "doctrine/instantiator", - "version": "2.0.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", - "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", - "shasum": "" - }, - "require": { - "php": "^8.1" - }, - "require-dev": { - "doctrine/coding-standard": "^11", - "ext-pdo": "*", - "ext-phar": "*", - "phpbench/phpbench": "^1.2", - "phpstan/phpstan": "^1.9.4", - "phpstan/phpstan-phpunit": "^1.3", - "phpunit/phpunit": "^9.5.27", - "vimeo/psalm": "^5.4" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "https://ocramius.github.io/" - } - ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://www.doctrine-project.org/projects/instantiator.html", - "keywords": [ - "constructor", - "instantiate" - ], - "support": { - "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/2.0.0" - }, - "funding": [ - { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", - "type": "tidelift" - } - ], - "time": "2022-12-30T00:23:10+00:00" - }, - { - "name": "laminas/laminas-diactoros", - "version": "2.24.0", - "source": { - "type": "git", - "url": "https://github.com/laminas/laminas-diactoros.git", - "reference": "6028af6c3b5ced4d063a680d2483cce67578b902" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-diactoros/zipball/6028af6c3b5ced4d063a680d2483cce67578b902", - "reference": "6028af6c3b5ced4d063a680d2483cce67578b902", - "shasum": "" - }, - "require": { - "php": "~8.0.0 || ~8.1.0 || ~8.2.0", - "psr/http-factory": "^1.0", - "psr/http-message": "^1.0" - }, - "conflict": { - "zendframework/zend-diactoros": "*" - }, - "provide": { - "psr/http-factory-implementation": "1.0", - "psr/http-message-implementation": "1.0" - }, - "require-dev": { - "ext-curl": "*", - "ext-dom": "*", - "ext-gd": "*", - "ext-libxml": "*", - "http-interop/http-factory-tests": "^0.9.0", - "laminas/laminas-coding-standard": "^2.4.0", - "php-http/psr7-integration-tests": "^1.2", - "phpunit/phpunit": "^9.5.27", - "psalm/plugin-phpunit": "^0.18.4", - "vimeo/psalm": "^5.4" - }, - "type": "library", - "extra": { - "laminas": { - "config-provider": "Laminas\\Diactoros\\ConfigProvider", - "module": "Laminas\\Diactoros" - } - }, - "autoload": { - "files": [ - "src/functions/create_uploaded_file.php", - "src/functions/marshal_headers_from_sapi.php", - "src/functions/marshal_method_from_sapi.php", - "src/functions/marshal_protocol_version_from_sapi.php", - "src/functions/marshal_uri_from_sapi.php", - "src/functions/normalize_server.php", - "src/functions/normalize_uploaded_files.php", - "src/functions/parse_cookie_header.php", - "src/functions/create_uploaded_file.legacy.php", - "src/functions/marshal_headers_from_sapi.legacy.php", - "src/functions/marshal_method_from_sapi.legacy.php", - "src/functions/marshal_protocol_version_from_sapi.legacy.php", - "src/functions/marshal_uri_from_sapi.legacy.php", - "src/functions/normalize_server.legacy.php", - "src/functions/normalize_uploaded_files.legacy.php", - "src/functions/parse_cookie_header.legacy.php" - ], - "psr-4": { - "Laminas\\Diactoros\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "PSR HTTP Message implementations", - "homepage": "https://laminas.dev", - "keywords": [ - "http", - "laminas", - "psr", - "psr-17", - "psr-7" - ], - "support": { - "chat": "https://laminas.dev/chat", - "docs": "https://docs.laminas.dev/laminas-diactoros/", - "forum": "https://discourse.laminas.dev", - "issues": "https://github.com/laminas/laminas-diactoros/issues", - "rss": "https://github.com/laminas/laminas-diactoros/releases.atom", - "source": "https://github.com/laminas/laminas-diactoros" - }, - "funding": [ - { - "url": "https://funding.communitybridge.org/projects/laminas-project", - "type": "community_bridge" - } - ], - "time": "2022-12-20T12:22:40+00:00" - }, - { - "name": "myclabs/deep-copy", - "version": "1.11.0", - "source": { - "type": "git", - "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "14daed4296fae74d9e3201d2c4925d1acb7aa614" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/14daed4296fae74d9e3201d2c4925d1acb7aa614", - "reference": "14daed4296fae74d9e3201d2c4925d1acb7aa614", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0" - }, - "conflict": { - "doctrine/collections": "<1.6.8", - "doctrine/common": "<2.13.3 || >=3,<3.2.2" - }, - "require-dev": { - "doctrine/collections": "^1.6.8", - "doctrine/common": "^2.13.3 || ^3.2.2", - "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" - }, - "type": "library", - "autoload": { - "files": [ - "src/DeepCopy/deep_copy.php" - ], - "psr-4": { - "DeepCopy\\": "src/DeepCopy/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Create deep copies (clones) of your objects", - "keywords": [ - "clone", - "copy", - "duplicate", - "object", - "object graph" - ], - "support": { - "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.11.0" - }, - "funding": [ - { - "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", - "type": "tidelift" - } - ], - "time": "2022-03-03T13:19:32+00:00" - }, - { - "name": "nikic/php-parser", - "version": "v4.15.3", - "source": { - "type": "git", - "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "570e980a201d8ed0236b0a62ddf2c9cbb2034039" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/570e980a201d8ed0236b0a62ddf2c9cbb2034039", - "reference": "570e980a201d8ed0236b0a62ddf2c9cbb2034039", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": ">=7.0" - }, - "require-dev": { - "ircmaxell/php-yacc": "^0.0.7", - "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" - }, - "bin": [ - "bin/php-parse" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.9-dev" - } - }, - "autoload": { - "psr-4": { - "PhpParser\\": "lib/PhpParser" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Nikita Popov" - } - ], - "description": "A PHP parser written in PHP", - "keywords": [ - "parser", - "php" - ], - "support": { - "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.3" - }, - "time": "2023-01-16T22:05:37+00:00" - }, - { - "name": "phar-io/manifest", - "version": "2.0.3", - "source": { - "type": "git", - "url": "https://github.com/phar-io/manifest.git", - "reference": "97803eca37d319dfa7826cc2437fc020857acb53" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53", - "reference": "97803eca37d319dfa7826cc2437fc020857acb53", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-phar": "*", - "ext-xmlwriter": "*", - "phar-io/version": "^3.0.1", - "php": "^7.2 || ^8.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - }, - { - "name": "Sebastian Heuer", - "email": "sebastian@phpeople.de", - "role": "Developer" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "Developer" - } - ], - "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", - "support": { - "issues": "https://github.com/phar-io/manifest/issues", - "source": "https://github.com/phar-io/manifest/tree/2.0.3" - }, - "time": "2021-07-20T11:28:43+00:00" - }, - { - "name": "phar-io/version", - "version": "3.2.1", - "source": { - "type": "git", - "url": "https://github.com/phar-io/version.git", - "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74", - "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - }, - { - "name": "Sebastian Heuer", - "email": "sebastian@phpeople.de", - "role": "Developer" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "Developer" - } - ], - "description": "Library for handling version information and constraints", - "support": { - "issues": "https://github.com/phar-io/version/issues", - "source": "https://github.com/phar-io/version/tree/3.2.1" - }, - "time": "2022-02-21T01:04:05+00:00" - }, - { - "name": "phpunit/php-code-coverage", - "version": "9.2.24", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "2cf940ebc6355a9d430462811b5aaa308b174bed" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/2cf940ebc6355a9d430462811b5aaa308b174bed", - "reference": "2cf940ebc6355a9d430462811b5aaa308b174bed", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-libxml": "*", - "ext-xmlwriter": "*", - "nikic/php-parser": "^4.14", - "php": ">=7.3", - "phpunit/php-file-iterator": "^3.0.3", - "phpunit/php-text-template": "^2.0.2", - "sebastian/code-unit-reverse-lookup": "^2.0.2", - "sebastian/complexity": "^2.0", - "sebastian/environment": "^5.1.2", - "sebastian/lines-of-code": "^1.0.3", - "sebastian/version": "^3.0.1", - "theseer/tokenizer": "^1.2.0" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "suggest": { - "ext-pcov": "*", - "ext-xdebug": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "9.2-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", - "homepage": "https://github.com/sebastianbergmann/php-code-coverage", - "keywords": [ - "coverage", - "testing", - "xunit" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.24" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2023-01-26T08:26:55+00:00" - }, - { - "name": "phpunit/php-file-iterator", - "version": "3.0.6", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", - "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "FilterIterator implementation that filters files based on a list of suffixes.", - "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", - "keywords": [ - "filesystem", - "iterator" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2021-12-02T12:48:52+00:00" - }, - { - "name": "phpunit/php-invoker", - "version": "3.1.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-invoker.git", - "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67", - "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "ext-pcntl": "*", - "phpunit/phpunit": "^9.3" - }, - "suggest": { - "ext-pcntl": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.1-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Invoke callables with a timeout", - "homepage": "https://github.com/sebastianbergmann/php-invoker/", - "keywords": [ - "process" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-invoker/issues", - "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-09-28T05:58:55+00:00" - }, - { - "name": "phpunit/php-text-template", - "version": "2.0.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", - "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Simple template engine.", - "homepage": "https://github.com/sebastianbergmann/php-text-template/", - "keywords": [ - "template" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-text-template/issues", - "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-26T05:33:50+00:00" - }, - { - "name": "phpunit/php-timer", - "version": "5.0.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", - "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Utility class for timing", - "homepage": "https://github.com/sebastianbergmann/php-timer/", - "keywords": [ - "timer" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-timer/issues", - "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-26T13:16:10+00:00" - }, - { - "name": "phpunit/phpunit", - "version": "9.6.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "e7b1615e3e887d6c719121c6d4a44b0ab9645555" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/e7b1615e3e887d6c719121c6d4a44b0ab9645555", - "reference": "e7b1615e3e887d6c719121c6d4a44b0ab9645555", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.3.1 || ^2", - "ext-dom": "*", - "ext-json": "*", - "ext-libxml": "*", - "ext-mbstring": "*", - "ext-xml": "*", - "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.10.1", - "phar-io/manifest": "^2.0.3", - "phar-io/version": "^3.0.2", - "php": ">=7.3", - "phpunit/php-code-coverage": "^9.2.13", - "phpunit/php-file-iterator": "^3.0.5", - "phpunit/php-invoker": "^3.1.1", - "phpunit/php-text-template": "^2.0.3", - "phpunit/php-timer": "^5.0.2", - "sebastian/cli-parser": "^1.0.1", - "sebastian/code-unit": "^1.0.6", - "sebastian/comparator": "^4.0.8", - "sebastian/diff": "^4.0.3", - "sebastian/environment": "^5.1.3", - "sebastian/exporter": "^4.0.5", - "sebastian/global-state": "^5.0.1", - "sebastian/object-enumerator": "^4.0.3", - "sebastian/resource-operations": "^3.0.3", - "sebastian/type": "^3.2", - "sebastian/version": "^3.0.2" - }, - "suggest": { - "ext-soap": "*", - "ext-xdebug": "*" - }, - "bin": [ - "phpunit" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "9.6-dev" - } - }, - "autoload": { - "files": [ - "src/Framework/Assert/Functions.php" - ], - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "The PHP Unit Testing framework.", - "homepage": "https://phpunit.de/", - "keywords": [ - "phpunit", - "testing", - "xunit" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.3" - }, - "funding": [ - { - "url": "https://phpunit.de/sponsors.html", - "type": "custom" - }, - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", - "type": "tidelift" - } - ], - "time": "2023-02-04T13:37:15+00:00" - }, - { - "name": "psr/http-factory", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-factory.git", - "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-factory/zipball/12ac7fcd07e5b077433f5f2bee95b3a771bf61be", - "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be", - "shasum": "" - }, - "require": { - "php": ">=7.0.0", - "psr/http-message": "^1.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Http\\Message\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interfaces for PSR-7 HTTP message factories", - "keywords": [ - "factory", - "http", - "message", - "psr", - "psr-17", - "psr-7", - "request", - "response" - ], - "support": { - "source": "https://github.com/php-fig/http-factory/tree/master" - }, - "time": "2019-04-30T12:38:16+00:00" - }, - { - "name": "sebastian/cli-parser", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/cli-parser.git", - "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/442e7c7e687e42adc03470c7b668bc4b2402c0b2", - "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library for parsing CLI options", - "homepage": "https://github.com/sebastianbergmann/cli-parser", - "support": { - "issues": "https://github.com/sebastianbergmann/cli-parser/issues", - "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.1" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-09-28T06:08:49+00:00" - }, - { - "name": "sebastian/code-unit", - "version": "1.0.8", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit.git", - "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120", - "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Collection of value objects that represent the PHP code units", - "homepage": "https://github.com/sebastianbergmann/code-unit", - "support": { - "issues": "https://github.com/sebastianbergmann/code-unit/issues", - "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-26T13:08:54+00:00" - }, - { - "name": "sebastian/code-unit-reverse-lookup", - "version": "2.0.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", - "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Looks up which function or method a line of code belongs to", - "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", - "support": { - "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", - "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/2.0.3" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-09-28T05:30:19+00:00" - }, - { - "name": "sebastian/comparator", - "version": "4.0.8", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "fa0f136dd2334583309d32b62544682ee972b51a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/fa0f136dd2334583309d32b62544682ee972b51a", - "reference": "fa0f136dd2334583309d32b62544682ee972b51a", - "shasum": "" - }, - "require": { - "php": ">=7.3", - "sebastian/diff": "^4.0", - "sebastian/exporter": "^4.0" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - } - ], - "description": "Provides the functionality to compare PHP values for equality", - "homepage": "https://github.com/sebastianbergmann/comparator", - "keywords": [ - "comparator", - "compare", - "equality" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.8" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2022-09-14T12:41:17+00:00" - }, - { - "name": "sebastian/complexity", - "version": "2.0.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/complexity.git", - "reference": "739b35e53379900cc9ac327b2147867b8b6efd88" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/739b35e53379900cc9ac327b2147867b8b6efd88", - "reference": "739b35e53379900cc9ac327b2147867b8b6efd88", - "shasum": "" - }, - "require": { - "nikic/php-parser": "^4.7", - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library for calculating the complexity of PHP code units", - "homepage": "https://github.com/sebastianbergmann/complexity", - "support": { - "issues": "https://github.com/sebastianbergmann/complexity/issues", - "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.2" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-26T15:52:27+00:00" - }, - { - "name": "sebastian/diff", - "version": "4.0.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/3461e3fccc7cfdfc2720be910d3bd73c69be590d", - "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3", - "symfony/process": "^4.2 || ^5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - } - ], - "description": "Diff implementation", - "homepage": "https://github.com/sebastianbergmann/diff", - "keywords": [ - "diff", - "udiff", - "unidiff", - "unified diff" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/4.0.4" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-26T13:10:38+00:00" - }, - { - "name": "sebastian/environment", - "version": "5.1.5", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", - "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "suggest": { - "ext-posix": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.1-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", - "keywords": [ - "Xdebug", - "environment", - "hhvm" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/environment/issues", - "source": "https://github.com/sebastianbergmann/environment/tree/5.1.5" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2023-02-03T06:03:51+00:00" - }, - { - "name": "sebastian/exporter", - "version": "4.0.5", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", - "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", - "shasum": "" - }, - "require": { - "php": ">=7.3", - "sebastian/recursion-context": "^4.0" - }, - "require-dev": { - "ext-mbstring": "*", - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "Provides the functionality to export PHP variables for visualization", - "homepage": "https://www.github.com/sebastianbergmann/exporter", - "keywords": [ - "export", - "exporter" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.5" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2022-09-14T06:03:37+00:00" - }, - { - "name": "sebastian/global-state", - "version": "5.0.5", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/0ca8db5a5fc9c8646244e629625ac486fa286bf2", - "reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2", - "shasum": "" - }, - "require": { - "php": ">=7.3", - "sebastian/object-reflector": "^2.0", - "sebastian/recursion-context": "^4.0" - }, - "require-dev": { - "ext-dom": "*", - "phpunit/phpunit": "^9.3" - }, - "suggest": { - "ext-uopz": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", - "keywords": [ - "global state" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.5" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2022-02-14T08:28:10+00:00" - }, - { - "name": "sebastian/lines-of-code", - "version": "1.0.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/lines-of-code.git", - "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/c1c2e997aa3146983ed888ad08b15470a2e22ecc", - "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc", - "shasum": "" - }, - "require": { - "nikic/php-parser": "^4.6", - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library for counting the lines of code in PHP source code", - "homepage": "https://github.com/sebastianbergmann/lines-of-code", - "support": { - "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", - "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.3" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-11-28T06:42:11+00:00" - }, - { - "name": "sebastian/object-enumerator", - "version": "4.0.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "5c9eeac41b290a3712d88851518825ad78f45c71" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71", - "reference": "5c9eeac41b290a3712d88851518825ad78f45c71", - "shasum": "" - }, - "require": { - "php": ">=7.3", - "sebastian/object-reflector": "^2.0", - "sebastian/recursion-context": "^4.0" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Traverses array structures and object graphs to enumerate all referenced objects", - "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "support": { - "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", - "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-26T13:12:34+00:00" - }, - { - "name": "sebastian/object-reflector", - "version": "2.0.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", - "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Allows reflection of object attributes, including inherited and non-public ones", - "homepage": "https://github.com/sebastianbergmann/object-reflector/", - "support": { - "issues": "https://github.com/sebastianbergmann/object-reflector/issues", - "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-26T13:14:26+00:00" - }, - { - "name": "sebastian/recursion-context", - "version": "4.0.5", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", - "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - } - ], - "description": "Provides functionality to recursively process PHP variables", - "homepage": "https://github.com/sebastianbergmann/recursion-context", - "support": { - "issues": "https://github.com/sebastianbergmann/recursion-context/issues", - "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.5" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2023-02-03T06:07:39+00:00" - }, - { - "name": "sebastian/resource-operations", - "version": "3.0.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", - "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides a list of PHP built-in functions that operate on resources", - "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "support": { - "issues": "https://github.com/sebastianbergmann/resource-operations/issues", - "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.3" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-09-28T06:45:17+00:00" - }, - { - "name": "sebastian/type", - "version": "3.2.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/type.git", - "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", - "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Collection of value objects that represent the types of the PHP type system", - "homepage": "https://github.com/sebastianbergmann/type", - "support": { - "issues": "https://github.com/sebastianbergmann/type/issues", - "source": "https://github.com/sebastianbergmann/type/tree/3.2.1" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2023-02-03T06:13:03+00:00" - }, - { - "name": "sebastian/version", - "version": "3.0.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/version.git", - "reference": "c6c1022351a901512170118436c764e473f6de8c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c", - "reference": "c6c1022351a901512170118436c764e473f6de8c", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library that helps with managing the version number of Git-hosted PHP projects", - "homepage": "https://github.com/sebastianbergmann/version", - "support": { - "issues": "https://github.com/sebastianbergmann/version/issues", - "source": "https://github.com/sebastianbergmann/version/tree/3.0.2" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-09-28T06:39:44+00:00" - }, - { - "name": "squizlabs/php_codesniffer", - "version": "3.7.1", - "source": { - "type": "git", - "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "1359e176e9307e906dc3d890bcc9603ff6d90619" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/1359e176e9307e906dc3d890bcc9603ff6d90619", - "reference": "1359e176e9307e906dc3d890bcc9603ff6d90619", - "shasum": "" - }, - "require": { - "ext-simplexml": "*", - "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": ">=5.4.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" - }, - "bin": [ - "bin/phpcs", - "bin/phpcbf" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.x-dev" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Greg Sherwood", - "role": "lead" - } - ], - "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", - "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", - "keywords": [ - "phpcs", - "standards" - ], - "support": { - "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", - "source": "https://github.com/squizlabs/PHP_CodeSniffer", - "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" - }, - "time": "2022-06-18T07:21:10+00:00" - }, - { - "name": "theseer/tokenizer", - "version": "1.2.1", - "source": { - "type": "git", - "url": "https://github.com/theseer/tokenizer.git", - "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e", - "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": "^7.2 || ^8.0" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - } - ], - "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", - "support": { - "issues": "https://github.com/theseer/tokenizer/issues", - "source": "https://github.com/theseer/tokenizer/tree/1.2.1" - }, - "funding": [ - { - "url": "https://github.com/theseer", - "type": "github" - } - ], - "time": "2021-07-28T10:34:58+00:00" - } - ], - "aliases": [], - "minimum-stability": "stable", - "stability-flags": [], - "prefer-stable": false, - "prefer-lowest": false, - "platform": [], - "platform-dev": { - "php": "^8.0" - }, - "plugin-api-version": "2.3.0" -} diff --git a/system/vendor/akrabat/proxy-detection-middleware/phpcs.xml b/system/vendor/akrabat/proxy-detection-middleware/phpcs.xml deleted file mode 100644 index baa2623..0000000 --- a/system/vendor/akrabat/proxy-detection-middleware/phpcs.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - src - tests - - diff --git a/system/vendor/akrabat/proxy-detection-middleware/phpunit.xml b/system/vendor/akrabat/proxy-detection-middleware/phpunit.xml deleted file mode 100644 index e9073ae..0000000 --- a/system/vendor/akrabat/proxy-detection-middleware/phpunit.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - ./tests/ - - - - - ./src - - - diff --git a/system/vendor/akrabat/proxy-detection-middleware/src/ProxyDetection.php b/system/vendor/akrabat/proxy-detection-middleware/src/ProxyDetection.php deleted file mode 100644 index cd214ee..0000000 --- a/system/vendor/akrabat/proxy-detection-middleware/src/ProxyDetection.php +++ /dev/null @@ -1,143 +0,0 @@ -trustedProxies = $trustedProxies; - } - - public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface - { - return $handler->handle($this->updateRequest($request)); - } - - /** - * Override the request URI's scheme, host and port as determined from the proxy headers - * - * @param ServerRequestInterface $request PSR7 request - * @param ResponseInterface $response PSR7 response - * @param callable $next Next middleware - * - * @return ResponseInterface - */ - public function __invoke(ServerRequestInterface $request, ResponseInterface $response, $next) - { - if (!$next) { - return $response; - } - - return $next($this->updateRequest($request), $response); - } - - protected function updateRequest(ServerRequestInterface $request): ServerRequestInterface - { - if (!empty($this->trustedProxies)) { - // get IP address from REMOTE_ADDR - $ipAddress = null; - $serverParams = $request->getServerParams(); - if (isset($serverParams['REMOTE_ADDR']) && $this->isValidIpAddress($serverParams['REMOTE_ADDR'])) { - $ipAddress = $serverParams['REMOTE_ADDR']; - } - - if (!in_array($ipAddress, $this->trustedProxies)) { - return $request; - } - } - - $uri = $request->getUri(); - - $uri = $this->processProtoHeader($request, $uri); - $uri = $this->processPortHeader($request, $uri); - $uri = $this->processHostHeader($request, $uri); - - return $request->withUri($uri); - } - - /** - * Check that a given string is a valid IP address - * - * @param string $ip - * @return boolean - */ - protected function isValidIpAddress($ip) - { - $flags = FILTER_FLAG_IPV4 | FILTER_FLAG_IPV6; - if (filter_var($ip, FILTER_VALIDATE_IP, $flags) === false) { - return false; - } - return true; - } - - protected function processProtoHeader(ServerRequestInterface $request, UriInterface $uri) - { - if ($request->hasHeader('X-Forwarded-Proto')) { - $scheme = $request->getHeaderLine('X-Forwarded-Proto'); - - if (in_array($scheme, ['http', 'https'])) { - return $uri->withScheme($scheme); - } - } - return $uri; - } - - protected function processPortHeader(ServerRequestInterface $request, UriInterface $uri) - { - if ($request->hasHeader('X-Forwarded-Port')) { - $port = trim(current(explode(',', $request->getHeaderLine('X-Forwarded-Port')))); - - if (preg_match('/^\d+\z/', $port)) { - return $uri->withPort((int) $port); - } - } - return $uri; - } - - protected function processHostHeader(ServerRequestInterface $request, UriInterface $uri) - { - if ($request->hasHeader('X-Forwarded-Host')) { - $host = trim(current(explode(',', $request->getHeaderLine('X-Forwarded-Host')))); - - $port = null; - if (preg_match('/^(\[[a-fA-F0-9:.]+\])(:\d+)?\z/', $host, $matches)) { - $host = $matches[1]; - if ($matches[2]) { - $port = (int) substr($matches[2], 1); - } - } else { - $pos = strpos($host, ':'); - if ($pos !== false) { - $port = (int) substr($host, $pos + 1); - $host = strstr($host, ':', true); - } - } - $uri = $uri->withHost($host); - if ($port) { - $uri = $uri->withPort($port); - } - } - return $uri; - } -} diff --git a/system/vendor/akrabat/proxy-detection-middleware/tests/ProxyDetectionTest.php b/system/vendor/akrabat/proxy-detection-middleware/tests/ProxyDetectionTest.php deleted file mode 100644 index f55977f..0000000 --- a/system/vendor/akrabat/proxy-detection-middleware/tests/ProxyDetectionTest.php +++ /dev/null @@ -1,136 +0,0 @@ - '1.2.3.4', - 'HTTP_HOST' => 'foo.com', - 'HTTP_X_FORWARDED_PROTO' => 'https', - 'HTTP_X_FORWARDED_HOST' => 'example.com:1234', - ]); - - $response = new Response(); - - $middleware = new ProxyDetection(); - $middleware($request, $response, function ($request, $response) use (&$scheme, &$host, &$port) { - // simply store the values - $scheme = $request->getUri()->getScheme(); - $host = $request->getUri()->getHost(); - $port = $request->getUri()->getPort(); - return $response; - }); - - $this->assertSame('https', $scheme); - $this->assertSame('example.com', $host); - $this->assertSame(1234, $port); - } - - public function testSchemeAndHostAndPortWithPortInPortHeader() - { - $request = ServerRequestFactory::fromGlobals([ - 'REMOTE_ADDR' => '1.2.3.4', - 'HTTP_HOST' => 'foo.com', - 'HTTP_X_FORWARDED_PROTO' => 'https', - 'HTTP_X_FORWARDED_HOST' => 'example.com', - 'HTTP_X_FORWARDED_PORT' => '1234', - ]); - - $response = new Response(); - - $middleware = new ProxyDetection(); - $middleware($request, $response, function ($request, $response) use (&$scheme, &$host, &$port) { - // simply store the values - $scheme = $request->getUri()->getScheme(); - $host = $request->getUri()->getHost(); - $port = $request->getUri()->getPort(); - return $response; - }); - - $this->assertSame('https', $scheme); - $this->assertSame('example.com', $host); - $this->assertSame(1234, $port); - } - - public function testSchemeAndHostAndPortWithPortInHostAndPortHeader() - { - $request = ServerRequestFactory::fromGlobals([ - 'REMOTE_ADDR' => '1.2.3.4', - 'HTTP_HOST' => 'foo.com', - 'HTTP_X_FORWARDED_PROTO' => 'https', - 'HTTP_X_FORWARDED_HOST' => 'example.com:1000', - 'HTTP_X_FORWARDED_PORT' => '2000', - ]); - - $response = new Response(); - - $middleware = new ProxyDetection(); - $middleware($request, $response, function ($request, $response) use (&$scheme, &$host, &$port) { - // simply store the values - $scheme = $request->getUri()->getScheme(); - $host = $request->getUri()->getHost(); - $port = $request->getUri()->getPort(); - return $response; - }); - - $this->assertSame('https', $scheme); - $this->assertSame('example.com', $host); - $this->assertSame(1000, $port); - } - - public function testTrustedProxies() - { - $request = ServerRequestFactory::fromGlobals([ - 'REMOTE_ADDR' => '1.2.3.4', - 'HTTP_HOST' => 'foo.com', - 'HTTP_X_FORWARDED_PROTO' => 'https', - 'HTTP_X_FORWARDED_HOST' => 'example.com:1234', - ]); - - $response = new Response(); - - $middleware = new ProxyDetection(['1.2.3.4']); - $middleware($request, $response, function ($request, $response) use (&$scheme, &$host, &$port) { - // simply store the values - $scheme = $request->getUri()->getScheme(); - $host = $request->getUri()->getHost(); - $port = $request->getUri()->getPort(); - return $response; - }); - - $this->assertSame('https', $scheme); - $this->assertSame('example.com', $host); - $this->assertSame(1234, $port); - } - - public function testNonTrustedProxiesIgnoreXForwardedHost() - { - $request = ServerRequestFactory::fromGlobals([ - 'REMOTE_ADDR' => '4.3.2.1', - 'HTTP_HOST' => 'foo.com', - 'HTTP_X_FORWARDED_HOST' => 'example.com:1234', - ]); - - $response = new Response(); - - $middleware = new ProxyDetection(['1.2.3.4']); - $middleware($request, $response, function ($request, $response) use (&$scheme, &$host, &$port) { - // simply store the values - $scheme = $request->getUri()->getScheme(); - $host = $request->getUri()->getHost(); - $port = $request->getUri()->getPort(); - return $response; - }); - - $this->assertSame('http', $scheme); - $this->assertSame('foo.com', $host); - $this->assertSame(null, $port); - } -} diff --git a/system/vendor/autoload.php b/system/vendor/autoload.php deleted file mode 100644 index 995bad2..0000000 --- a/system/vendor/autoload.php +++ /dev/null @@ -1,12 +0,0 @@ -realpath = realpath($opened_path) ?: $opened_path; - $opened_path = $this->realpath; - $this->handle = fopen($this->realpath, $mode); - $this->position = 0; - - return (bool) $this->handle; - } - - public function stream_read($count) - { - $data = fread($this->handle, $count); - - if ($this->position === 0) { - $data = preg_replace('{^#!.*\r?\n}', '', $data); - } - - $this->position += strlen($data); - - return $data; - } - - public function stream_cast($castAs) - { - return $this->handle; - } - - public function stream_close() - { - fclose($this->handle); - } - - public function stream_lock($operation) - { - return $operation ? flock($this->handle, $operation) : true; - } - - public function stream_seek($offset, $whence) - { - if (0 === fseek($this->handle, $offset, $whence)) { - $this->position = ftell($this->handle); - return true; - } - - return false; - } - - public function stream_tell() - { - return $this->position; - } - - public function stream_eof() - { - return feof($this->handle); - } - - public function stream_stat() - { - return array(); - } - - public function stream_set_option($option, $arg1, $arg2) - { - return true; - } - - public function url_stat($path, $flags) - { - $path = substr($path, 17); - if (file_exists($path)) { - return stat($path); - } - - return false; - } - } - } - - if (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper')) { - include("phpvfscomposer://" . __DIR__ . '/..'.'/symfony/yaml/Resources/bin/yaml-lint'); - exit(0); - } -} - -include __DIR__ . '/..'.'/symfony/yaml/Resources/bin/yaml-lint'; diff --git a/system/vendor/composer/ClassLoader.php b/system/vendor/composer/ClassLoader.php deleted file mode 100644 index afef3fa..0000000 --- a/system/vendor/composer/ClassLoader.php +++ /dev/null @@ -1,572 +0,0 @@ - - * Jordi Boggiano - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Composer\Autoload; - -/** - * ClassLoader implements a PSR-0, PSR-4 and classmap class loader. - * - * $loader = new \Composer\Autoload\ClassLoader(); - * - * // register classes with namespaces - * $loader->add('Symfony\Component', __DIR__.'/component'); - * $loader->add('Symfony', __DIR__.'/framework'); - * - * // activate the autoloader - * $loader->register(); - * - * // to enable searching the include path (eg. for PEAR packages) - * $loader->setUseIncludePath(true); - * - * In this example, if you try to use a class in the Symfony\Component - * namespace or one of its children (Symfony\Component\Console for instance), - * the autoloader will first look for the class under the component/ - * directory, and it will then fallback to the framework/ directory if not - * found before giving up. - * - * This class is loosely based on the Symfony UniversalClassLoader. - * - * @author Fabien Potencier - * @author Jordi Boggiano - * @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', 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 string[] $classMap Class to filename map - * @psalm-param array $classMap - * - * @return void - */ - public function addClassMap(array $classMap) - { - if ($this->classMap) { - $this->classMap = array_merge($this->classMap, $classMap); - } else { - $this->classMap = $classMap; - } - } - - /** - * 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 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) - { - if (!$prefix) { - if ($prepend) { - $this->fallbackDirsPsr0 = array_merge( - (array) $paths, - $this->fallbackDirsPsr0 - ); - } else { - $this->fallbackDirsPsr0 = array_merge( - $this->fallbackDirsPsr0, - (array) $paths - ); - } - - return; - } - - $first = $prefix[0]; - if (!isset($this->prefixesPsr0[$first][$prefix])) { - $this->prefixesPsr0[$first][$prefix] = (array) $paths; - - return; - } - if ($prepend) { - $this->prefixesPsr0[$first][$prefix] = array_merge( - (array) $paths, - $this->prefixesPsr0[$first][$prefix] - ); - } else { - $this->prefixesPsr0[$first][$prefix] = array_merge( - $this->prefixesPsr0[$first][$prefix], - (array) $paths - ); - } - } - - /** - * 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 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) - { - if (!$prefix) { - // Register directories for the root namespace. - if ($prepend) { - $this->fallbackDirsPsr4 = array_merge( - (array) $paths, - $this->fallbackDirsPsr4 - ); - } else { - $this->fallbackDirsPsr4 = array_merge( - $this->fallbackDirsPsr4, - (array) $paths - ); - } - } elseif (!isset($this->prefixDirsPsr4[$prefix])) { - // Register directories for a new namespace. - $length = strlen($prefix); - if ('\\' !== $prefix[$length - 1]) { - throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); - } - $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; - $this->prefixDirsPsr4[$prefix] = (array) $paths; - } elseif ($prepend) { - // Prepend directories for an already registered namespace. - $this->prefixDirsPsr4[$prefix] = array_merge( - (array) $paths, - $this->prefixDirsPsr4[$prefix] - ); - } else { - // Append directories for an already registered namespace. - $this->prefixDirsPsr4[$prefix] = array_merge( - $this->prefixDirsPsr4[$prefix], - (array) $paths - ); - } - } - - /** - * 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 string[]|string $paths The PSR-0 base directories - * - * @return void - */ - public function set($prefix, $paths) - { - if (!$prefix) { - $this->fallbackDirsPsr0 = (array) $paths; - } else { - $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths; - } - } - - /** - * 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 string[]|string $paths The PSR-4 base directories - * - * @throws \InvalidArgumentException - * - * @return void - */ - public function setPsr4($prefix, $paths) - { - if (!$prefix) { - $this->fallbackDirsPsr4 = (array) $paths; - } else { - $length = strlen($prefix); - if ('\\' !== $prefix[$length - 1]) { - throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); - } - $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; - $this->prefixDirsPsr4[$prefix] = (array) $paths; - } - } - - /** - * Turns on searching the include path for class files. - * - * @param bool $useIncludePath - * - * @return void - */ - public function setUseIncludePath($useIncludePath) - { - $this->useIncludePath = $useIncludePath; - } - - /** - * Can be used to check if the autoloader uses the include path to check - * for classes. - * - * @return bool - */ - public function getUseIncludePath() - { - return $this->useIncludePath; - } - - /** - * Turns off searching the prefix and fallback directories for classes - * that have not been registered with the class map. - * - * @param bool $classMapAuthoritative - * - * @return void - */ - public function setClassMapAuthoritative($classMapAuthoritative) - { - $this->classMapAuthoritative = $classMapAuthoritative; - } - - /** - * Should class lookup fail if not found in the current class map? - * - * @return bool - */ - public function isClassMapAuthoritative() - { - return $this->classMapAuthoritative; - } - - /** - * 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') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null; - } - - /** - * The APCu prefix in use, or null if APCu caching is not enabled. - * - * @return string|null - */ - public function getApcuPrefix() - { - return $this->apcuPrefix; - } - - /** - * 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 true|null True if loaded, null otherwise - */ - public function loadClass($class) - { - if ($file = $this->findFile($class)) { - includeFile($file); - - return true; - } - - return null; - } - - /** - * Finds the path to the file where the class is defined. - * - * @param string $class The name of the class - * - * @return string|false The path if found, false otherwise - */ - public function findFile($class) - { - // class map lookup - if (isset($this->classMap[$class])) { - return $this->classMap[$class]; - } - if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) { - return false; - } - if (null !== $this->apcuPrefix) { - $file = apcu_fetch($this->apcuPrefix.$class, $hit); - if ($hit) { - return $file; - } - } - - $file = $this->findFileWithExtension($class, '.php'); - - // Search for Hack files if we are running on HHVM - if (false === $file && defined('HHVM_VERSION')) { - $file = $this->findFileWithExtension($class, '.hh'); - } - - if (null !== $this->apcuPrefix) { - apcu_add($this->apcuPrefix.$class, $file); - } - - if (false === $file) { - // Remember that this class does not exist. - $this->missingClasses[$class] = true; - } - - 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 - $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext; - - $first = $class[0]; - if (isset($this->prefixLengthsPsr4[$first])) { - $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; - } - } - } - } - } - - // PSR-4 fallback dirs - foreach ($this->fallbackDirsPsr4 as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { - return $file; - } - } - - // PSR-0 lookup - if (false !== $pos = strrpos($class, '\\')) { - // namespaced class name - $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1) - . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR); - } else { - // PEAR-like class name - $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext; - } - - if (isset($this->prefixesPsr0[$first])) { - foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) { - if (0 === strpos($class, $prefix)) { - foreach ($dirs as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { - return $file; - } - } - } - } - } - - // PSR-0 fallback dirs - foreach ($this->fallbackDirsPsr0 as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { - return $file; - } - } - - // PSR-0 include paths. - if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) { - return $file; - } - - return false; - } -} - -/** - * Scope isolated include. - * - * Prevents access to $this/self from included files. - * - * @param string $file - * @return void - * @private - */ -function includeFile($file) -{ - include $file; -} diff --git a/system/vendor/composer/InstalledVersions.php b/system/vendor/composer/InstalledVersions.php deleted file mode 100644 index 41bc143..0000000 --- a/system/vendor/composer/InstalledVersions.php +++ /dev/null @@ -1,352 +0,0 @@ - - * 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` - * - * @final - */ -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/system/vendor/composer/LICENSE b/system/vendor/composer/LICENSE deleted file mode 100644 index f27399a..0000000 --- a/system/vendor/composer/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ - -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 -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/system/vendor/composer/autoload_classmap.php b/system/vendor/composer/autoload_classmap.php deleted file mode 100644 index 31dac2b..0000000 --- a/system/vendor/composer/autoload_classmap.php +++ /dev/null @@ -1,17 +0,0 @@ - $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Attribute.php', - 'CURLStringFile' => $vendorDir . '/symfony/polyfill-php81/Resources/stubs/CURLStringFile.php', - 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php', - 'PhpToken' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php', - 'ReturnTypeWillChange' => $vendorDir . '/symfony/polyfill-php81/Resources/stubs/ReturnTypeWillChange.php', - 'Stringable' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Stringable.php', - 'UnhandledMatchError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php', - 'ValueError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/ValueError.php', -); diff --git a/system/vendor/composer/autoload_files.php b/system/vendor/composer/autoload_files.php deleted file mode 100644 index 7c39774..0000000 --- a/system/vendor/composer/autoload_files.php +++ /dev/null @@ -1,17 +0,0 @@ - $vendorDir . '/symfony/polyfill-php80/bootstrap.php', - '6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php', - '253c157292f75eb38082b5acb06f3f01' => $vendorDir . '/nikic/fast-route/src/functions.php', - '320cde22f66dd4f5d3fd621d3e88b98f' => $vendorDir . '/symfony/polyfill-ctype/bootstrap.php', - '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php', - 'b33e3d135e5d9e47d845c576147bda89' => $vendorDir . '/php-di/php-di/src/functions.php', - '7b11c4dc42b3b3023073cb14e519683c' => $vendorDir . '/ralouphie/getallheaders/src/getallheaders.php', - '23c18046f52bef3eea034657bafda50f' => $vendorDir . '/symfony/polyfill-php81/bootstrap.php', -); diff --git a/system/vendor/composer/autoload_namespaces.php b/system/vendor/composer/autoload_namespaces.php deleted file mode 100644 index ae47385..0000000 --- a/system/vendor/composer/autoload_namespaces.php +++ /dev/null @@ -1,12 +0,0 @@ - array($vendorDir . '/jbroadway/urlify'), - 'ParsedownExtra' => array($vendorDir . '/erusev/parsedown-extra'), - 'Parsedown' => array($vendorDir . '/erusev/parsedown'), -); diff --git a/system/vendor/composer/autoload_psr4.php b/system/vendor/composer/autoload_psr4.php deleted file mode 100644 index c70cf09..0000000 --- a/system/vendor/composer/autoload_psr4.php +++ /dev/null @@ -1,41 +0,0 @@ - array($vendorDir . '/vlucas/valitron/src/Valitron'), - 'Typemill\\' => array($baseDir . '/system/typemill'), - 'Twig\\' => array($vendorDir . '/twig/twig/src'), - 'Symfony\\Polyfill\\Php81\\' => array($vendorDir . '/symfony/polyfill-php81'), - 'Symfony\\Polyfill\\Php80\\' => array($vendorDir . '/symfony/polyfill-php80'), - 'Symfony\\Polyfill\\Mbstring\\' => array($vendorDir . '/symfony/polyfill-mbstring'), - 'Symfony\\Polyfill\\Ctype\\' => array($vendorDir . '/symfony/polyfill-ctype'), - 'Symfony\\Contracts\\EventDispatcher\\' => array($vendorDir . '/symfony/event-dispatcher-contracts'), - 'Symfony\\Component\\Yaml\\' => array($vendorDir . '/symfony/yaml'), - 'Symfony\\Component\\Finder\\' => array($vendorDir . '/symfony/finder'), - 'Symfony\\Component\\EventDispatcher\\' => array($vendorDir . '/symfony/event-dispatcher'), - 'Slim\\Views\\' => array($vendorDir . '/slim/twig-view/src'), - 'Slim\\Psr7\\' => array($vendorDir . '/slim/psr7/src'), - 'Slim\\Flash\\' => array($vendorDir . '/slim/flash/src'), - 'Slim\\Csrf\\' => array($vendorDir . '/slim/csrf/src'), - 'Slim\\' => array($vendorDir . '/slim/slim/Slim'), - 'RKA\\Middleware\\' => array($vendorDir . '/akrabat/proxy-detection-middleware/src'), - 'Psr\\Log\\' => array($vendorDir . '/psr/log/src'), - 'Psr\\Http\\Server\\' => array($vendorDir . '/psr/http-server-handler/src', $vendorDir . '/psr/http-server-middleware/src'), - 'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-factory/src', $vendorDir . '/psr/http-message/src'), - 'Psr\\EventDispatcher\\' => array($vendorDir . '/psr/event-dispatcher/src'), - 'Psr\\Container\\' => array($vendorDir . '/psr/container/src'), - 'Plugins\\' => array($baseDir . '/plugins'), - 'PhpDocReader\\' => array($vendorDir . '/php-di/phpdoc-reader/src/PhpDocReader'), - 'Laravel\\SerializableClosure\\' => array($vendorDir . '/laravel/serializable-closure/src'), - 'Laminas\\Permissions\\Acl\\' => array($vendorDir . '/laminas/laminas-permissions-acl/src'), - 'Invoker\\' => array($vendorDir . '/php-di/invoker/src'), - 'Gregwar\\' => array($vendorDir . '/gregwar/captcha/src/Gregwar'), - 'Fig\\Http\\Message\\' => array($vendorDir . '/fig/http-message-util/src'), - 'FastRoute\\' => array($vendorDir . '/nikic/fast-route/src'), - 'DI\\Bridge\\Slim\\' => array($vendorDir . '/php-di/slim-bridge/src'), - 'DI\\' => array($vendorDir . '/php-di/php-di/src'), -); diff --git a/system/vendor/composer/autoload_real.php b/system/vendor/composer/autoload_real.php deleted file mode 100644 index 5e62dfe..0000000 --- a/system/vendor/composer/autoload_real.php +++ /dev/null @@ -1,57 +0,0 @@ -register(true); - - $includeFiles = \Composer\Autoload\ComposerStaticInit836351be733ecbf4741aea17e1973480::$files; - foreach ($includeFiles as $fileIdentifier => $file) { - composerRequire836351be733ecbf4741aea17e1973480($fileIdentifier, $file); - } - - return $loader; - } -} - -/** - * @param string $fileIdentifier - * @param string $file - * @return void - */ -function composerRequire836351be733ecbf4741aea17e1973480($fileIdentifier, $file) -{ - if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { - $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; - - require $file; - } -} diff --git a/system/vendor/composer/autoload_static.php b/system/vendor/composer/autoload_static.php deleted file mode 100644 index 43ac4a2..0000000 --- a/system/vendor/composer/autoload_static.php +++ /dev/null @@ -1,260 +0,0 @@ - __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php', - '6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.php', - '253c157292f75eb38082b5acb06f3f01' => __DIR__ . '/..' . '/nikic/fast-route/src/functions.php', - '320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php', - '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php', - 'b33e3d135e5d9e47d845c576147bda89' => __DIR__ . '/..' . '/php-di/php-di/src/functions.php', - '7b11c4dc42b3b3023073cb14e519683c' => __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php', - '23c18046f52bef3eea034657bafda50f' => __DIR__ . '/..' . '/symfony/polyfill-php81/bootstrap.php', - ); - - public static $prefixLengthsPsr4 = array ( - 'V' => - array ( - 'Valitron\\' => 9, - ), - 'T' => - array ( - 'Typemill\\' => 9, - 'Twig\\' => 5, - ), - 'S' => - array ( - 'Symfony\\Polyfill\\Php81\\' => 23, - 'Symfony\\Polyfill\\Php80\\' => 23, - 'Symfony\\Polyfill\\Mbstring\\' => 26, - 'Symfony\\Polyfill\\Ctype\\' => 23, - 'Symfony\\Contracts\\EventDispatcher\\' => 34, - 'Symfony\\Component\\Yaml\\' => 23, - 'Symfony\\Component\\Finder\\' => 25, - 'Symfony\\Component\\EventDispatcher\\' => 34, - 'Slim\\Views\\' => 11, - 'Slim\\Psr7\\' => 10, - 'Slim\\Flash\\' => 11, - 'Slim\\Csrf\\' => 10, - 'Slim\\' => 5, - ), - 'R' => - array ( - 'RKA\\Middleware\\' => 15, - ), - 'P' => - array ( - 'Psr\\Log\\' => 8, - 'Psr\\Http\\Server\\' => 16, - 'Psr\\Http\\Message\\' => 17, - 'Psr\\EventDispatcher\\' => 20, - 'Psr\\Container\\' => 14, - 'Plugins\\' => 8, - 'PhpDocReader\\' => 13, - ), - 'L' => - array ( - 'Laravel\\SerializableClosure\\' => 28, - 'Laminas\\Permissions\\Acl\\' => 24, - ), - 'I' => - array ( - 'Invoker\\' => 8, - ), - 'G' => - array ( - 'Gregwar\\' => 8, - ), - 'F' => - array ( - 'Fig\\Http\\Message\\' => 17, - 'FastRoute\\' => 10, - ), - 'D' => - array ( - 'DI\\Bridge\\Slim\\' => 15, - 'DI\\' => 3, - ), - ); - - public static $prefixDirsPsr4 = array ( - 'Valitron\\' => - array ( - 0 => __DIR__ . '/..' . '/vlucas/valitron/src/Valitron', - ), - 'Typemill\\' => - array ( - 0 => __DIR__ . '/../../..' . '/system/typemill', - ), - 'Twig\\' => - array ( - 0 => __DIR__ . '/..' . '/twig/twig/src', - ), - 'Symfony\\Polyfill\\Php81\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/polyfill-php81', - ), - 'Symfony\\Polyfill\\Php80\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/polyfill-php80', - ), - 'Symfony\\Polyfill\\Mbstring\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/polyfill-mbstring', - ), - 'Symfony\\Polyfill\\Ctype\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/polyfill-ctype', - ), - 'Symfony\\Contracts\\EventDispatcher\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/event-dispatcher-contracts', - ), - 'Symfony\\Component\\Yaml\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/yaml', - ), - 'Symfony\\Component\\Finder\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/finder', - ), - 'Symfony\\Component\\EventDispatcher\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/event-dispatcher', - ), - 'Slim\\Views\\' => - array ( - 0 => __DIR__ . '/..' . '/slim/twig-view/src', - ), - 'Slim\\Psr7\\' => - array ( - 0 => __DIR__ . '/..' . '/slim/psr7/src', - ), - 'Slim\\Flash\\' => - array ( - 0 => __DIR__ . '/..' . '/slim/flash/src', - ), - 'Slim\\Csrf\\' => - array ( - 0 => __DIR__ . '/..' . '/slim/csrf/src', - ), - 'Slim\\' => - array ( - 0 => __DIR__ . '/..' . '/slim/slim/Slim', - ), - 'RKA\\Middleware\\' => - array ( - 0 => __DIR__ . '/..' . '/akrabat/proxy-detection-middleware/src', - ), - 'Psr\\Log\\' => - array ( - 0 => __DIR__ . '/..' . '/psr/log/src', - ), - 'Psr\\Http\\Server\\' => - array ( - 0 => __DIR__ . '/..' . '/psr/http-server-handler/src', - 1 => __DIR__ . '/..' . '/psr/http-server-middleware/src', - ), - 'Psr\\Http\\Message\\' => - array ( - 0 => __DIR__ . '/..' . '/psr/http-factory/src', - 1 => __DIR__ . '/..' . '/psr/http-message/src', - ), - 'Psr\\EventDispatcher\\' => - array ( - 0 => __DIR__ . '/..' . '/psr/event-dispatcher/src', - ), - 'Psr\\Container\\' => - array ( - 0 => __DIR__ . '/..' . '/psr/container/src', - ), - 'Plugins\\' => - array ( - 0 => __DIR__ . '/../../..' . '/plugins', - ), - 'PhpDocReader\\' => - array ( - 0 => __DIR__ . '/..' . '/php-di/phpdoc-reader/src/PhpDocReader', - ), - 'Laravel\\SerializableClosure\\' => - array ( - 0 => __DIR__ . '/..' . '/laravel/serializable-closure/src', - ), - 'Laminas\\Permissions\\Acl\\' => - array ( - 0 => __DIR__ . '/..' . '/laminas/laminas-permissions-acl/src', - ), - 'Invoker\\' => - array ( - 0 => __DIR__ . '/..' . '/php-di/invoker/src', - ), - 'Gregwar\\' => - array ( - 0 => __DIR__ . '/..' . '/gregwar/captcha/src/Gregwar', - ), - 'Fig\\Http\\Message\\' => - array ( - 0 => __DIR__ . '/..' . '/fig/http-message-util/src', - ), - 'FastRoute\\' => - array ( - 0 => __DIR__ . '/..' . '/nikic/fast-route/src', - ), - 'DI\\Bridge\\Slim\\' => - array ( - 0 => __DIR__ . '/..' . '/php-di/slim-bridge/src', - ), - 'DI\\' => - array ( - 0 => __DIR__ . '/..' . '/php-di/php-di/src', - ), - ); - - public static $prefixesPsr0 = array ( - 'U' => - array ( - 'URLify' => - array ( - 0 => __DIR__ . '/..' . '/jbroadway/urlify', - ), - ), - 'P' => - array ( - 'ParsedownExtra' => - array ( - 0 => __DIR__ . '/..' . '/erusev/parsedown-extra', - ), - 'Parsedown' => - array ( - 0 => __DIR__ . '/..' . '/erusev/parsedown', - ), - ), - ); - - public static $classMap = array ( - 'Attribute' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Attribute.php', - 'CURLStringFile' => __DIR__ . '/..' . '/symfony/polyfill-php81/Resources/stubs/CURLStringFile.php', - 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', - 'PhpToken' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php', - 'ReturnTypeWillChange' => __DIR__ . '/..' . '/symfony/polyfill-php81/Resources/stubs/ReturnTypeWillChange.php', - 'Stringable' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Stringable.php', - 'UnhandledMatchError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php', - 'ValueError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/ValueError.php', - ); - - public static function getInitializer(ClassLoader $loader) - { - return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInit836351be733ecbf4741aea17e1973480::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInit836351be733ecbf4741aea17e1973480::$prefixDirsPsr4; - $loader->prefixesPsr0 = ComposerStaticInit836351be733ecbf4741aea17e1973480::$prefixesPsr0; - $loader->classMap = ComposerStaticInit836351be733ecbf4741aea17e1973480::$classMap; - - }, null, ClassLoader::class); - } -} diff --git a/system/vendor/composer/installed.json b/system/vendor/composer/installed.json deleted file mode 100644 index 14782a3..0000000 --- a/system/vendor/composer/installed.json +++ /dev/null @@ -1,2439 +0,0 @@ -{ - "packages": [ - { - "name": "akrabat/proxy-detection-middleware", - "version": "1.0", - "version_normalized": "1.0.0.0", - "source": { - "type": "git", - "url": "https://github.com/akrabat/proxy-detection-middleware.git", - "reference": "90472f490e56ad23afc36b0d95c24cd48fa331d7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/akrabat/proxy-detection-middleware/zipball/90472f490e56ad23afc36b0d95c24cd48fa331d7", - "reference": "90472f490e56ad23afc36b0d95c24cd48fa331d7", - "shasum": "" - }, - "require": { - "psr/http-message": "^1.0", - "psr/http-server-middleware": "^1.0" - }, - "require-dev": { - "laminas/laminas-diactoros": "^2.24", - "php": "^8.0", - "phpunit/phpunit": "^9.6", - "squizlabs/php_codesniffer": "^3.7" - }, - "time": "2023-02-17T18:13:01+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "RKA\\Middleware\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Rob Allen", - "email": "rob@akrabat.com", - "homepage": "http://akrabat.com" - } - ], - "description": "PSR-7/PSR-15 Middleware that determines the scheme, host and port from the 'X-Forwarded-Proto', 'X-Forwarded-Host' and 'X-Forwarded-Port' headers and updates the Request's Uri object.", - "homepage": "http://github.com/akrabat/proxy-detection-middleware", - "keywords": [ - "IP", - "middleware", - "psr7" - ], - "support": { - "issues": "https://github.com/akrabat/proxy-detection-middleware/issues", - "source": "https://github.com/akrabat/proxy-detection-middleware/tree/1.0" - }, - "install-path": "../akrabat/proxy-detection-middleware" - }, - { - "name": "erusev/parsedown", - "version": "1.8.0-beta-7", - "version_normalized": "1.8.0.0-beta7", - "source": { - "type": "git", - "url": "https://github.com/erusev/parsedown.git", - "reference": "fe7a50eceb4a3c867cc9fa9c0aa906b1067d1955" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/erusev/parsedown/zipball/fe7a50eceb4a3c867cc9fa9c0aa906b1067d1955", - "reference": "fe7a50eceb4a3c867cc9fa9c0aa906b1067d1955", - "shasum": "" - }, - "require": { - "ext-mbstring": "*", - "php": ">=5.3.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.35" - }, - "time": "2019-03-17T18:47:21+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-0": { - "Parsedown": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Emanuil Rusev", - "email": "hello@erusev.com", - "homepage": "http://erusev.com" - } - ], - "description": "Parser for Markdown.", - "homepage": "http://parsedown.org", - "keywords": [ - "markdown", - "parser" - ], - "support": { - "issues": "https://github.com/erusev/parsedown/issues", - "source": "https://github.com/erusev/parsedown/tree/1.8.0-beta-7" - }, - "install-path": "../erusev/parsedown" - }, - { - "name": "erusev/parsedown-extra", - "version": "dev-master", - "version_normalized": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/erusev/parsedown-extra.git", - "reference": "fd33d68349630d18d56367712a64445a6e0bc83e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/erusev/parsedown-extra/zipball/fd33d68349630d18d56367712a64445a6e0bc83e", - "reference": "fd33d68349630d18d56367712a64445a6e0bc83e", - "shasum": "" - }, - "require": { - "erusev/parsedown": "^1.8.0|^1.8.0-beta-4", - "ext-dom": "*", - "ext-mbstring": "*", - "php": ">=5.3.6" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.35" - }, - "time": "2021-10-25T08:46:29+00:00", - "default-branch": true, - "type": "library", - "installation-source": "source", - "autoload": { - "psr-0": { - "ParsedownExtra": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Emanuil Rusev", - "email": "hello@erusev.com", - "homepage": "http://erusev.com" - } - ], - "description": "An extension of Parsedown that adds support for Markdown Extra.", - "homepage": "https://github.com/erusev/parsedown-extra", - "keywords": [ - "markdown", - "markdown extra", - "parsedown", - "parser" - ], - "support": { - "issues": "https://github.com/erusev/parsedown-extra/issues", - "source": "https://github.com/erusev/parsedown-extra/tree/master" - }, - "install-path": "../erusev/parsedown-extra" - }, - { - "name": "fig/http-message-util", - "version": "1.1.5", - "version_normalized": "1.1.5.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-message-util.git", - "reference": "9d94dc0154230ac39e5bf89398b324a86f63f765" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message-util/zipball/9d94dc0154230ac39e5bf89398b324a86f63f765", - "reference": "9d94dc0154230ac39e5bf89398b324a86f63f765", - "shasum": "" - }, - "require": { - "php": "^5.3 || ^7.0 || ^8.0" - }, - "suggest": { - "psr/http-message": "The package containing the PSR-7 interfaces" - }, - "time": "2020-11-24T22:02:12+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Fig\\Http\\Message\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Utility classes and constants for use with PSR-7 (psr/http-message)", - "keywords": [ - "http", - "http-message", - "psr", - "psr-7", - "request", - "response" - ], - "support": { - "issues": "https://github.com/php-fig/http-message-util/issues", - "source": "https://github.com/php-fig/http-message-util/tree/1.1.5" - }, - "install-path": "../fig/http-message-util" - }, - { - "name": "gregwar/captcha", - "version": "dev-master", - "version_normalized": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/Gregwar/Captcha.git", - "reference": "229d3cdfe33d6f1349e0aec94a26e9205a6db08e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Gregwar/Captcha/zipball/229d3cdfe33d6f1349e0aec94a26e9205a6db08e", - "reference": "229d3cdfe33d6f1349e0aec94a26e9205a6db08e", - "shasum": "" - }, - "require": { - "ext-gd": "*", - "ext-mbstring": "*", - "php": ">=5.3.0", - "symfony/finder": "*" - }, - "require-dev": { - "phpunit/phpunit": "^6.4" - }, - "time": "2023-09-26T13:45:37+00:00", - "default-branch": true, - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Gregwar\\": "src/Gregwar" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Grégoire Passault", - "email": "g.passault@gmail.com", - "homepage": "http://www.gregwar.com/" - }, - { - "name": "Jeremy Livingston", - "email": "jeremy.j.livingston@gmail.com" - } - ], - "description": "Captcha generator", - "homepage": "https://github.com/Gregwar/Captcha", - "keywords": [ - "bot", - "captcha", - "spam" - ], - "support": { - "issues": "https://github.com/Gregwar/Captcha/issues", - "source": "https://github.com/Gregwar/Captcha/tree/v1.2.1" - }, - "install-path": "../gregwar/captcha" - }, - { - "name": "jbroadway/urlify", - "version": "1.1.3-stable", - "version_normalized": "1.1.3.0", - "source": { - "type": "git", - "url": "https://github.com/jbroadway/urlify.git", - "reference": "37fe4e7680a1c8cd68ac43a27dac7ef4be476300" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/jbroadway/urlify/zipball/37fe4e7680a1c8cd68ac43a27dac7ef4be476300", - "reference": "37fe4e7680a1c8cd68ac43a27dac7ef4be476300", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.36 || ^5.7 || ^6.5" - }, - "time": "2019-06-13T18:30:56+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-0": { - "URLify": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause-Clear" - ], - "authors": [ - { - "name": "Johnny Broadway", - "email": "johnny@johnnybroadway.com", - "homepage": "http://www.johnnybroadway.com/" - } - ], - "description": "PHP port of URLify.js from the Django project. Transliterates non-ascii characters for use in URLs.", - "homepage": "https://github.com/jbroadway/urlify", - "keywords": [ - "encode", - "iconv", - "link", - "slug", - "translit", - "transliterate", - "transliteration", - "url", - "urlify" - ], - "install-path": "../jbroadway/urlify" - }, - { - "name": "laminas/laminas-permissions-acl", - "version": "2.14.0", - "version_normalized": "2.14.0.0", - "source": { - "type": "git", - "url": "https://github.com/laminas/laminas-permissions-acl.git", - "reference": "86cecb540cf8f2e088d70d8acef1fc9203ed5023" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-permissions-acl/zipball/86cecb540cf8f2e088d70d8acef1fc9203ed5023", - "reference": "86cecb540cf8f2e088d70d8acef1fc9203ed5023", - "shasum": "" - }, - "require": { - "php": "~8.0.0 || ~8.1.0 || ~8.2.0" - }, - "conflict": { - "laminas/laminas-servicemanager": "<3.0", - "zendframework/zend-permissions-acl": "*" - }, - "require-dev": { - "laminas/laminas-coding-standard": "~2.5.0", - "laminas/laminas-servicemanager": "^3.19", - "phpbench/phpbench": "^1.2", - "phpunit/phpunit": "^9.5.26", - "psalm/plugin-phpunit": "^0.18.0", - "vimeo/psalm": "^5.0" - }, - "suggest": { - "laminas/laminas-servicemanager": "To support Laminas\\Permissions\\Acl\\Assertion\\AssertionManager plugin manager usage" - }, - "time": "2023-02-01T16:19:54+00:00", - "type": "library", - "installation-source": "source", - "autoload": { - "psr-4": { - "Laminas\\Permissions\\Acl\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "Provides a lightweight and flexible access control list (ACL) implementation for privileges management", - "homepage": "https://laminas.dev", - "keywords": [ - "acl", - "laminas" - ], - "support": { - "chat": "https://laminas.dev/chat", - "docs": "https://docs.laminas.dev/laminas-permissions-acl/", - "forum": "https://discourse.laminas.dev", - "issues": "https://github.com/laminas/laminas-permissions-acl/issues", - "rss": "https://github.com/laminas/laminas-permissions-acl/releases.atom", - "source": "https://github.com/laminas/laminas-permissions-acl" - }, - "funding": [ - { - "url": "https://funding.communitybridge.org/projects/laminas-project", - "type": "community_bridge" - } - ], - "install-path": "../laminas/laminas-permissions-acl" - }, - { - "name": "laravel/serializable-closure", - "version": "v1.3.3", - "version_normalized": "1.3.3.0", - "source": { - "type": "git", - "url": "https://github.com/laravel/serializable-closure.git", - "reference": "3dbf8a8e914634c48d389c1234552666b3d43754" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/3dbf8a8e914634c48d389c1234552666b3d43754", - "reference": "3dbf8a8e914634c48d389c1234552666b3d43754", - "shasum": "" - }, - "require": { - "php": "^7.3|^8.0" - }, - "require-dev": { - "nesbot/carbon": "^2.61", - "pestphp/pest": "^1.21.3", - "phpstan/phpstan": "^1.8.2", - "symfony/var-dumper": "^5.4.11" - }, - "time": "2023-11-08T14:08:06+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Laravel\\SerializableClosure\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - }, - { - "name": "Nuno Maduro", - "email": "nuno@laravel.com" - } - ], - "description": "Laravel Serializable Closure provides an easy and secure way to serialize closures in PHP.", - "keywords": [ - "closure", - "laravel", - "serializable" - ], - "support": { - "issues": "https://github.com/laravel/serializable-closure/issues", - "source": "https://github.com/laravel/serializable-closure" - }, - "install-path": "../laravel/serializable-closure" - }, - { - "name": "nikic/fast-route", - "version": "v1.3.0", - "version_normalized": "1.3.0.0", - "source": { - "type": "git", - "url": "https://github.com/nikic/FastRoute.git", - "reference": "181d480e08d9476e61381e04a71b34dc0432e812" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nikic/FastRoute/zipball/181d480e08d9476e61381e04a71b34dc0432e812", - "reference": "181d480e08d9476e61381e04a71b34dc0432e812", - "shasum": "" - }, - "require": { - "php": ">=5.4.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.35|~5.7" - }, - "time": "2018-02-13T20:26:39+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "FastRoute\\": "src/" - }, - "files": [ - "src/functions.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Nikita Popov", - "email": "nikic@php.net" - } - ], - "description": "Fast request router for PHP", - "keywords": [ - "router", - "routing" - ], - "install-path": "../nikic/fast-route" - }, - { - "name": "php-di/invoker", - "version": "2.3.4", - "version_normalized": "2.3.4.0", - "source": { - "type": "git", - "url": "https://github.com/PHP-DI/Invoker.git", - "reference": "33234b32dafa8eb69202f950a1fc92055ed76a86" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/PHP-DI/Invoker/zipball/33234b32dafa8eb69202f950a1fc92055ed76a86", - "reference": "33234b32dafa8eb69202f950a1fc92055ed76a86", - "shasum": "" - }, - "require": { - "php": ">=7.3", - "psr/container": "^1.0|^2.0" - }, - "require-dev": { - "athletic/athletic": "~0.1.8", - "mnapoli/hard-mode": "~0.3.0", - "phpunit/phpunit": "^9.0" - }, - "time": "2023-09-08T09:24:21+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Invoker\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Generic and extensible callable invoker", - "homepage": "https://github.com/PHP-DI/Invoker", - "keywords": [ - "callable", - "dependency", - "dependency-injection", - "injection", - "invoke", - "invoker" - ], - "support": { - "issues": "https://github.com/PHP-DI/Invoker/issues", - "source": "https://github.com/PHP-DI/Invoker/tree/2.3.4" - }, - "funding": [ - { - "url": "https://github.com/mnapoli", - "type": "github" - } - ], - "install-path": "../php-di/invoker" - }, - { - "name": "php-di/php-di", - "version": "6.4.0", - "version_normalized": "6.4.0.0", - "source": { - "type": "git", - "url": "https://github.com/PHP-DI/PHP-DI.git", - "reference": "ae0f1b3b03d8b29dff81747063cbfd6276246cc4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/PHP-DI/PHP-DI/zipball/ae0f1b3b03d8b29dff81747063cbfd6276246cc4", - "reference": "ae0f1b3b03d8b29dff81747063cbfd6276246cc4", - "shasum": "" - }, - "require": { - "laravel/serializable-closure": "^1.0", - "php": ">=7.4.0", - "php-di/invoker": "^2.0", - "php-di/phpdoc-reader": "^2.0.1", - "psr/container": "^1.0" - }, - "provide": { - "psr/container-implementation": "^1.0" - }, - "require-dev": { - "doctrine/annotations": "~1.10", - "friendsofphp/php-cs-fixer": "^2.4", - "mnapoli/phpunit-easymock": "^1.2", - "ocramius/proxy-manager": "^2.11.2", - "phpstan/phpstan": "^0.12", - "phpunit/phpunit": "^9.5" - }, - "suggest": { - "doctrine/annotations": "Install it if you want to use annotations (version ~1.2)", - "ocramius/proxy-manager": "Install it if you want to use lazy injection (version ~2.0)" - }, - "time": "2022-04-09T16:46:38+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "files": [ - "src/functions.php" - ], - "psr-4": { - "DI\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "The dependency injection container for humans", - "homepage": "https://php-di.org/", - "keywords": [ - "PSR-11", - "container", - "container-interop", - "dependency injection", - "di", - "ioc", - "psr11" - ], - "support": { - "issues": "https://github.com/PHP-DI/PHP-DI/issues", - "source": "https://github.com/PHP-DI/PHP-DI/tree/6.4.0" - }, - "funding": [ - { - "url": "https://github.com/mnapoli", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/php-di/php-di", - "type": "tidelift" - } - ], - "install-path": "../php-di/php-di" - }, - { - "name": "php-di/phpdoc-reader", - "version": "2.2.1", - "version_normalized": "2.2.1.0", - "source": { - "type": "git", - "url": "https://github.com/PHP-DI/PhpDocReader.git", - "reference": "66daff34cbd2627740ffec9469ffbac9f8c8185c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/PHP-DI/PhpDocReader/zipball/66daff34cbd2627740ffec9469ffbac9f8c8185c", - "reference": "66daff34cbd2627740ffec9469ffbac9f8c8185c", - "shasum": "" - }, - "require": { - "php": ">=7.2.0" - }, - "require-dev": { - "mnapoli/hard-mode": "~0.3.0", - "phpunit/phpunit": "^8.5|^9.0" - }, - "time": "2020-10-12T12:39:22+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "PhpDocReader\\": "src/PhpDocReader" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "PhpDocReader parses @var and @param values in PHP docblocks (supports namespaced class names with the same resolution rules as PHP)", - "keywords": [ - "phpdoc", - "reflection" - ], - "support": { - "issues": "https://github.com/PHP-DI/PhpDocReader/issues", - "source": "https://github.com/PHP-DI/PhpDocReader/tree/2.2.1" - }, - "install-path": "../php-di/phpdoc-reader" - }, - { - "name": "php-di/slim-bridge", - "version": "3.4.0", - "version_normalized": "3.4.0.0", - "source": { - "type": "git", - "url": "https://github.com/PHP-DI/Slim-Bridge.git", - "reference": "d14c95b34b3c5ba2e8c40020dd93fdcc8f3ba875" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/PHP-DI/Slim-Bridge/zipball/d14c95b34b3c5ba2e8c40020dd93fdcc8f3ba875", - "reference": "d14c95b34b3c5ba2e8c40020dd93fdcc8f3ba875", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0", - "php-di/invoker": "^2.0.0", - "php-di/php-di": "^6.0|^7.0", - "slim/slim": "^4.2.0" - }, - "require-dev": { - "laminas/laminas-diactoros": "^2.1", - "phpunit/phpunit": ">= 7.0 < 10" - }, - "time": "2023-06-29T14:08:47+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "DI\\Bridge\\Slim\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "PHP-DI integration in Slim", - "support": { - "issues": "https://github.com/PHP-DI/Slim-Bridge/issues", - "source": "https://github.com/PHP-DI/Slim-Bridge/tree/3.4.0" - }, - "install-path": "../php-di/slim-bridge" - }, - { - "name": "psr/container", - "version": "1.1.2", - "version_normalized": "1.1.2.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/container.git", - "reference": "513e0666f7216c7459170d56df27dfcefe1689ea" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea", - "reference": "513e0666f7216c7459170d56df27dfcefe1689ea", - "shasum": "" - }, - "require": { - "php": ">=7.4.0" - }, - "time": "2021-11-05T16:50:12+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Psr\\Container\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common Container Interface (PHP FIG PSR-11)", - "homepage": "https://github.com/php-fig/container", - "keywords": [ - "PSR-11", - "container", - "container-interface", - "container-interop", - "psr" - ], - "support": { - "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/1.1.2" - }, - "install-path": "../psr/container" - }, - { - "name": "psr/event-dispatcher", - "version": "1.0.0", - "version_normalized": "1.0.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/event-dispatcher.git", - "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0", - "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0", - "shasum": "" - }, - "require": { - "php": ">=7.2.0" - }, - "time": "2019-01-08T18:20:26+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Psr\\EventDispatcher\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Standard interfaces for event handling.", - "keywords": [ - "events", - "psr", - "psr-14" - ], - "support": { - "issues": "https://github.com/php-fig/event-dispatcher/issues", - "source": "https://github.com/php-fig/event-dispatcher/tree/1.0.0" - }, - "install-path": "../psr/event-dispatcher" - }, - { - "name": "psr/http-factory", - "version": "1.0.2", - "version_normalized": "1.0.2.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-factory.git", - "reference": "e616d01114759c4c489f93b099585439f795fe35" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-factory/zipball/e616d01114759c4c489f93b099585439f795fe35", - "reference": "e616d01114759c4c489f93b099585439f795fe35", - "shasum": "" - }, - "require": { - "php": ">=7.0.0", - "psr/http-message": "^1.0 || ^2.0" - }, - "time": "2023-04-10T20:10:41+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Psr\\Http\\Message\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common interfaces for PSR-7 HTTP message factories", - "keywords": [ - "factory", - "http", - "message", - "psr", - "psr-17", - "psr-7", - "request", - "response" - ], - "support": { - "source": "https://github.com/php-fig/http-factory/tree/1.0.2" - }, - "install-path": "../psr/http-factory" - }, - { - "name": "psr/http-message", - "version": "1.1", - "version_normalized": "1.1.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-message.git", - "reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/cb6ce4845ce34a8ad9e68117c10ee90a29919eba", - "reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0" - }, - "time": "2023-04-04T09:50:52+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Psr\\Http\\Message\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for HTTP messages", - "homepage": "https://github.com/php-fig/http-message", - "keywords": [ - "http", - "http-message", - "psr", - "psr-7", - "request", - "response" - ], - "support": { - "source": "https://github.com/php-fig/http-message/tree/1.1" - }, - "install-path": "../psr/http-message" - }, - { - "name": "psr/http-server-handler", - "version": "1.0.2", - "version_normalized": "1.0.2.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-server-handler.git", - "reference": "84c4fb66179be4caaf8e97bd239203245302e7d4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-server-handler/zipball/84c4fb66179be4caaf8e97bd239203245302e7d4", - "reference": "84c4fb66179be4caaf8e97bd239203245302e7d4", - "shasum": "" - }, - "require": { - "php": ">=7.0", - "psr/http-message": "^1.0 || ^2.0" - }, - "time": "2023-04-10T20:06:20+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Psr\\Http\\Server\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common interface for HTTP server-side request handler", - "keywords": [ - "handler", - "http", - "http-interop", - "psr", - "psr-15", - "psr-7", - "request", - "response", - "server" - ], - "support": { - "source": "https://github.com/php-fig/http-server-handler/tree/1.0.2" - }, - "install-path": "../psr/http-server-handler" - }, - { - "name": "psr/http-server-middleware", - "version": "1.0.2", - "version_normalized": "1.0.2.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-server-middleware.git", - "reference": "c1481f747daaa6a0782775cd6a8c26a1bf4a3829" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-server-middleware/zipball/c1481f747daaa6a0782775cd6a8c26a1bf4a3829", - "reference": "c1481f747daaa6a0782775cd6a8c26a1bf4a3829", - "shasum": "" - }, - "require": { - "php": ">=7.0", - "psr/http-message": "^1.0 || ^2.0", - "psr/http-server-handler": "^1.0" - }, - "time": "2023-04-11T06:14:47+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Psr\\Http\\Server\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common interface for HTTP server-side middleware", - "keywords": [ - "http", - "http-interop", - "middleware", - "psr", - "psr-15", - "psr-7", - "request", - "response" - ], - "support": { - "issues": "https://github.com/php-fig/http-server-middleware/issues", - "source": "https://github.com/php-fig/http-server-middleware/tree/1.0.2" - }, - "install-path": "../psr/http-server-middleware" - }, - { - "name": "psr/log", - "version": "3.0.0", - "version_normalized": "3.0.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/fe5ea303b0887d5caefd3d431c3e61ad47037001", - "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001", - "shasum": "" - }, - "require": { - "php": ">=8.0.0" - }, - "time": "2021-07-14T16:46:02+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Psr\\Log\\": "src" - } - }, - "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/3.0.0" - }, - "install-path": "../psr/log" - }, - { - "name": "ralouphie/getallheaders", - "version": "3.0.3", - "version_normalized": "3.0.3.0", - "source": { - "type": "git", - "url": "https://github.com/ralouphie/getallheaders.git", - "reference": "120b605dfeb996808c31b6477290a714d356e822" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", - "reference": "120b605dfeb996808c31b6477290a714d356e822", - "shasum": "" - }, - "require": { - "php": ">=5.6" - }, - "require-dev": { - "php-coveralls/php-coveralls": "^2.1", - "phpunit/phpunit": "^5 || ^6.5" - }, - "time": "2019-03-08T08:55:37+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "files": [ - "src/getallheaders.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ralph Khattar", - "email": "ralph.khattar@gmail.com" - } - ], - "description": "A polyfill for getallheaders.", - "support": { - "issues": "https://github.com/ralouphie/getallheaders/issues", - "source": "https://github.com/ralouphie/getallheaders/tree/develop" - }, - "install-path": "../ralouphie/getallheaders" - }, - { - "name": "slim/csrf", - "version": "1.3.0", - "version_normalized": "1.3.0.0", - "source": { - "type": "git", - "url": "https://github.com/slimphp/Slim-Csrf.git", - "reference": "ebaaf295fd6d7224078d8ae3bba45329b31798c7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/slimphp/Slim-Csrf/zipball/ebaaf295fd6d7224078d8ae3bba45329b31798c7", - "reference": "ebaaf295fd6d7224078d8ae3bba45329b31798c7", - "shasum": "" - }, - "require": { - "php": "^7.4 || ^8.0", - "psr/http-factory": "^1.0", - "psr/http-message": "^1.0", - "psr/http-server-handler": "^1.0", - "psr/http-server-middleware": "^1.0" - }, - "require-dev": { - "phpspec/prophecy": "^1.15", - "phpspec/prophecy-phpunit": "^2.0", - "phpunit/phpunit": "^9.5", - "squizlabs/php_codesniffer": "^3.7" - }, - "time": "2022-11-05T19:27:53+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Slim\\Csrf\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Josh Lockhart", - "email": "hello@joshlockhart.com", - "homepage": "http://joshlockhart.com" - } - ], - "description": "Slim Framework 4 CSRF protection PSR-15 middleware", - "homepage": "https://www.slimframework.com", - "keywords": [ - "csrf", - "framework", - "middleware", - "slim" - ], - "support": { - "issues": "https://github.com/slimphp/Slim-Csrf/issues", - "source": "https://github.com/slimphp/Slim-Csrf/tree/1.3.0" - }, - "install-path": "../slim/csrf" - }, - { - "name": "slim/flash", - "version": "0.4.0", - "version_normalized": "0.4.0.0", - "source": { - "type": "git", - "url": "https://github.com/slimphp/Slim-Flash.git", - "reference": "9aaff5fded3b54f4e519ec3d4ac74d3d1f2cbbbc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/slimphp/Slim-Flash/zipball/9aaff5fded3b54f4e519ec3d4ac74d3d1f2cbbbc", - "reference": "9aaff5fded3b54f4e519ec3d4ac74d3d1f2cbbbc", - "shasum": "" - }, - "require": { - "php": ">=5.5.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.0" - }, - "time": "2017-10-22T10:35:05+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Slim\\Flash\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Josh Lockhart", - "email": "hello@joshlockhart.com", - "homepage": "http://joshlockhart.com" - } - ], - "description": "Slim Framework Flash message service provider", - "homepage": "http://slimframework.com", - "keywords": [ - "flash", - "framework", - "message", - "provider", - "slim" - ], - "install-path": "../slim/flash" - }, - { - "name": "slim/psr7", - "version": "1.6.1", - "version_normalized": "1.6.1.0", - "source": { - "type": "git", - "url": "https://github.com/slimphp/Slim-Psr7.git", - "reference": "72d2b2bac94ab4575d369f605dbfafbe168d3163" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/slimphp/Slim-Psr7/zipball/72d2b2bac94ab4575d369f605dbfafbe168d3163", - "reference": "72d2b2bac94ab4575d369f605dbfafbe168d3163", - "shasum": "" - }, - "require": { - "fig/http-message-util": "^1.1.5", - "php": "^7.4 || ^8.0", - "psr/http-factory": "^1.0", - "psr/http-message": "^1.0", - "ralouphie/getallheaders": "^3.0", - "symfony/polyfill-php80": "^1.26" - }, - "provide": { - "psr/http-factory-implementation": "1.0", - "psr/http-message-implementation": "1.0" - }, - "require-dev": { - "adriansuter/php-autoload-override": "^1.3", - "ext-json": "*", - "http-interop/http-factory-tests": "^0.9.0", - "php-http/psr7-integration-tests": "1.1", - "phpspec/prophecy": "^1.15", - "phpspec/prophecy-phpunit": "^2.0", - "phpstan/phpstan": "^1.8", - "phpunit/phpunit": "^9.5", - "squizlabs/php_codesniffer": "^3.7" - }, - "time": "2023-04-17T16:02:20+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Slim\\Psr7\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Josh Lockhart", - "email": "hello@joshlockhart.com", - "homepage": "http://joshlockhart.com" - }, - { - "name": "Andrew Smith", - "email": "a.smith@silentworks.co.uk", - "homepage": "http://silentworks.co.uk" - }, - { - "name": "Rob Allen", - "email": "rob@akrabat.com", - "homepage": "http://akrabat.com" - }, - { - "name": "Pierre Berube", - "email": "pierre@lgse.com", - "homepage": "http://www.lgse.com" - } - ], - "description": "Strict PSR-7 implementation", - "homepage": "https://www.slimframework.com", - "keywords": [ - "http", - "psr-7", - "psr7" - ], - "support": { - "issues": "https://github.com/slimphp/Slim-Psr7/issues", - "source": "https://github.com/slimphp/Slim-Psr7/tree/1.6.1" - }, - "install-path": "../slim/psr7" - }, - { - "name": "slim/slim", - "version": "4.12.0", - "version_normalized": "4.12.0.0", - "source": { - "type": "git", - "url": "https://github.com/slimphp/Slim.git", - "reference": "e9e99c2b24398b967841c6c4c3048622cc7e2b18" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/slimphp/Slim/zipball/e9e99c2b24398b967841c6c4c3048622cc7e2b18", - "reference": "e9e99c2b24398b967841c6c4c3048622cc7e2b18", - "shasum": "" - }, - "require": { - "ext-json": "*", - "nikic/fast-route": "^1.3", - "php": "^7.4 || ^8.0", - "psr/container": "^1.0 || ^2.0", - "psr/http-factory": "^1.0", - "psr/http-message": "^1.1", - "psr/http-server-handler": "^1.0", - "psr/http-server-middleware": "^1.0", - "psr/log": "^1.1 || ^2.0 || ^3.0" - }, - "require-dev": { - "adriansuter/php-autoload-override": "^1.4", - "ext-simplexml": "*", - "guzzlehttp/psr7": "^2.5", - "httpsoft/http-message": "^1.1", - "httpsoft/http-server-request": "^1.1", - "laminas/laminas-diactoros": "^2.17", - "nyholm/psr7": "^1.8", - "nyholm/psr7-server": "^1.0", - "phpspec/prophecy": "^1.17", - "phpspec/prophecy-phpunit": "^2.0", - "phpstan/phpstan": "^1.10", - "phpunit/phpunit": "^9.6", - "slim/http": "^1.3", - "slim/psr7": "^1.6", - "squizlabs/php_codesniffer": "^3.7" - }, - "suggest": { - "ext-simplexml": "Needed to support XML format in BodyParsingMiddleware", - "ext-xml": "Needed to support XML format in BodyParsingMiddleware", - "php-di/php-di": "PHP-DI is the recommended container library to be used with Slim", - "slim/psr7": "Slim PSR-7 implementation. See https://www.slimframework.com/docs/v4/start/installation.html for more information." - }, - "time": "2023-07-23T04:54:29+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Slim\\": "Slim" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Josh Lockhart", - "email": "hello@joshlockhart.com", - "homepage": "https://joshlockhart.com" - }, - { - "name": "Andrew Smith", - "email": "a.smith@silentworks.co.uk", - "homepage": "http://silentworks.co.uk" - }, - { - "name": "Rob Allen", - "email": "rob@akrabat.com", - "homepage": "http://akrabat.com" - }, - { - "name": "Pierre Berube", - "email": "pierre@lgse.com", - "homepage": "http://www.lgse.com" - }, - { - "name": "Gabriel Manricks", - "email": "gmanricks@me.com", - "homepage": "http://gabrielmanricks.com" - } - ], - "description": "Slim is a PHP micro framework that helps you quickly write simple yet powerful web applications and APIs", - "homepage": "https://www.slimframework.com", - "keywords": [ - "api", - "framework", - "micro", - "router" - ], - "support": { - "docs": "https://www.slimframework.com/docs/v4/", - "forum": "https://discourse.slimframework.com/", - "irc": "irc://irc.freenode.net:6667/slimphp", - "issues": "https://github.com/slimphp/Slim/issues", - "rss": "https://www.slimframework.com/blog/feed.rss", - "slack": "https://slimphp.slack.com/", - "source": "https://github.com/slimphp/Slim", - "wiki": "https://github.com/slimphp/Slim/wiki" - }, - "funding": [ - { - "url": "https://opencollective.com/slimphp", - "type": "open_collective" - }, - { - "url": "https://tidelift.com/funding/github/packagist/slim/slim", - "type": "tidelift" - } - ], - "install-path": "../slim/slim" - }, - { - "name": "slim/twig-view", - "version": "3.3.0", - "version_normalized": "3.3.0.0", - "source": { - "type": "git", - "url": "https://github.com/slimphp/Twig-View.git", - "reference": "df6dd6af6bbe28041be49c9fb8470c2e9b70cd98" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/slimphp/Twig-View/zipball/df6dd6af6bbe28041be49c9fb8470c2e9b70cd98", - "reference": "df6dd6af6bbe28041be49c9fb8470c2e9b70cd98", - "shasum": "" - }, - "require": { - "php": "^7.4 || ^8.0", - "psr/http-message": "^1.0", - "slim/slim": "^4.9", - "symfony/polyfill-php81": "^1.23", - "twig/twig": "^3.3" - }, - "require-dev": { - "phpspec/prophecy-phpunit": "^2.0", - "phpstan/phpstan": "^1.3.0", - "phpunit/phpunit": "^9.5", - "psr/http-factory": "^1.0", - "squizlabs/php_codesniffer": "^3.6" - }, - "time": "2022-01-02T05:14:45+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Slim\\Views\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Josh Lockhart", - "email": "hello@joshlockhart.com", - "homepage": "http://joshlockhart.com" - }, - { - "name": "Pierre Berube", - "email": "pierre@lgse.com", - "homepage": "http://www.lgse.com" - } - ], - "description": "Slim Framework 4 view helper built on top of the Twig 3 templating component", - "homepage": "https://www.slimframework.com", - "keywords": [ - "framework", - "slim", - "template", - "twig", - "view" - ], - "support": { - "issues": "https://github.com/slimphp/Twig-View/issues", - "source": "https://github.com/slimphp/Twig-View/tree/3.3.0" - }, - "install-path": "../slim/twig-view" - }, - { - "name": "symfony/deprecation-contracts", - "version": "v2.5.2", - "version_normalized": "2.5.2.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e8b495ea28c1d97b5e0c121748d6f9b53d075c66", - "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "time": "2022-01-02T09:53:40+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "2.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "installation-source": "dist", - "autoload": { - "files": [ - "function.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "A generic function and convention to trigger deprecation notices", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.2" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/deprecation-contracts" - }, - { - "name": "symfony/event-dispatcher", - "version": "v5.4.26", - "version_normalized": "5.4.26.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "5dcc00e03413f05c1e7900090927bb7247cb0aac" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/5dcc00e03413f05c1e7900090927bb7247cb0aac", - "reference": "5dcc00e03413f05c1e7900090927bb7247cb0aac", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/event-dispatcher-contracts": "^2|^3", - "symfony/polyfill-php80": "^1.16" - }, - "conflict": { - "symfony/dependency-injection": "<4.4" - }, - "provide": { - "psr/event-dispatcher-implementation": "1.0", - "symfony/event-dispatcher-implementation": "2.0" - }, - "require-dev": { - "psr/log": "^1|^2|^3", - "symfony/config": "^4.4|^5.0|^6.0", - "symfony/dependency-injection": "^4.4|^5.0|^6.0", - "symfony/error-handler": "^4.4|^5.0|^6.0", - "symfony/expression-language": "^4.4|^5.0|^6.0", - "symfony/http-foundation": "^4.4|^5.0|^6.0", - "symfony/service-contracts": "^1.1|^2|^3", - "symfony/stopwatch": "^4.4|^5.0|^6.0" - }, - "suggest": { - "symfony/dependency-injection": "", - "symfony/http-kernel": "" - }, - "time": "2023-07-06T06:34:20+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\EventDispatcher\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v5.4.26" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/event-dispatcher" - }, - { - "name": "symfony/event-dispatcher-contracts", - "version": "v2.5.2", - "version_normalized": "2.5.2.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/event-dispatcher-contracts.git", - "reference": "f98b54df6ad059855739db6fcbc2d36995283fe1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/f98b54df6ad059855739db6fcbc2d36995283fe1", - "reference": "f98b54df6ad059855739db6fcbc2d36995283fe1", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "psr/event-dispatcher": "^1" - }, - "suggest": { - "symfony/event-dispatcher-implementation": "" - }, - "time": "2022-01-02T09:53:40+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "2.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Contracts\\EventDispatcher\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Generic abstractions related to dispatching event", - "homepage": "https://symfony.com", - "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" - ], - "support": { - "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v2.5.2" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/event-dispatcher-contracts" - }, - { - "name": "symfony/finder", - "version": "v5.4.27", - "version_normalized": "5.4.27.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/finder.git", - "reference": "ff4bce3c33451e7ec778070e45bd23f74214cd5d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/ff4bce3c33451e7ec778070e45bd23f74214cd5d", - "reference": "ff4bce3c33451e7ec778070e45bd23f74214cd5d", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-php80": "^1.16" - }, - "time": "2023-07-31T08:02:31+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\Finder\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Finds files and directories via an intuitive fluent interface", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/finder/tree/v5.4.27" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/finder" - }, - { - "name": "symfony/polyfill-ctype", - "version": "v1.28.0", - "version_normalized": "1.28.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", - "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "provide": { - "ext-ctype": "*" - }, - "suggest": { - "ext-ctype": "For best performance" - }, - "time": "2023-01-26T09:26:14+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "installation-source": "dist", - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for ctype functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "ctype", - "polyfill", - "portable" - ], - "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.28.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/polyfill-ctype" - }, - { - "name": "symfony/polyfill-mbstring", - "version": "v1.28.0", - "version_normalized": "1.28.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "42292d99c55abe617799667f454222c54c60e229" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/42292d99c55abe617799667f454222c54c60e229", - "reference": "42292d99c55abe617799667f454222c54c60e229", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "provide": { - "ext-mbstring": "*" - }, - "suggest": { - "ext-mbstring": "For best performance" - }, - "time": "2023-07-28T09:04:16+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "installation-source": "dist", - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for the Mbstring extension", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "mbstring", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.28.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/polyfill-mbstring" - }, - { - "name": "symfony/polyfill-php80", - "version": "v1.28.0", - "version_normalized": "1.28.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/6caa57379c4aec19c0a12a38b59b26487dcfe4b5", - "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "time": "2023-01-26T09:26:14+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "installation-source": "dist", - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Php80\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ion Bazan", - "email": "ion.bazan@gmail.com" - }, - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.28.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/polyfill-php80" - }, - { - "name": "symfony/polyfill-php81", - "version": "v1.28.0", - "version_normalized": "1.28.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php81.git", - "reference": "7581cd600fa9fd681b797d00b02f068e2f13263b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/7581cd600fa9fd681b797d00b02f068e2f13263b", - "reference": "7581cd600fa9fd681b797d00b02f068e2f13263b", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "time": "2023-01-26T09:26:14+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "installation-source": "dist", - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Php81\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php81/tree/v1.28.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/polyfill-php81" - }, - { - "name": "symfony/yaml", - "version": "v5.4.31", - "version_normalized": "5.4.31.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/yaml.git", - "reference": "f387675d7f5fc4231f7554baa70681f222f73563" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/f387675d7f5fc4231f7554baa70681f222f73563", - "reference": "f387675d7f5fc4231f7554baa70681f222f73563", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-ctype": "^1.8" - }, - "conflict": { - "symfony/console": "<5.3" - }, - "require-dev": { - "symfony/console": "^5.3|^6.0" - }, - "suggest": { - "symfony/console": "For validating YAML files using the lint command" - }, - "time": "2023-11-03T14:41:28+00:00", - "bin": [ - "Resources/bin/yaml-lint" - ], - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\Yaml\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Loads and dumps YAML files", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/yaml/tree/v5.4.31" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/yaml" - }, - { - "name": "twig/twig", - "version": "v3.8.0", - "version_normalized": "3.8.0.0", - "source": { - "type": "git", - "url": "https://github.com/twigphp/Twig.git", - "reference": "9d15f0ac07f44dc4217883ec6ae02fd555c6f71d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/9d15f0ac07f44dc4217883ec6ae02fd555c6f71d", - "reference": "9d15f0ac07f44dc4217883ec6ae02fd555c6f71d", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/polyfill-ctype": "^1.8", - "symfony/polyfill-mbstring": "^1.3", - "symfony/polyfill-php80": "^1.22" - }, - "require-dev": { - "psr/container": "^1.0|^2.0", - "symfony/phpunit-bridge": "^5.4.9|^6.3|^7.0" - }, - "time": "2023-11-21T18:54:41+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Twig\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" - }, - { - "name": "Twig Team", - "role": "Contributors" - }, - { - "name": "Armin Ronacher", - "email": "armin.ronacher@active-4.com", - "role": "Project Founder" - } - ], - "description": "Twig, the flexible, fast, and secure template language for PHP", - "homepage": "https://twig.symfony.com", - "keywords": [ - "templating" - ], - "support": { - "issues": "https://github.com/twigphp/Twig/issues", - "source": "https://github.com/twigphp/Twig/tree/v3.8.0" - }, - "funding": [ - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/twig/twig", - "type": "tidelift" - } - ], - "install-path": "../twig/twig" - }, - { - "name": "vlucas/valitron", - "version": "v1.4.11", - "version_normalized": "1.4.11.0", - "source": { - "type": "git", - "url": "https://github.com/vlucas/valitron.git", - "reference": "fadce39f5f235755bb9794b2573af2d5bfcba85f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/vlucas/valitron/zipball/fadce39f5f235755bb9794b2573af2d5bfcba85f", - "reference": "fadce39f5f235755bb9794b2573af2d5bfcba85f", - "shasum": "" - }, - "require": { - "php": ">=5.3.2" - }, - "require-dev": { - "phpunit/phpunit": ">=4.8.35" - }, - "suggest": { - "ext-mbstring": "It can support the multiple bytes string length." - }, - "time": "2022-10-14T11:54:24+00:00", - "type": "library", - "installation-source": "source", - "autoload": { - "psr-4": { - "Valitron\\": "src/Valitron" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Vance Lucas", - "email": "vance@vancelucas.com", - "homepage": "https://www.vancelucas.com" - } - ], - "description": "Simple, elegant, stand-alone validation library with NO dependencies", - "homepage": "https://github.com/vlucas/valitron", - "keywords": [ - "valid", - "validation", - "validator" - ], - "support": { - "issues": "https://github.com/vlucas/valitron/issues", - "source": "https://github.com/vlucas/valitron/tree/v1.4.11" - }, - "funding": [ - { - "url": "https://tidelift.com/funding/github/packagist/vlucas/valitron", - "type": "tidelift" - } - ], - "install-path": "../vlucas/valitron" - } - ], - "dev": true, - "dev-package-names": [] -} diff --git a/system/vendor/composer/installed.php b/system/vendor/composer/installed.php deleted file mode 100644 index 6829aa7..0000000 --- a/system/vendor/composer/installed.php +++ /dev/null @@ -1,390 +0,0 @@ - array( - 'pretty_version' => '2.x-dev', - 'version' => '2.9999999.9999999.9999999-dev', - 'type' => 'project', - 'install_path' => __DIR__ . '/../../../', - 'aliases' => array(), - 'reference' => '8fb86495b65737eaa0e413eaf1e22cc2ffd2e022', - 'name' => 'typemill/typemill', - 'dev' => true, - ), - 'versions' => array( - 'akrabat/proxy-detection-middleware' => array( - 'pretty_version' => '1.0', - 'version' => '1.0.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../akrabat/proxy-detection-middleware', - 'aliases' => array(), - 'reference' => '90472f490e56ad23afc36b0d95c24cd48fa331d7', - 'dev_requirement' => false, - ), - 'erusev/parsedown' => array( - 'pretty_version' => '1.8.0-beta-7', - 'version' => '1.8.0.0-beta7', - 'type' => 'library', - 'install_path' => __DIR__ . '/../erusev/parsedown', - 'aliases' => array(), - 'reference' => 'fe7a50eceb4a3c867cc9fa9c0aa906b1067d1955', - 'dev_requirement' => false, - ), - 'erusev/parsedown-extra' => array( - 'pretty_version' => 'dev-master', - 'version' => 'dev-master', - 'type' => 'library', - 'install_path' => __DIR__ . '/../erusev/parsedown-extra', - 'aliases' => array( - 0 => '9999999-dev', - ), - 'reference' => 'fd33d68349630d18d56367712a64445a6e0bc83e', - 'dev_requirement' => false, - ), - 'fig/http-message-util' => array( - 'pretty_version' => '1.1.5', - 'version' => '1.1.5.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../fig/http-message-util', - 'aliases' => array(), - 'reference' => '9d94dc0154230ac39e5bf89398b324a86f63f765', - 'dev_requirement' => false, - ), - 'gregwar/captcha' => array( - 'pretty_version' => 'dev-master', - 'version' => 'dev-master', - 'type' => 'library', - 'install_path' => __DIR__ . '/../gregwar/captcha', - 'aliases' => array( - 0 => '9999999-dev', - ), - 'reference' => '229d3cdfe33d6f1349e0aec94a26e9205a6db08e', - 'dev_requirement' => false, - ), - 'jbroadway/urlify' => array( - 'pretty_version' => '1.1.3-stable', - 'version' => '1.1.3.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../jbroadway/urlify', - 'aliases' => array(), - 'reference' => '37fe4e7680a1c8cd68ac43a27dac7ef4be476300', - 'dev_requirement' => false, - ), - 'laminas/laminas-permissions-acl' => array( - 'pretty_version' => '2.14.0', - 'version' => '2.14.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../laminas/laminas-permissions-acl', - 'aliases' => array(), - 'reference' => '86cecb540cf8f2e088d70d8acef1fc9203ed5023', - 'dev_requirement' => false, - ), - 'laravel/serializable-closure' => array( - 'pretty_version' => 'v1.3.3', - 'version' => '1.3.3.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../laravel/serializable-closure', - 'aliases' => array(), - 'reference' => '3dbf8a8e914634c48d389c1234552666b3d43754', - 'dev_requirement' => false, - ), - 'nikic/fast-route' => array( - 'pretty_version' => 'v1.3.0', - 'version' => '1.3.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../nikic/fast-route', - 'aliases' => array(), - 'reference' => '181d480e08d9476e61381e04a71b34dc0432e812', - 'dev_requirement' => false, - ), - 'php-di/invoker' => array( - 'pretty_version' => '2.3.4', - 'version' => '2.3.4.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../php-di/invoker', - 'aliases' => array(), - 'reference' => '33234b32dafa8eb69202f950a1fc92055ed76a86', - 'dev_requirement' => false, - ), - 'php-di/php-di' => array( - 'pretty_version' => '6.4.0', - 'version' => '6.4.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../php-di/php-di', - 'aliases' => array(), - 'reference' => 'ae0f1b3b03d8b29dff81747063cbfd6276246cc4', - 'dev_requirement' => false, - ), - 'php-di/phpdoc-reader' => array( - 'pretty_version' => '2.2.1', - 'version' => '2.2.1.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../php-di/phpdoc-reader', - 'aliases' => array(), - 'reference' => '66daff34cbd2627740ffec9469ffbac9f8c8185c', - 'dev_requirement' => false, - ), - 'php-di/slim-bridge' => array( - 'pretty_version' => '3.4.0', - 'version' => '3.4.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../php-di/slim-bridge', - 'aliases' => array(), - 'reference' => 'd14c95b34b3c5ba2e8c40020dd93fdcc8f3ba875', - 'dev_requirement' => false, - ), - 'psr/container' => array( - 'pretty_version' => '1.1.2', - 'version' => '1.1.2.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../psr/container', - 'aliases' => array(), - 'reference' => '513e0666f7216c7459170d56df27dfcefe1689ea', - 'dev_requirement' => false, - ), - 'psr/container-implementation' => array( - 'dev_requirement' => false, - 'provided' => array( - 0 => '^1.0', - ), - ), - 'psr/event-dispatcher' => array( - 'pretty_version' => '1.0.0', - 'version' => '1.0.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../psr/event-dispatcher', - 'aliases' => array(), - 'reference' => 'dbefd12671e8a14ec7f180cab83036ed26714bb0', - 'dev_requirement' => false, - ), - 'psr/event-dispatcher-implementation' => array( - 'dev_requirement' => false, - 'provided' => array( - 0 => '1.0', - ), - ), - 'psr/http-factory' => array( - 'pretty_version' => '1.0.2', - 'version' => '1.0.2.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../psr/http-factory', - 'aliases' => array(), - 'reference' => 'e616d01114759c4c489f93b099585439f795fe35', - 'dev_requirement' => false, - ), - 'psr/http-factory-implementation' => array( - 'dev_requirement' => false, - 'provided' => array( - 0 => '1.0', - ), - ), - 'psr/http-message' => array( - 'pretty_version' => '1.1', - 'version' => '1.1.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../psr/http-message', - 'aliases' => array(), - 'reference' => 'cb6ce4845ce34a8ad9e68117c10ee90a29919eba', - 'dev_requirement' => false, - ), - 'psr/http-message-implementation' => array( - 'dev_requirement' => false, - 'provided' => array( - 0 => '1.0', - ), - ), - 'psr/http-server-handler' => array( - 'pretty_version' => '1.0.2', - 'version' => '1.0.2.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../psr/http-server-handler', - 'aliases' => array(), - 'reference' => '84c4fb66179be4caaf8e97bd239203245302e7d4', - 'dev_requirement' => false, - ), - 'psr/http-server-middleware' => array( - 'pretty_version' => '1.0.2', - 'version' => '1.0.2.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../psr/http-server-middleware', - 'aliases' => array(), - 'reference' => 'c1481f747daaa6a0782775cd6a8c26a1bf4a3829', - 'dev_requirement' => false, - ), - 'psr/log' => array( - 'pretty_version' => '3.0.0', - 'version' => '3.0.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../psr/log', - 'aliases' => array(), - 'reference' => 'fe5ea303b0887d5caefd3d431c3e61ad47037001', - 'dev_requirement' => false, - ), - 'ralouphie/getallheaders' => array( - 'pretty_version' => '3.0.3', - 'version' => '3.0.3.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../ralouphie/getallheaders', - 'aliases' => array(), - 'reference' => '120b605dfeb996808c31b6477290a714d356e822', - 'dev_requirement' => false, - ), - 'slim/csrf' => array( - 'pretty_version' => '1.3.0', - 'version' => '1.3.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../slim/csrf', - 'aliases' => array(), - 'reference' => 'ebaaf295fd6d7224078d8ae3bba45329b31798c7', - 'dev_requirement' => false, - ), - 'slim/flash' => array( - 'pretty_version' => '0.4.0', - 'version' => '0.4.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../slim/flash', - 'aliases' => array(), - 'reference' => '9aaff5fded3b54f4e519ec3d4ac74d3d1f2cbbbc', - 'dev_requirement' => false, - ), - 'slim/psr7' => array( - 'pretty_version' => '1.6.1', - 'version' => '1.6.1.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../slim/psr7', - 'aliases' => array(), - 'reference' => '72d2b2bac94ab4575d369f605dbfafbe168d3163', - 'dev_requirement' => false, - ), - 'slim/slim' => array( - 'pretty_version' => '4.12.0', - 'version' => '4.12.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../slim/slim', - 'aliases' => array(), - 'reference' => 'e9e99c2b24398b967841c6c4c3048622cc7e2b18', - 'dev_requirement' => false, - ), - 'slim/twig-view' => array( - 'pretty_version' => '3.3.0', - 'version' => '3.3.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../slim/twig-view', - 'aliases' => array(), - 'reference' => 'df6dd6af6bbe28041be49c9fb8470c2e9b70cd98', - 'dev_requirement' => false, - ), - 'symfony/deprecation-contracts' => array( - 'pretty_version' => 'v2.5.2', - 'version' => '2.5.2.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/deprecation-contracts', - 'aliases' => array(), - 'reference' => 'e8b495ea28c1d97b5e0c121748d6f9b53d075c66', - 'dev_requirement' => false, - ), - 'symfony/event-dispatcher' => array( - 'pretty_version' => 'v5.4.26', - 'version' => '5.4.26.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/event-dispatcher', - 'aliases' => array(), - 'reference' => '5dcc00e03413f05c1e7900090927bb7247cb0aac', - 'dev_requirement' => false, - ), - 'symfony/event-dispatcher-contracts' => array( - 'pretty_version' => 'v2.5.2', - 'version' => '2.5.2.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/event-dispatcher-contracts', - 'aliases' => array(), - 'reference' => 'f98b54df6ad059855739db6fcbc2d36995283fe1', - 'dev_requirement' => false, - ), - 'symfony/event-dispatcher-implementation' => array( - 'dev_requirement' => false, - 'provided' => array( - 0 => '2.0', - ), - ), - 'symfony/finder' => array( - 'pretty_version' => 'v5.4.27', - 'version' => '5.4.27.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/finder', - 'aliases' => array(), - 'reference' => 'ff4bce3c33451e7ec778070e45bd23f74214cd5d', - 'dev_requirement' => false, - ), - 'symfony/polyfill-ctype' => array( - 'pretty_version' => 'v1.28.0', - 'version' => '1.28.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/polyfill-ctype', - 'aliases' => array(), - 'reference' => 'ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb', - 'dev_requirement' => false, - ), - 'symfony/polyfill-mbstring' => array( - 'pretty_version' => 'v1.28.0', - 'version' => '1.28.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/polyfill-mbstring', - 'aliases' => array(), - 'reference' => '42292d99c55abe617799667f454222c54c60e229', - 'dev_requirement' => false, - ), - 'symfony/polyfill-php80' => array( - 'pretty_version' => 'v1.28.0', - 'version' => '1.28.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/polyfill-php80', - 'aliases' => array(), - 'reference' => '6caa57379c4aec19c0a12a38b59b26487dcfe4b5', - 'dev_requirement' => false, - ), - 'symfony/polyfill-php81' => array( - 'pretty_version' => 'v1.28.0', - 'version' => '1.28.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/polyfill-php81', - 'aliases' => array(), - 'reference' => '7581cd600fa9fd681b797d00b02f068e2f13263b', - 'dev_requirement' => false, - ), - 'symfony/yaml' => array( - 'pretty_version' => 'v5.4.31', - 'version' => '5.4.31.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/yaml', - 'aliases' => array(), - 'reference' => 'f387675d7f5fc4231f7554baa70681f222f73563', - 'dev_requirement' => false, - ), - 'twig/twig' => array( - 'pretty_version' => 'v3.8.0', - 'version' => '3.8.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../twig/twig', - 'aliases' => array(), - 'reference' => '9d15f0ac07f44dc4217883ec6ae02fd555c6f71d', - 'dev_requirement' => false, - ), - 'typemill/typemill' => array( - 'pretty_version' => '2.x-dev', - 'version' => '2.9999999.9999999.9999999-dev', - 'type' => 'project', - 'install_path' => __DIR__ . '/../../../', - 'aliases' => array(), - 'reference' => '8fb86495b65737eaa0e413eaf1e22cc2ffd2e022', - 'dev_requirement' => false, - ), - 'vlucas/valitron' => array( - 'pretty_version' => 'v1.4.11', - 'version' => '1.4.11.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../vlucas/valitron', - 'aliases' => array(), - 'reference' => 'fadce39f5f235755bb9794b2573af2d5bfcba85f', - 'dev_requirement' => false, - ), - ), -); diff --git a/system/vendor/composer/platform_check.php b/system/vendor/composer/platform_check.php deleted file mode 100644 index adfb472..0000000 --- a/system/vendor/composer/platform_check.php +++ /dev/null @@ -1,26 +0,0 @@ -= 80000)) { - $issues[] = 'Your Composer dependencies require a PHP version ">= 8.0.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/system/vendor/composer/tmp-9d16a192a4403b63dc78e14b3dc7a307 b/system/vendor/composer/tmp-9d16a192a4403b63dc78e14b3dc7a307 deleted file mode 100644 index e6134fe..0000000 Binary files a/system/vendor/composer/tmp-9d16a192a4403b63dc78e14b3dc7a307 and /dev/null differ diff --git a/system/vendor/erusev/parsedown-extra b/system/vendor/erusev/parsedown-extra deleted file mode 160000 index fd33d68..0000000 --- a/system/vendor/erusev/parsedown-extra +++ /dev/null @@ -1 +0,0 @@ -Subproject commit fd33d68349630d18d56367712a64445a6e0bc83e diff --git a/system/vendor/erusev/parsedown/LICENSE.txt b/system/vendor/erusev/parsedown/LICENSE.txt deleted file mode 100644 index 8e7c764..0000000 --- a/system/vendor/erusev/parsedown/LICENSE.txt +++ /dev/null @@ -1,20 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2013-2018 Emanuil Rusev, erusev.com - -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/system/vendor/erusev/parsedown/Parsedown.php b/system/vendor/erusev/parsedown/Parsedown.php deleted file mode 100644 index 46974ff..0000000 --- a/system/vendor/erusev/parsedown/Parsedown.php +++ /dev/null @@ -1,1990 +0,0 @@ -textElements($text); - - # convert to markup - $markup = $this->elements($Elements); - - # trim line breaks - $markup = trim($markup, "\n"); - - return $markup; - } - - protected function textElements($text) - { - # make sure no definitions are set - $this->DefinitionData = array(); - - # standardize line breaks - $text = str_replace(array("\r\n", "\r"), "\n", $text); - - # remove surrounding line breaks - $text = trim($text, "\n"); - - # split text into lines - $lines = explode("\n", $text); - - # iterate through lines to identify blocks - return $this->linesElements($lines); - } - - # - # Setters - # - - function setBreaksEnabled($breaksEnabled) - { - $this->breaksEnabled = $breaksEnabled; - - return $this; - } - - protected $breaksEnabled; - - function setMarkupEscaped($markupEscaped) - { - $this->markupEscaped = $markupEscaped; - - return $this; - } - - protected $markupEscaped; - - function setUrlsLinked($urlsLinked) - { - $this->urlsLinked = $urlsLinked; - - return $this; - } - - protected $urlsLinked = true; - - function setSafeMode($safeMode) - { - $this->safeMode = (bool) $safeMode; - - return $this; - } - - protected $safeMode; - - function setStrictMode($strictMode) - { - $this->strictMode = (bool) $strictMode; - - return $this; - } - - protected $strictMode; - - protected $safeLinksWhitelist = array( - 'http://', - 'https://', - 'ftp://', - 'ftps://', - 'mailto:', - 'data:image/png;base64,', - 'data:image/gif;base64,', - 'data:image/jpeg;base64,', - 'irc:', - 'ircs:', - 'git:', - 'ssh:', - 'news:', - 'steam:', - ); - - # - # Lines - # - - protected $BlockTypes = array( - '#' => array('Header'), - '*' => array('Rule', 'List'), - '+' => array('List'), - '-' => array('SetextHeader', 'Table', 'Rule', 'List'), - '0' => array('List'), - '1' => array('List'), - '2' => array('List'), - '3' => array('List'), - '4' => array('List'), - '5' => array('List'), - '6' => array('List'), - '7' => array('List'), - '8' => array('List'), - '9' => array('List'), - ':' => array('Table'), - '<' => array('Comment', 'Markup'), - '=' => array('SetextHeader'), - '>' => array('Quote'), - '[' => array('Reference'), - '_' => array('Rule'), - '`' => array('FencedCode'), - '|' => array('Table'), - '~' => array('FencedCode'), - ); - - # ~ - - protected $unmarkedBlockTypes = array( - 'Code', - ); - - # - # Blocks - # - - protected function lines(array $lines) - { - return $this->elements($this->linesElements($lines)); - } - - protected function linesElements(array $lines) - { - $Elements = array(); - $CurrentBlock = null; - - foreach ($lines as $line) - { - if (chop($line) === '') - { - if (isset($CurrentBlock)) - { - $CurrentBlock['interrupted'] = (isset($CurrentBlock['interrupted']) - ? $CurrentBlock['interrupted'] + 1 : 1 - ); - } - - continue; - } - - while (($beforeTab = strstr($line, "\t", true)) !== false) - { - $shortage = 4 - mb_strlen($beforeTab, 'utf-8') % 4; - - $line = $beforeTab - . str_repeat(' ', $shortage) - . substr($line, strlen($beforeTab) + 1) - ; - } - - $indent = strspn($line, ' '); - - $text = $indent > 0 ? substr($line, $indent) : $line; - - # ~ - - $Line = array('body' => $line, 'indent' => $indent, 'text' => $text); - - # ~ - - if (isset($CurrentBlock['continuable'])) - { - $methodName = 'block' . $CurrentBlock['type'] . 'Continue'; - $Block = $this->$methodName($Line, $CurrentBlock); - - if (isset($Block)) - { - $CurrentBlock = $Block; - - continue; - } - else - { - if ($this->isBlockCompletable($CurrentBlock['type'])) - { - $methodName = 'block' . $CurrentBlock['type'] . 'Complete'; - $CurrentBlock = $this->$methodName($CurrentBlock); - } - } - } - - # ~ - - $marker = $text[0]; - - # ~ - - $blockTypes = $this->unmarkedBlockTypes; - - if (isset($this->BlockTypes[$marker])) - { - foreach ($this->BlockTypes[$marker] as $blockType) - { - $blockTypes []= $blockType; - } - } - - # - # ~ - - foreach ($blockTypes as $blockType) - { - $Block = $this->{"block$blockType"}($Line, $CurrentBlock); - - if (isset($Block)) - { - $Block['type'] = $blockType; - - if ( ! isset($Block['identified'])) - { - if (isset($CurrentBlock)) - { - $Elements[] = $this->extractElement($CurrentBlock); - } - - $Block['identified'] = true; - } - - if ($this->isBlockContinuable($blockType)) - { - $Block['continuable'] = true; - } - - $CurrentBlock = $Block; - - continue 2; - } - } - - # ~ - - if (isset($CurrentBlock) and $CurrentBlock['type'] === 'Paragraph') - { - $Block = $this->paragraphContinue($Line, $CurrentBlock); - } - - if (isset($Block)) - { - $CurrentBlock = $Block; - } - else - { - if (isset($CurrentBlock)) - { - $Elements[] = $this->extractElement($CurrentBlock); - } - - $CurrentBlock = $this->paragraph($Line); - - $CurrentBlock['identified'] = true; - } - } - - # ~ - - if (isset($CurrentBlock['continuable']) and $this->isBlockCompletable($CurrentBlock['type'])) - { - $methodName = 'block' . $CurrentBlock['type'] . 'Complete'; - $CurrentBlock = $this->$methodName($CurrentBlock); - } - - # ~ - - if (isset($CurrentBlock)) - { - $Elements[] = $this->extractElement($CurrentBlock); - } - - # ~ - - return $Elements; - } - - protected function extractElement(array $Component) - { - if ( ! isset($Component['element'])) - { - if (isset($Component['markup'])) - { - $Component['element'] = array('rawHtml' => $Component['markup']); - } - elseif (isset($Component['hidden'])) - { - $Component['element'] = array(); - } - } - - return $Component['element']; - } - - protected function isBlockContinuable($Type) - { - return method_exists($this, 'block' . $Type . 'Continue'); - } - - protected function isBlockCompletable($Type) - { - return method_exists($this, 'block' . $Type . 'Complete'); - } - - # - # Code - - protected function blockCode($Line, $Block = null) - { - if (isset($Block) and $Block['type'] === 'Paragraph' and ! isset($Block['interrupted'])) - { - return; - } - - if ($Line['indent'] >= 4) - { - $text = substr($Line['body'], 4); - - $Block = array( - 'element' => array( - 'name' => 'pre', - 'element' => array( - 'name' => 'code', - 'text' => $text, - ), - ), - ); - - return $Block; - } - } - - protected function blockCodeContinue($Line, $Block) - { - if ($Line['indent'] >= 4) - { - if (isset($Block['interrupted'])) - { - $Block['element']['element']['text'] .= str_repeat("\n", $Block['interrupted']); - - unset($Block['interrupted']); - } - - $Block['element']['element']['text'] .= "\n"; - - $text = substr($Line['body'], 4); - - $Block['element']['element']['text'] .= $text; - - return $Block; - } - } - - protected function blockCodeComplete($Block) - { - return $Block; - } - - # - # Comment - - protected function blockComment($Line) - { - if ($this->markupEscaped or $this->safeMode) - { - return; - } - - if (strpos($Line['text'], '') !== false) - { - $Block['closed'] = true; - } - - return $Block; - } - } - - protected function blockCommentContinue($Line, array $Block) - { - if (isset($Block['closed'])) - { - return; - } - - $Block['element']['rawHtml'] .= "\n" . $Line['body']; - - if (strpos($Line['text'], '-->') !== false) - { - $Block['closed'] = true; - } - - return $Block; - } - - # - # Fenced Code - - protected function blockFencedCode($Line) - { - $marker = $Line['text'][0]; - - $openerLength = strspn($Line['text'], $marker); - - if ($openerLength < 3) - { - return; - } - - $infostring = trim(substr($Line['text'], $openerLength), "\t "); - - if (strpos($infostring, '`') !== false) - { - return; - } - - $Element = array( - 'name' => 'code', - 'text' => '', - ); - - if ($infostring !== '') - { - /** - * https://www.w3.org/TR/2011/WD-html5-20110525/elements.html#classes - * Every HTML element may have a class attribute specified. - * The attribute, if specified, must have a value that is a set - * of space-separated tokens representing the various classes - * that the element belongs to. - * [...] - * The space characters, for the purposes of this specification, - * are U+0020 SPACE, U+0009 CHARACTER TABULATION (tab), - * U+000A LINE FEED (LF), U+000C FORM FEED (FF), and - * U+000D CARRIAGE RETURN (CR). - */ - $language = substr($infostring, 0, strcspn($infostring, " \t\n\f\r")); - - $Element['attributes'] = array('class' => "language-$language"); - } - - $Block = array( - 'char' => $marker, - 'openerLength' => $openerLength, - 'element' => array( - 'name' => 'pre', - 'element' => $Element, - ), - ); - - return $Block; - } - - protected function blockFencedCodeContinue($Line, $Block) - { - if (isset($Block['complete'])) - { - return; - } - - if (isset($Block['interrupted'])) - { - $Block['element']['element']['text'] .= str_repeat("\n", $Block['interrupted']); - - unset($Block['interrupted']); - } - - if (($len = strspn($Line['text'], $Block['char'])) >= $Block['openerLength'] - and chop(substr($Line['text'], $len), ' ') === '' - ) { - $Block['element']['element']['text'] = substr($Block['element']['element']['text'], 1); - - $Block['complete'] = true; - - return $Block; - } - - $Block['element']['element']['text'] .= "\n" . $Line['body']; - - return $Block; - } - - protected function blockFencedCodeComplete($Block) - { - return $Block; - } - - # - # Header - - protected function blockHeader($Line) - { - $level = strspn($Line['text'], '#'); - - if ($level > 6) - { - return; - } - - $text = trim($Line['text'], '#'); - - if ($this->strictMode and isset($text[0]) and $text[0] !== ' ') - { - return; - } - - $text = trim($text, ' '); - - $Block = array( - 'element' => array( - 'name' => 'h' . min(6, $level), - 'handler' => array( - 'function' => 'lineElements', - 'argument' => $text, - 'destination' => 'elements', - ) - ), - ); - - return $Block; - } - - # - # List - - protected function blockList($Line, array $CurrentBlock = null) - { - list($name, $pattern) = $Line['text'][0] <= '-' ? array('ul', '[*+-]') : array('ol', '[0-9]{1,9}+[.\)]'); - - if (preg_match('/^('.$pattern.'([ ]++|$))(.*+)/', $Line['text'], $matches)) - { - $contentIndent = strlen($matches[2]); - - if ($contentIndent >= 5) - { - $contentIndent -= 1; - $matches[1] = substr($matches[1], 0, -$contentIndent); - $matches[3] = str_repeat(' ', $contentIndent) . $matches[3]; - } - elseif ($contentIndent === 0) - { - $matches[1] .= ' '; - } - - $markerWithoutWhitespace = strstr($matches[1], ' ', true); - - $Block = array( - 'indent' => $Line['indent'], - 'pattern' => $pattern, - 'data' => array( - 'type' => $name, - 'marker' => $matches[1], - 'markerType' => ($name === 'ul' ? $markerWithoutWhitespace : substr($markerWithoutWhitespace, -1)), - ), - 'element' => array( - 'name' => $name, - 'elements' => array(), - ), - ); - $Block['data']['markerTypeRegex'] = preg_quote($Block['data']['markerType'], '/'); - - if ($name === 'ol') - { - $listStart = ltrim(strstr($matches[1], $Block['data']['markerType'], true), '0') ?: '0'; - - if ($listStart !== '1') - { - if ( - isset($CurrentBlock) - and $CurrentBlock['type'] === 'Paragraph' - and ! isset($CurrentBlock['interrupted']) - ) { - return; - } - - $Block['element']['attributes'] = array('start' => $listStart); - } - } - - $Block['li'] = array( - 'name' => 'li', - 'handler' => array( - 'function' => 'li', - 'argument' => !empty($matches[3]) ? array($matches[3]) : array(), - 'destination' => 'elements' - ) - ); - - $Block['element']['elements'] []= & $Block['li']; - - return $Block; - } - } - - protected function blockListContinue($Line, array $Block) - { - if (isset($Block['interrupted']) and empty($Block['li']['handler']['argument'])) - { - return null; - } - - $requiredIndent = ($Block['indent'] + strlen($Block['data']['marker'])); - - if ($Line['indent'] < $requiredIndent - and ( - ( - $Block['data']['type'] === 'ol' - and preg_match('/^[0-9]++'.$Block['data']['markerTypeRegex'].'(?:[ ]++(.*)|$)/', $Line['text'], $matches) - ) or ( - $Block['data']['type'] === 'ul' - and preg_match('/^'.$Block['data']['markerTypeRegex'].'(?:[ ]++(.*)|$)/', $Line['text'], $matches) - ) - ) - ) { - if (isset($Block['interrupted'])) - { - $Block['li']['handler']['argument'] []= ''; - - $Block['loose'] = true; - - unset($Block['interrupted']); - } - - unset($Block['li']); - - $text = isset($matches[1]) ? $matches[1] : ''; - - $Block['indent'] = $Line['indent']; - - $Block['li'] = array( - 'name' => 'li', - 'handler' => array( - 'function' => 'li', - 'argument' => array($text), - 'destination' => 'elements' - ) - ); - - $Block['element']['elements'] []= & $Block['li']; - - return $Block; - } - elseif ($Line['indent'] < $requiredIndent and $this->blockList($Line)) - { - return null; - } - - if ($Line['text'][0] === '[' and $this->blockReference($Line)) - { - return $Block; - } - - if ($Line['indent'] >= $requiredIndent) - { - if (isset($Block['interrupted'])) - { - $Block['li']['handler']['argument'] []= ''; - - $Block['loose'] = true; - - unset($Block['interrupted']); - } - - $text = substr($Line['body'], $requiredIndent); - - $Block['li']['handler']['argument'] []= $text; - - return $Block; - } - - if ( ! isset($Block['interrupted'])) - { - $text = preg_replace('/^[ ]{0,'.$requiredIndent.'}+/', '', $Line['body']); - - $Block['li']['handler']['argument'] []= $text; - - return $Block; - } - } - - protected function blockListComplete(array $Block) - { - if (isset($Block['loose'])) - { - foreach ($Block['element']['elements'] as &$li) - { - if (end($li['handler']['argument']) !== '') - { - $li['handler']['argument'] []= ''; - } - } - } - - return $Block; - } - - # - # Quote - - protected function blockQuote($Line) - { - if (preg_match('/^>[ ]?+(.*+)/', $Line['text'], $matches)) - { - $Block = array( - 'element' => array( - 'name' => 'blockquote', - 'handler' => array( - 'function' => 'linesElements', - 'argument' => (array) $matches[1], - 'destination' => 'elements', - ) - ), - ); - - return $Block; - } - } - - protected function blockQuoteContinue($Line, array $Block) - { - if (isset($Block['interrupted'])) - { - return; - } - - if ($Line['text'][0] === '>' and preg_match('/^>[ ]?+(.*+)/', $Line['text'], $matches)) - { - $Block['element']['handler']['argument'] []= $matches[1]; - - return $Block; - } - - if ( ! isset($Block['interrupted'])) - { - $Block['element']['handler']['argument'] []= $Line['text']; - - return $Block; - } - } - - # - # Rule - - protected function blockRule($Line) - { - $marker = $Line['text'][0]; - - if (substr_count($Line['text'], $marker) >= 3 and chop($Line['text'], " $marker") === '') - { - $Block = array( - 'element' => array( - 'name' => 'hr', - ), - ); - - return $Block; - } - } - - # - # Setext - - protected function blockSetextHeader($Line, array $Block = null) - { - if ( ! isset($Block) or $Block['type'] !== 'Paragraph' or isset($Block['interrupted'])) - { - return; - } - - if ($Line['indent'] < 4 and chop(chop($Line['text'], ' '), $Line['text'][0]) === '') - { - $Block['element']['name'] = $Line['text'][0] === '=' ? 'h1' : 'h2'; - - return $Block; - } - } - - # - # Markup - - protected function blockMarkup($Line) - { - if ($this->markupEscaped or $this->safeMode) - { - return; - } - - if (preg_match('/^<[\/]?+(\w*)(?:[ ]*+'.$this->regexHtmlAttribute.')*+[ ]*+(\/)?>/', $Line['text'], $matches)) - { - $element = strtolower($matches[1]); - - if (in_array($element, $this->textLevelElements)) - { - return; - } - - $Block = array( - 'name' => $matches[1], - 'element' => array( - 'rawHtml' => $Line['text'], - 'autobreak' => true, - ), - ); - - return $Block; - } - } - - protected function blockMarkupContinue($Line, array $Block) - { - if (isset($Block['closed']) or isset($Block['interrupted'])) - { - return; - } - - $Block['element']['rawHtml'] .= "\n" . $Line['body']; - - return $Block; - } - - # - # Reference - - protected function blockReference($Line) - { - if (strpos($Line['text'], ']') !== false - and preg_match('/^\[(.+?)\]:[ ]*+?(?:[ ]+["\'(](.+)["\')])?[ ]*+$/', $Line['text'], $matches) - ) { - $id = strtolower($matches[1]); - - $Data = array( - 'url' => $matches[2], - 'title' => isset($matches[3]) ? $matches[3] : null, - ); - - $this->DefinitionData['Reference'][$id] = $Data; - - $Block = array( - 'element' => array(), - ); - - return $Block; - } - } - - # - # Table - - protected function blockTable($Line, array $Block = null) - { - if ( ! isset($Block) or $Block['type'] !== 'Paragraph' or isset($Block['interrupted'])) - { - return; - } - - if ( - strpos($Block['element']['handler']['argument'], '|') === false - and strpos($Line['text'], '|') === false - and strpos($Line['text'], ':') === false - or strpos($Block['element']['handler']['argument'], "\n") !== false - ) { - return; - } - - if (chop($Line['text'], ' -:|') !== '') - { - return; - } - - $alignments = array(); - - $divider = $Line['text']; - - $divider = trim($divider); - $divider = trim($divider, '|'); - - $dividerCells = explode('|', $divider); - - foreach ($dividerCells as $dividerCell) - { - $dividerCell = trim($dividerCell); - - if ($dividerCell === '') - { - return; - } - - $alignment = null; - - if ($dividerCell[0] === ':') - { - $alignment = 'left'; - } - - if (substr($dividerCell, - 1) === ':') - { - $alignment = $alignment === 'left' ? 'center' : 'right'; - } - - $alignments []= $alignment; - } - - # ~ - - $HeaderElements = array(); - - $header = $Block['element']['handler']['argument']; - - $header = trim($header); - $header = trim($header, '|'); - - $headerCells = explode('|', $header); - - if (count($headerCells) !== count($alignments)) - { - return; - } - - foreach ($headerCells as $index => $headerCell) - { - $headerCell = trim($headerCell); - - $HeaderElement = array( - 'name' => 'th', - 'handler' => array( - 'function' => 'lineElements', - 'argument' => $headerCell, - 'destination' => 'elements', - ) - ); - - if (isset($alignments[$index])) - { - $alignment = $alignments[$index]; - - $HeaderElement['attributes'] = array( - 'style' => "text-align: $alignment;", - ); - } - - $HeaderElements []= $HeaderElement; - } - - # ~ - - $Block = array( - 'alignments' => $alignments, - 'identified' => true, - 'element' => array( - 'name' => 'table', - 'elements' => array(), - ), - ); - - $Block['element']['elements'] []= array( - 'name' => 'thead', - ); - - $Block['element']['elements'] []= array( - 'name' => 'tbody', - 'elements' => array(), - ); - - $Block['element']['elements'][0]['elements'] []= array( - 'name' => 'tr', - 'elements' => $HeaderElements, - ); - - return $Block; - } - - protected function blockTableContinue($Line, array $Block) - { - if (isset($Block['interrupted'])) - { - return; - } - - if (count($Block['alignments']) === 1 or $Line['text'][0] === '|' or strpos($Line['text'], '|')) - { - $Elements = array(); - - $row = $Line['text']; - - $row = trim($row); - $row = trim($row, '|'); - - preg_match_all('/(?:(\\\\[|])|[^|`]|`[^`]++`|`)++/', $row, $matches); - - $cells = array_slice($matches[0], 0, count($Block['alignments'])); - - foreach ($cells as $index => $cell) - { - $cell = trim($cell); - - $Element = array( - 'name' => 'td', - 'handler' => array( - 'function' => 'lineElements', - 'argument' => $cell, - 'destination' => 'elements', - ) - ); - - if (isset($Block['alignments'][$index])) - { - $Element['attributes'] = array( - 'style' => 'text-align: ' . $Block['alignments'][$index] . ';', - ); - } - - $Elements []= $Element; - } - - $Element = array( - 'name' => 'tr', - 'elements' => $Elements, - ); - - $Block['element']['elements'][1]['elements'] []= $Element; - - return $Block; - } - } - - # - # ~ - # - - protected function paragraph($Line) - { - return array( - 'type' => 'Paragraph', - 'element' => array( - 'name' => 'p', - 'handler' => array( - 'function' => 'lineElements', - 'argument' => $Line['text'], - 'destination' => 'elements', - ), - ), - ); - } - - protected function paragraphContinue($Line, array $Block) - { - if (isset($Block['interrupted'])) - { - return; - } - - $Block['element']['handler']['argument'] .= "\n".$Line['text']; - - return $Block; - } - - # - # Inline Elements - # - - protected $InlineTypes = array( - '!' => array('Image'), - '&' => array('SpecialCharacter'), - '*' => array('Emphasis'), - ':' => array('Url'), - '<' => array('UrlTag', 'EmailTag', 'Markup'), - '[' => array('Link'), - '_' => array('Emphasis'), - '`' => array('Code'), - '~' => array('Strikethrough'), - '\\' => array('EscapeSequence'), - ); - - # ~ - - protected $inlineMarkerList = '!*_&[:<`~\\'; - - # - # ~ - # - - public function line($text, $nonNestables = array()) - { - return $this->elements($this->lineElements($text, $nonNestables)); - } - - protected function lineElements($text, $nonNestables = array()) - { - $Elements = array(); - - $nonNestables = (empty($nonNestables) - ? array() - : array_combine($nonNestables, $nonNestables) - ); - - # $excerpt is based on the first occurrence of a marker - - while ($excerpt = strpbrk($text, $this->inlineMarkerList)) - { - $marker = $excerpt[0]; - - $markerPosition = strlen($text) - strlen($excerpt); - - $Excerpt = array('text' => $excerpt, 'context' => $text); - - foreach ($this->InlineTypes[$marker] as $inlineType) - { - # check to see if the current inline type is nestable in the current context - - if (isset($nonNestables[$inlineType])) - { - continue; - } - - $Inline = $this->{"inline$inlineType"}($Excerpt); - - if ( ! isset($Inline)) - { - continue; - } - - # makes sure that the inline belongs to "our" marker - - if (isset($Inline['position']) and $Inline['position'] > $markerPosition) - { - continue; - } - - # sets a default inline position - - if ( ! isset($Inline['position'])) - { - $Inline['position'] = $markerPosition; - } - - # cause the new element to 'inherit' our non nestables - - - $Inline['element']['nonNestables'] = isset($Inline['element']['nonNestables']) - ? array_merge($Inline['element']['nonNestables'], $nonNestables) - : $nonNestables - ; - - # the text that comes before the inline - $unmarkedText = substr($text, 0, $Inline['position']); - - # compile the unmarked text - $InlineText = $this->inlineText($unmarkedText); - $Elements[] = $InlineText['element']; - - # compile the inline - $Elements[] = $this->extractElement($Inline); - - # remove the examined text - $text = substr($text, $Inline['position'] + $Inline['extent']); - - continue 2; - } - - # the marker does not belong to an inline - - $unmarkedText = substr($text, 0, $markerPosition + 1); - - $InlineText = $this->inlineText($unmarkedText); - $Elements[] = $InlineText['element']; - - $text = substr($text, $markerPosition + 1); - } - - $InlineText = $this->inlineText($text); - $Elements[] = $InlineText['element']; - - foreach ($Elements as &$Element) - { - if ( ! isset($Element['autobreak'])) - { - $Element['autobreak'] = false; - } - } - - return $Elements; - } - - # - # ~ - # - - protected function inlineText($text) - { - $Inline = array( - 'extent' => strlen($text), - 'element' => array(), - ); - - $Inline['element']['elements'] = self::pregReplaceElements( - $this->breaksEnabled ? '/[ ]*+\n/' : '/(?:[ ]*+\\\\|[ ]{2,}+)\n/', - array( - array('name' => 'br'), - array('text' => "\n"), - ), - $text - ); - - return $Inline; - } - - protected function inlineCode($Excerpt) - { - $marker = $Excerpt['text'][0]; - - if (preg_match('/^(['.$marker.']++)[ ]*+(.+?)[ ]*+(? strlen($matches[0]), - 'element' => array( - 'name' => 'code', - 'text' => $text, - ), - ); - } - } - - protected function inlineEmailTag($Excerpt) - { - $hostnameLabel = '[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?'; - - $commonMarkEmail = '[a-zA-Z0-9.!#$%&\'*+\/=?^_`{|}~-]++@' - . $hostnameLabel . '(?:\.' . $hostnameLabel . ')*'; - - if (strpos($Excerpt['text'], '>') !== false - and preg_match("/^<((mailto:)?$commonMarkEmail)>/i", $Excerpt['text'], $matches) - ){ - $url = $matches[1]; - - if ( ! isset($matches[2])) - { - $url = "mailto:$url"; - } - - return array( - 'extent' => strlen($matches[0]), - 'element' => array( - 'name' => 'a', - 'text' => $matches[1], - 'attributes' => array( - 'href' => $url, - ), - ), - ); - } - } - - protected function inlineEmphasis($Excerpt) - { - if ( ! isset($Excerpt['text'][1])) - { - return; - } - - $marker = $Excerpt['text'][0]; - - if ($Excerpt['text'][1] === $marker and preg_match($this->StrongRegex[$marker], $Excerpt['text'], $matches)) - { - $emphasis = 'strong'; - } - elseif (preg_match($this->EmRegex[$marker], $Excerpt['text'], $matches)) - { - $emphasis = 'em'; - } - else - { - return; - } - - return array( - 'extent' => strlen($matches[0]), - 'element' => array( - 'name' => $emphasis, - 'handler' => array( - 'function' => 'lineElements', - 'argument' => $matches[1], - 'destination' => 'elements', - ) - ), - ); - } - - protected function inlineEscapeSequence($Excerpt) - { - if (isset($Excerpt['text'][1]) and in_array($Excerpt['text'][1], $this->specialCharacters)) - { - return array( - 'element' => array('rawHtml' => $Excerpt['text'][1]), - 'extent' => 2, - ); - } - } - - protected function inlineImage($Excerpt) - { - if ( ! isset($Excerpt['text'][1]) or $Excerpt['text'][1] !== '[') - { - return; - } - - $Excerpt['text']= substr($Excerpt['text'], 1); - - $Link = $this->inlineLink($Excerpt); - - if ($Link === null) - { - return; - } - - $Inline = array( - 'extent' => $Link['extent'] + 1, - 'element' => array( - 'name' => 'img', - 'attributes' => array( - 'src' => $Link['element']['attributes']['href'], - 'alt' => $Link['element']['handler']['argument'], - ), - 'autobreak' => true, - ), - ); - - $Inline['element']['attributes'] += $Link['element']['attributes']; - - unset($Inline['element']['attributes']['href']); - - return $Inline; - } - - protected function inlineLink($Excerpt) - { - $Element = array( - 'name' => 'a', - 'handler' => array( - 'function' => 'lineElements', - 'argument' => null, - 'destination' => 'elements', - ), - 'nonNestables' => array('Url', 'Link'), - 'attributes' => array( - 'href' => null, - 'title' => null, - ), - ); - - $extent = 0; - - $remainder = $Excerpt['text']; - - if (preg_match('/\[((?:[^][]++|(?R))*+)\]/', $remainder, $matches)) - { - $Element['handler']['argument'] = $matches[1]; - - $extent += strlen($matches[0]); - - $remainder = substr($remainder, $extent); - } - else - { - return; - } - - if (preg_match('/^[(]\s*+((?:[^ ()]++|[(][^ )]+[)])++)(?:[ ]+("[^"]*+"|\'[^\']*+\'))?\s*+[)]/', $remainder, $matches)) - { - $Element['attributes']['href'] = $matches[1]; - - if (isset($matches[2])) - { - $Element['attributes']['title'] = substr($matches[2], 1, - 1); - } - - $extent += strlen($matches[0]); - } - else - { - if (preg_match('/^\s*\[(.*?)\]/', $remainder, $matches)) - { - $definition = strlen($matches[1]) ? $matches[1] : $Element['handler']['argument']; - $definition = strtolower($definition); - - $extent += strlen($matches[0]); - } - else - { - $definition = strtolower($Element['handler']['argument']); - } - - if ( ! isset($this->DefinitionData['Reference'][$definition])) - { - return; - } - - $Definition = $this->DefinitionData['Reference'][$definition]; - - $Element['attributes']['href'] = $Definition['url']; - $Element['attributes']['title'] = $Definition['title']; - } - - return array( - 'extent' => $extent, - 'element' => $Element, - ); - } - - protected function inlineMarkup($Excerpt) - { - if ($this->markupEscaped or $this->safeMode or strpos($Excerpt['text'], '>') === false) - { - return; - } - - if ($Excerpt['text'][1] === '/' and preg_match('/^<\/\w[\w-]*+[ ]*+>/s', $Excerpt['text'], $matches)) - { - return array( - 'element' => array('rawHtml' => $matches[0]), - 'extent' => strlen($matches[0]), - ); - } - - if ($Excerpt['text'][1] === '!' and preg_match('/^/s', $Excerpt['text'], $matches)) - { - return array( - 'element' => array('rawHtml' => $matches[0]), - 'extent' => strlen($matches[0]), - ); - } - - if ($Excerpt['text'][1] !== ' ' and preg_match('/^<\w[\w-]*+(?:[ ]*+'.$this->regexHtmlAttribute.')*+[ ]*+\/?>/s', $Excerpt['text'], $matches)) - { - return array( - 'element' => array('rawHtml' => $matches[0]), - 'extent' => strlen($matches[0]), - ); - } - } - - protected function inlineSpecialCharacter($Excerpt) - { - if ($Excerpt['text'][1] !== ' ' and strpos($Excerpt['text'], ';') !== false - and preg_match('/^&(#?+[0-9a-zA-Z]++);/', $Excerpt['text'], $matches) - ) { - return array( - 'element' => array('rawHtml' => '&' . $matches[1] . ';'), - 'extent' => strlen($matches[0]), - ); - } - - return; - } - - protected function inlineStrikethrough($Excerpt) - { - if ( ! isset($Excerpt['text'][1])) - { - return; - } - - if ($Excerpt['text'][1] === '~' and preg_match('/^~~(?=\S)(.+?)(?<=\S)~~/', $Excerpt['text'], $matches)) - { - return array( - 'extent' => strlen($matches[0]), - 'element' => array( - 'name' => 'del', - 'handler' => array( - 'function' => 'lineElements', - 'argument' => $matches[1], - 'destination' => 'elements', - ) - ), - ); - } - } - - protected function inlineUrl($Excerpt) - { - if ($this->urlsLinked !== true or ! isset($Excerpt['text'][2]) or $Excerpt['text'][2] !== '/') - { - return; - } - - if (strpos($Excerpt['context'], 'http') !== false - and preg_match('/\bhttps?+:[\/]{2}[^\s<]+\b\/*+/ui', $Excerpt['context'], $matches, PREG_OFFSET_CAPTURE) - ) { - $url = $matches[0][0]; - - $Inline = array( - 'extent' => strlen($matches[0][0]), - 'position' => $matches[0][1], - 'element' => array( - 'name' => 'a', - 'text' => $url, - 'attributes' => array( - 'href' => $url, - ), - ), - ); - - return $Inline; - } - } - - protected function inlineUrlTag($Excerpt) - { - if (strpos($Excerpt['text'], '>') !== false and preg_match('/^<(\w++:\/{2}[^ >]++)>/i', $Excerpt['text'], $matches)) - { - $url = $matches[1]; - - return array( - 'extent' => strlen($matches[0]), - 'element' => array( - 'name' => 'a', - 'text' => $url, - 'attributes' => array( - 'href' => $url, - ), - ), - ); - } - } - - # ~ - - protected function unmarkedText($text) - { - $Inline = $this->inlineText($text); - return $this->element($Inline['element']); - } - - # - # Handlers - # - - protected function handle(array $Element) - { - if (isset($Element['handler'])) - { - if (!isset($Element['nonNestables'])) - { - $Element['nonNestables'] = array(); - } - - if (is_string($Element['handler'])) - { - $function = $Element['handler']; - $argument = $Element['text']; - unset($Element['text']); - $destination = 'rawHtml'; - } - else - { - $function = $Element['handler']['function']; - $argument = $Element['handler']['argument']; - $destination = $Element['handler']['destination']; - } - - $Element[$destination] = $this->{$function}($argument, $Element['nonNestables']); - - if ($destination === 'handler') - { - $Element = $this->handle($Element); - } - - unset($Element['handler']); - } - - return $Element; - } - - protected function handleElementRecursive(array $Element) - { - return $this->elementApplyRecursive(array($this, 'handle'), $Element); - } - - protected function handleElementsRecursive(array $Elements) - { - return $this->elementsApplyRecursive(array($this, 'handle'), $Elements); - } - - protected function elementApplyRecursive($closure, array $Element) - { - $Element = call_user_func($closure, $Element); - - if (isset($Element['elements'])) - { - $Element['elements'] = $this->elementsApplyRecursive($closure, $Element['elements']); - } - elseif (isset($Element['element'])) - { - $Element['element'] = $this->elementApplyRecursive($closure, $Element['element']); - } - - return $Element; - } - - protected function elementApplyRecursiveDepthFirst($closure, array $Element) - { - if (isset($Element['elements'])) - { - $Element['elements'] = $this->elementsApplyRecursiveDepthFirst($closure, $Element['elements']); - } - elseif (isset($Element['element'])) - { - $Element['element'] = $this->elementsApplyRecursiveDepthFirst($closure, $Element['element']); - } - - $Element = call_user_func($closure, $Element); - - return $Element; - } - - protected function elementsApplyRecursive($closure, array $Elements) - { - foreach ($Elements as &$Element) - { - $Element = $this->elementApplyRecursive($closure, $Element); - } - - return $Elements; - } - - protected function elementsApplyRecursiveDepthFirst($closure, array $Elements) - { - foreach ($Elements as &$Element) - { - $Element = $this->elementApplyRecursiveDepthFirst($closure, $Element); - } - - return $Elements; - } - - protected function element(array $Element) - { - if ($this->safeMode) - { - $Element = $this->sanitiseElement($Element); - } - - # identity map if element has no handler - $Element = $this->handle($Element); - - $hasName = isset($Element['name']); - - $markup = ''; - - if ($hasName) - { - $markup .= '<' . $Element['name']; - - if (isset($Element['attributes'])) - { - foreach ($Element['attributes'] as $name => $value) - { - if ($value === null) - { - continue; - } - - $markup .= " $name=\"".self::escape($value).'"'; - } - } - } - - $permitRawHtml = false; - - if (isset($Element['text'])) - { - $text = $Element['text']; - } - // very strongly consider an alternative if you're writing an - // extension - elseif (isset($Element['rawHtml'])) - { - $text = $Element['rawHtml']; - - $allowRawHtmlInSafeMode = isset($Element['allowRawHtmlInSafeMode']) && $Element['allowRawHtmlInSafeMode']; - $permitRawHtml = !$this->safeMode || $allowRawHtmlInSafeMode; - } - - $hasContent = isset($text) || isset($Element['element']) || isset($Element['elements']); - - if ($hasContent) - { - $markup .= $hasName ? '>' : ''; - - if (isset($Element['elements'])) - { - $markup .= $this->elements($Element['elements']); - } - elseif (isset($Element['element'])) - { - $markup .= $this->element($Element['element']); - } - else - { - if (!$permitRawHtml) - { - $markup .= self::escape($text, true); - } - else - { - $markup .= $text; - } - } - - $markup .= $hasName ? '' : ''; - } - elseif ($hasName) - { - $markup .= ' />'; - } - - return $markup; - } - - protected function elements(array $Elements) - { - $markup = ''; - - $autoBreak = true; - - foreach ($Elements as $Element) - { - if (empty($Element)) - { - continue; - } - - $autoBreakNext = (isset($Element['autobreak']) - ? $Element['autobreak'] : isset($Element['name']) - ); - // (autobreak === false) covers both sides of an element - $autoBreak = !$autoBreak ? $autoBreak : $autoBreakNext; - - $markup .= ($autoBreak ? "\n" : '') . $this->element($Element); - $autoBreak = $autoBreakNext; - } - - $markup .= $autoBreak ? "\n" : ''; - - return $markup; - } - - # ~ - - protected function li($lines) - { - $Elements = $this->linesElements($lines); - - if ( ! in_array('', $lines) - and isset($Elements[0]) and isset($Elements[0]['name']) - and $Elements[0]['name'] === 'p' - ) { - unset($Elements[0]['name']); - } - - return $Elements; - } - - # - # AST Convenience - # - - /** - * Replace occurrences $regexp with $Elements in $text. Return an array of - * elements representing the replacement. - */ - protected static function pregReplaceElements($regexp, $Elements, $text) - { - $newElements = array(); - - while (preg_match($regexp, $text, $matches, PREG_OFFSET_CAPTURE)) - { - $offset = $matches[0][1]; - $before = substr($text, 0, $offset); - $after = substr($text, $offset + strlen($matches[0][0])); - - $newElements[] = array('text' => $before); - - foreach ($Elements as $Element) - { - $newElements[] = $Element; - } - - $text = $after; - } - - $newElements[] = array('text' => $text); - - return $newElements; - } - - # - # Deprecated Methods - # - - function parse($text) - { - $markup = $this->text($text); - - return $markup; - } - - protected function sanitiseElement(array $Element) - { - static $goodAttribute = '/^[a-zA-Z0-9][a-zA-Z0-9-_]*+$/'; - static $safeUrlNameToAtt = array( - 'a' => 'href', - 'img' => 'src', - ); - - if ( ! isset($Element['name'])) - { - unset($Element['attributes']); - return $Element; - } - - if (isset($safeUrlNameToAtt[$Element['name']])) - { - $Element = $this->filterUnsafeUrlInAttribute($Element, $safeUrlNameToAtt[$Element['name']]); - } - - if ( ! empty($Element['attributes'])) - { - foreach ($Element['attributes'] as $att => $val) - { - # filter out badly parsed attribute - if ( ! preg_match($goodAttribute, $att)) - { - unset($Element['attributes'][$att]); - } - # dump onevent attribute - elseif (self::striAtStart($att, 'on')) - { - unset($Element['attributes'][$att]); - } - } - } - - return $Element; - } - - protected function filterUnsafeUrlInAttribute(array $Element, $attribute) - { - foreach ($this->safeLinksWhitelist as $scheme) - { - if (self::striAtStart($Element['attributes'][$attribute], $scheme)) - { - return $Element; - } - } - - $Element['attributes'][$attribute] = str_replace(':', '%3A', $Element['attributes'][$attribute]); - - return $Element; - } - - # - # Static Methods - # - - protected static function escape($text, $allowQuotes = false) - { - return htmlspecialchars($text, $allowQuotes ? ENT_NOQUOTES : ENT_QUOTES, 'UTF-8'); - } - - protected static function striAtStart($string, $needle) - { - $len = strlen($needle); - - if ($len > strlen($string)) - { - return false; - } - else - { - return strtolower(substr($string, 0, $len)) === strtolower($needle); - } - } - - static function instance($name = 'default') - { - if (isset(self::$instances[$name])) - { - return self::$instances[$name]; - } - - $instance = new static(); - - self::$instances[$name] = $instance; - - return $instance; - } - - private static $instances = array(); - - # - # Fields - # - - protected $DefinitionData; - - # - # Read-Only - - protected $specialCharacters = array( - '\\', '`', '*', '_', '{', '}', '[', ']', '(', ')', '>', '#', '+', '-', '.', '!', '|', '~' - ); - - protected $StrongRegex = array( - '*' => '/^[*]{2}((?:\\\\\*|[^*]|[*][^*]*+[*])+?)[*]{2}(?![*])/s', - '_' => '/^__((?:\\\\_|[^_]|_[^_]*+_)+?)__(?!_)/us', - ); - - protected $EmRegex = array( - '*' => '/^[*]((?:\\\\\*|[^*]|[*][*][^*]+?[*][*])+?)[*](?![*])/s', - '_' => '/^_((?:\\\\_|[^_]|__[^_]*__)+?)_(?!_)\b/us', - ); - - protected $regexHtmlAttribute = '[a-zA-Z_:][\w:.-]*+(?:\s*+=\s*+(?:[^"\'=<>`\s]+|"[^"]*+"|\'[^\']*+\'))?+'; - - protected $voidElements = array( - 'area', 'base', 'br', 'col', 'command', 'embed', 'hr', 'img', 'input', 'link', 'meta', 'param', 'source', - ); - - protected $textLevelElements = array( - 'a', 'br', 'bdo', 'abbr', 'blink', 'nextid', 'acronym', 'basefont', - 'b', 'em', 'big', 'cite', 'small', 'spacer', 'listing', - 'i', 'rp', 'del', 'code', 'strike', 'marquee', - 'q', 'rt', 'ins', 'font', 'strong', - 's', 'tt', 'kbd', 'mark', - 'u', 'xm', 'sub', 'nobr', - 'sup', 'ruby', - 'var', 'span', - 'wbr', 'time', - ); -} diff --git a/system/vendor/erusev/parsedown/README.md b/system/vendor/erusev/parsedown/README.md deleted file mode 100644 index cdf0167..0000000 --- a/system/vendor/erusev/parsedown/README.md +++ /dev/null @@ -1,97 +0,0 @@ -> I also make [Caret](https://caret.io?ref=parsedown) - a Markdown editor for Mac and PC. - -## Parsedown - -[![Build Status](https://img.shields.io/travis/erusev/parsedown/master.svg?style=flat-square)](https://travis-ci.org/erusev/parsedown) - - -Better Markdown Parser in PHP - -[Demo](http://parsedown.org/demo) | -[Benchmarks](http://parsedown.org/speed) | -[Tests](http://parsedown.org/tests/) | -[Documentation](https://github.com/erusev/parsedown/wiki/) - -### Features - -* One File -* No Dependencies -* Super Fast -* Extensible -* [GitHub flavored](https://help.github.com/articles/github-flavored-markdown) -* Tested in 5.3 to 7.2 and in HHVM -* [Markdown Extra extension](https://github.com/erusev/parsedown-extra) - -### Installation -#### Composer -Install the [composer package] by running the following command: - - composer require erusev/parsedown - -#### Manual -1. Download the "Source code" from the [latest release] -2. Include `Parsedown.php` - -[composer package]: https://packagist.org/packages/erusev/parsedown "The Parsedown package on packagist.org" -[latest release]: https://github.com/erusev/parsedown/releases/latest "The latest release of Parsedown" - -### Example - -``` php -$Parsedown = new Parsedown(); - -echo $Parsedown->text('Hello _Parsedown_!'); # prints:

Hello Parsedown!

-// you can also parse inline markdown only -echo $Parsedown->line('Hello _Parsedown_!'); # prints: Hello Parsedown! -``` - -More examples in [the wiki](https://github.com/erusev/parsedown/wiki/) and in [this video tutorial](http://youtu.be/wYZBY8DEikI). - -### Security - -Parsedown is capable of escaping user-input within the HTML that it generates. Additionally Parsedown will apply sanitisation to additional scripting vectors (such as scripting link destinations) that are introduced by the markdown syntax itself. - -To tell Parsedown that it is processing untrusted user-input, use the following: -```php -$parsedown = new Parsedown; -$parsedown->setSafeMode(true); -``` - -If instead, you wish to allow HTML within untrusted user-input, but still want output to be free from XSS it is recommended that you make use of a HTML sanitiser that allows HTML tags to be whitelisted, like [HTML Purifier](http://htmlpurifier.org/). - -In both cases you should strongly consider employing defence-in-depth measures, like [deploying a Content-Security-Policy](https://scotthelme.co.uk/content-security-policy-an-introduction/) (a browser security feature) so that your page is likely to be safe even if an attacker finds a vulnerability in one of the first lines of defence above. - -#### Security of Parsedown Extensions - -Safe mode does not necessarily yield safe results when using extensions to Parsedown. Extensions should be evaluated on their own to determine their specific safety against XSS. - -### Escaping HTML -> ⚠️  **WARNING:** This method isn't safe from XSS! - -If you wish to escape HTML **in trusted input**, you can use the following: -```php -$parsedown = new Parsedown; -$parsedown->setMarkupEscaped(true); -``` - -Beware that this still allows users to insert unsafe scripting vectors, such as links like `[xss](javascript:alert%281%29)`. - -### Questions - -**How does Parsedown work?** - -It tries to read Markdown like a human. First, it looks at the lines. It’s interested in how the lines start. This helps it recognise blocks. It knows, for example, that if a line starts with a `-` then perhaps it belongs to a list. Once it recognises the blocks, it continues to the content. As it reads, it watches out for special characters. This helps it recognise inline elements (or inlines). - -We call this approach "line based". We believe that Parsedown is the first Markdown parser to use it. Since the release of Parsedown, other developers have used the same approach to develop other Markdown parsers in PHP and in other languages. - -**Is it compliant with CommonMark?** - -It passes most of the CommonMark tests. Most of the tests that don't pass deal with cases that are quite uncommon. Still, as CommonMark matures, compliance should improve. - -**Who uses it?** - -[Laravel Framework](https://laravel.com/), [Bolt CMS](http://bolt.cm/), [Grav CMS](http://getgrav.org/), [Herbie CMS](http://www.getherbie.org/), [Kirby CMS](http://getkirby.com/), [October CMS](http://octobercms.com/), [Pico CMS](http://picocms.org), [Statamic CMS](http://www.statamic.com/), [phpDocumentor](http://www.phpdoc.org/), [RaspberryPi.org](http://www.raspberrypi.org/), [Symfony demo](https://github.com/symfony/symfony-demo) and [more](https://packagist.org/packages/erusev/parsedown/dependents). - -**How can I help?** - -Use it, star it, share it and if you feel generous, [donate](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=528P3NZQMP8N2). diff --git a/system/vendor/erusev/parsedown/composer.json b/system/vendor/erusev/parsedown/composer.json deleted file mode 100644 index f8b40f8..0000000 --- a/system/vendor/erusev/parsedown/composer.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "erusev/parsedown", - "description": "Parser for Markdown.", - "keywords": ["markdown", "parser"], - "homepage": "http://parsedown.org", - "type": "library", - "license": "MIT", - "authors": [ - { - "name": "Emanuil Rusev", - "email": "hello@erusev.com", - "homepage": "http://erusev.com" - } - ], - "require": { - "php": ">=5.3.0", - "ext-mbstring": "*" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.35" - }, - "autoload": { - "psr-0": {"Parsedown": ""} - }, - "autoload-dev": { - "psr-0": { - "TestParsedown": "test/", - "ParsedownTest": "test/", - "CommonMarkTest": "test/", - "CommonMarkTestWeak": "test/" - } - } -} diff --git a/system/vendor/fig/http-message-util/.gitignore b/system/vendor/fig/http-message-util/.gitignore deleted file mode 100644 index 48b8bf9..0000000 --- a/system/vendor/fig/http-message-util/.gitignore +++ /dev/null @@ -1 +0,0 @@ -vendor/ diff --git a/system/vendor/fig/http-message-util/CHANGELOG.md b/system/vendor/fig/http-message-util/CHANGELOG.md deleted file mode 100644 index 1a02e54..0000000 --- a/system/vendor/fig/http-message-util/CHANGELOG.md +++ /dev/null @@ -1,147 +0,0 @@ -# Changelog - -All notable changes to this project will be documented in this file, in reverse chronological order by release. - -## 1.1.5 - 2020-11-24 - -### Added - -- [#19](https://github.com/php-fig/http-message-util/pull/19) adds support for PHP 8. - -### Changed - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- Nothing. - -## 1.1.4 - 2020-02-05 - -### Added - -- Nothing. - -### Changed - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- [#15](https://github.com/php-fig/http-message-util/pull/15) removes the dependency on psr/http-message, as it is not technically necessary for usage of this package. - -### Fixed - -- Nothing. - -## 1.1.3 - 2018-11-19 - -### Added - -- [#10](https://github.com/php-fig/http-message-util/pull/10) adds the constants `StatusCodeInterface::STATUS_EARLY_HINTS` (103) and - `StatusCodeInterface::STATUS_TOO_EARLY` (425). - -### Changed - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- Nothing. - -## 1.1.2 - 2017-02-09 - -### Added - -- [#4](https://github.com/php-fig/http-message-util/pull/4) adds the constant - `StatusCodeInterface::STATUS_MISDIRECTED_REQUEST` (421). - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- Nothing. - -## 1.1.1 - 2017-02-06 - -### Added - -- [#3](https://github.com/php-fig/http-message-util/pull/3) adds the constant - `StatusCodeInterface::STATUS_IM_A_TEAPOT` (418). - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- Nothing. - -## 1.1.0 - 2016-09-19 - -### Added - -- [#1](https://github.com/php-fig/http-message-util/pull/1) adds - `Fig\Http\Message\StatusCodeInterface`, with constants named after common - status reason phrases, with values indicating the status codes themselves. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- Nothing. - -## 1.0.0 - 2017-08-05 - -### Added - -- Adds `Fig\Http\Message\RequestMethodInterface`, with constants covering the - most common HTTP request methods as specified by the IETF. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- Nothing. diff --git a/system/vendor/fig/http-message-util/LICENSE b/system/vendor/fig/http-message-util/LICENSE deleted file mode 100644 index e2fa347..0000000 --- a/system/vendor/fig/http-message-util/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2016 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/system/vendor/fig/http-message-util/README.md b/system/vendor/fig/http-message-util/README.md deleted file mode 100644 index ea5b5aa..0000000 --- a/system/vendor/fig/http-message-util/README.md +++ /dev/null @@ -1,17 +0,0 @@ -# PSR Http Message Util - -This repository holds utility classes and constants to facilitate common -operations of [PSR-7](https://www.php-fig.org/psr/psr-7/); the primary purpose is -to provide constants for referring to request methods, response status codes and -messages, and potentially common headers. - -Implementation of PSR-7 interfaces is **not** within the scope of this package. - -## Installation - -Install by adding the package as a [Composer](https://getcomposer.org) -requirement: - -```bash -$ composer require fig/http-message-util -``` diff --git a/system/vendor/fig/http-message-util/composer.json b/system/vendor/fig/http-message-util/composer.json deleted file mode 100644 index 8645893..0000000 --- a/system/vendor/fig/http-message-util/composer.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "fig/http-message-util", - "description": "Utility classes and constants for use with PSR-7 (psr/http-message)", - "keywords": ["psr", "psr-7", "http", "http-message", "request", "response"], - "license": "MIT", - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "require": { - "php": "^5.3 || ^7.0 || ^8.0" - }, - "suggest": { - "psr/http-message": "The package containing the PSR-7 interfaces" - }, - "autoload": { - "psr-4": { - "Fig\\Http\\Message\\": "src/" - } - }, - "extra": { - "branch-alias": { - "dev-master": "1.1.x-dev" - } - } -} diff --git a/system/vendor/fig/http-message-util/src/RequestMethodInterface.php b/system/vendor/fig/http-message-util/src/RequestMethodInterface.php deleted file mode 100644 index 97d9a93..0000000 --- a/system/vendor/fig/http-message-util/src/RequestMethodInterface.php +++ /dev/null @@ -1,34 +0,0 @@ - - * class RequestFactory implements RequestMethodInterface - * { - * public static function factory( - * $uri = '/', - * $method = self::METHOD_GET, - * $data = [] - * ) { - * } - * } - * - */ -interface RequestMethodInterface -{ - const METHOD_HEAD = 'HEAD'; - const METHOD_GET = 'GET'; - const METHOD_POST = 'POST'; - const METHOD_PUT = 'PUT'; - const METHOD_PATCH = 'PATCH'; - const METHOD_DELETE = 'DELETE'; - const METHOD_PURGE = 'PURGE'; - const METHOD_OPTIONS = 'OPTIONS'; - const METHOD_TRACE = 'TRACE'; - const METHOD_CONNECT = 'CONNECT'; -} diff --git a/system/vendor/fig/http-message-util/src/StatusCodeInterface.php b/system/vendor/fig/http-message-util/src/StatusCodeInterface.php deleted file mode 100644 index 99b7e78..0000000 --- a/system/vendor/fig/http-message-util/src/StatusCodeInterface.php +++ /dev/null @@ -1,107 +0,0 @@ - - * class ResponseFactory implements StatusCodeInterface - * { - * public function createResponse($code = self::STATUS_OK) - * { - * } - * } - * - */ -interface StatusCodeInterface -{ - // Informational 1xx - const STATUS_CONTINUE = 100; - const STATUS_SWITCHING_PROTOCOLS = 101; - const STATUS_PROCESSING = 102; - const STATUS_EARLY_HINTS = 103; - // Successful 2xx - const STATUS_OK = 200; - const STATUS_CREATED = 201; - const STATUS_ACCEPTED = 202; - const STATUS_NON_AUTHORITATIVE_INFORMATION = 203; - const STATUS_NO_CONTENT = 204; - const STATUS_RESET_CONTENT = 205; - const STATUS_PARTIAL_CONTENT = 206; - const STATUS_MULTI_STATUS = 207; - const STATUS_ALREADY_REPORTED = 208; - const STATUS_IM_USED = 226; - // Redirection 3xx - const STATUS_MULTIPLE_CHOICES = 300; - const STATUS_MOVED_PERMANENTLY = 301; - const STATUS_FOUND = 302; - const STATUS_SEE_OTHER = 303; - const STATUS_NOT_MODIFIED = 304; - const STATUS_USE_PROXY = 305; - const STATUS_RESERVED = 306; - const STATUS_TEMPORARY_REDIRECT = 307; - const STATUS_PERMANENT_REDIRECT = 308; - // Client Errors 4xx - const STATUS_BAD_REQUEST = 400; - const STATUS_UNAUTHORIZED = 401; - const STATUS_PAYMENT_REQUIRED = 402; - const STATUS_FORBIDDEN = 403; - const STATUS_NOT_FOUND = 404; - const STATUS_METHOD_NOT_ALLOWED = 405; - const STATUS_NOT_ACCEPTABLE = 406; - const STATUS_PROXY_AUTHENTICATION_REQUIRED = 407; - const STATUS_REQUEST_TIMEOUT = 408; - const STATUS_CONFLICT = 409; - const STATUS_GONE = 410; - const STATUS_LENGTH_REQUIRED = 411; - const STATUS_PRECONDITION_FAILED = 412; - const STATUS_PAYLOAD_TOO_LARGE = 413; - const STATUS_URI_TOO_LONG = 414; - const STATUS_UNSUPPORTED_MEDIA_TYPE = 415; - const STATUS_RANGE_NOT_SATISFIABLE = 416; - const STATUS_EXPECTATION_FAILED = 417; - const STATUS_IM_A_TEAPOT = 418; - const STATUS_MISDIRECTED_REQUEST = 421; - const STATUS_UNPROCESSABLE_ENTITY = 422; - const STATUS_LOCKED = 423; - const STATUS_FAILED_DEPENDENCY = 424; - const STATUS_TOO_EARLY = 425; - const STATUS_UPGRADE_REQUIRED = 426; - const STATUS_PRECONDITION_REQUIRED = 428; - const STATUS_TOO_MANY_REQUESTS = 429; - const STATUS_REQUEST_HEADER_FIELDS_TOO_LARGE = 431; - const STATUS_UNAVAILABLE_FOR_LEGAL_REASONS = 451; - // Server Errors 5xx - const STATUS_INTERNAL_SERVER_ERROR = 500; - const STATUS_NOT_IMPLEMENTED = 501; - const STATUS_BAD_GATEWAY = 502; - const STATUS_SERVICE_UNAVAILABLE = 503; - const STATUS_GATEWAY_TIMEOUT = 504; - const STATUS_VERSION_NOT_SUPPORTED = 505; - const STATUS_VARIANT_ALSO_NEGOTIATES = 506; - const STATUS_INSUFFICIENT_STORAGE = 507; - const STATUS_LOOP_DETECTED = 508; - const STATUS_NOT_EXTENDED = 510; - const STATUS_NETWORK_AUTHENTICATION_REQUIRED = 511; -} diff --git a/system/vendor/gregwar/captcha/.gitignore b/system/vendor/gregwar/captcha/.gitignore deleted file mode 100644 index 4383716..0000000 --- a/system/vendor/gregwar/captcha/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -.idea/ -demo/*.jpg -demo/*.pgm -demo/temp/ -vendor/ diff --git a/system/vendor/gregwar/captcha/.travis.yml b/system/vendor/gregwar/captcha/.travis.yml deleted file mode 100644 index 5d2dbf9..0000000 --- a/system/vendor/gregwar/captcha/.travis.yml +++ /dev/null @@ -1,16 +0,0 @@ -language: php - -php: - - 5.3.3 - - 5.3 - - 5.4 - - 5.5 - - 5.6 - - 7.0 - - 7.1 - - 7.2 - - hhvm - -script: - - composer install - - phpunit diff --git a/system/vendor/gregwar/captcha/LICENSE b/system/vendor/gregwar/captcha/LICENSE deleted file mode 100644 index 62f991a..0000000 --- a/system/vendor/gregwar/captcha/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) <2012-2017> Grégoire Passault - -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/system/vendor/gregwar/captcha/README.md b/system/vendor/gregwar/captcha/README.md deleted file mode 100644 index aaeff98..0000000 --- a/system/vendor/gregwar/captcha/README.md +++ /dev/null @@ -1,146 +0,0 @@ -Captcha -======= - -![Captchas examples](http://gregwar.com/captchas.png) -[![paypal](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YUXRLWHQSWS6L) - -Installation -============ - -With composer : - -``` json -{ - ... - "require": { - "gregwar/captcha": "1.*" - } -} -``` - -Usage -===== - -You can create a captcha with the `CaptchaBuilder` : - -```php -build(); -``` - -You can then save it to a file : - -```php -save('out.jpg'); -``` - -Or output it directly : - -```php -output(); -``` - -Or inline it directly in the HTML page: - -```php - -``` - -You'll be able to get the code and compare it with a user input : - -```php -getPhrase(); -``` - -You can compare the phrase with user input: -```php -if($builder->testPhrase($userInput)) { - // instructions if user phrase is good -} -else { - // user phrase is wrong -} -``` - -API -=== - -You can use theses functions : - -* **__construct($phrase = null)**, constructs the builder with the given phrase, if the phrase is null, a random one will be generated -* **getPhrase()**, allow you to get the phrase contents -* **setDistortion($distortion)**, enable or disable the distortion, call it before `build()` -* **isOCRReadable()**, returns `true` if the OCR can be read using the `ocrad` software, you'll need to have shell_exec enabled, imagemagick and ocrad installed -* **buildAgainstOCR($width = 150, $height = 40, $font = null)**, builds a code until it is not readable by `ocrad` -* **build($width = 150, $height = 40, $font = null)**, builds a code with the given $width, $height and $font. By default, a random font will be used from the library -* **save($filename, $quality = 80)**, saves the captcha into a jpeg in the $filename, with the given quality -* **get($quality = 80)**, returns the jpeg data -* **output($quality = 80)**, directly outputs the jpeg code to a browser -* **setBackgroundColor($r, $g, $b)**, sets the background color to force it (this will disable many effects and is not recommended) -* **setBackgroundImages(array($imagepath1, $imagePath2))**, Sets custom background images to be used as captcha background. It is recommended to disable image effects when passing custom images for background (ignore_all_effects). A random image is selected from the list passed, the full paths to the image files must be passed. -* **setInterpolation($interpolate)**, enable or disable the interpolation (enabled by default), disabling it will be quicker but the images will look uglier -* **setIgnoreAllEffects($ignoreAllEffects)**, disable all effects on the captcha image. Recommended to use when passing custom background images for the captcha. -* **testPhrase($phrase)**, returns true if the given phrase is good -* **setMaxBehindLines($lines)**, sets the maximum number of lines behind the code -* **setMaxFrontLines($lines)**, sets the maximum number of lines on the front of the code - -If you want to change the number of character, you can call the phrase builder directly using -extra parameters: - -```php -use Gregwar\Captcha\CaptchaBuilder; -use Gregwar\Captcha\PhraseBuilder; - -// Will build phrases of 3 characters -$phraseBuilder = new PhraseBuilder(4); - -// Will build phrases of 5 characters, only digits -$phraseBuilder = new PhraseBuilder(5, '0123456789'); - -// Pass it as first argument of CaptchaBuilder, passing it the phrase -// builder -$captcha = new CaptchaBuilder(null, $phraseBuilder); -``` - -You can also pass directly the wanted phrase to the builder: - -```php -// Building a Captcha with the "hello" phrase -$captcha = new CaptchaBuilder('hello'); -``` - -Complete example -================ - -If you want to see an example you can have a look at the ``demo/form.php``, which uses ``demo/session.php`` to -render a captcha and check it after the submission - -Symfony Bundle -================ - -You can have a look at the following repository to enjoy the Symfony 2 bundle packaging this captcha generator : -https://github.com/Gregwar/CaptchaBundle - -Yii2 Extension -=============== - -You can use the following extension for integrating with Yii2 Framework : -https://github.com/juliardi/yii2-captcha - -License -======= - -This library is under MIT license, have a look to the `LICENSE` file diff --git a/system/vendor/gregwar/captcha/composer.json b/system/vendor/gregwar/captcha/composer.json deleted file mode 100644 index 4b1ad58..0000000 --- a/system/vendor/gregwar/captcha/composer.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "gregwar/captcha", - "type": "library", - "description": "Captcha generator", - "keywords": ["captcha", "spam", "bot"], - "homepage": "https://github.com/Gregwar/Captcha", - "license": "MIT", - "authors": [ - { - "name": "Grégoire Passault", - "email": "g.passault@gmail.com", - "homepage": "http://www.gregwar.com/" - }, - { - "name": "Jeremy Livingston", - "email": "jeremy.j.livingston@gmail.com" - } - ], - "require": { - "php": ">=5.3.0", - "ext-gd": "*", - "ext-mbstring": "*", - "symfony/finder": "*" - }, - "autoload": { - "psr-4": { - "Gregwar\\": "src/Gregwar" - } - }, - "require-dev": { - "phpunit/phpunit": "^6.4" - } -} diff --git a/system/vendor/gregwar/captcha/demo/demo.php b/system/vendor/gregwar/captcha/demo/demo.php deleted file mode 100644 index 87116cd..0000000 --- a/system/vendor/gregwar/captcha/demo/demo.php +++ /dev/null @@ -1,11 +0,0 @@ -build() - ->save('out.jpg') -; diff --git a/system/vendor/gregwar/captcha/demo/fingerprint.php b/system/vendor/gregwar/captcha/demo/fingerprint.php deleted file mode 100644 index d5319c7..0000000 --- a/system/vendor/gregwar/captcha/demo/fingerprint.php +++ /dev/null @@ -1,12 +0,0 @@ -build() - ->getFingerprint() -); - -echo "\n"; diff --git a/system/vendor/gregwar/captcha/demo/form.php b/system/vendor/gregwar/captcha/demo/form.php deleted file mode 100644 index 55245a4..0000000 --- a/system/vendor/gregwar/captcha/demo/form.php +++ /dev/null @@ -1,32 +0,0 @@ - - - -Captcha is valid !"; - } else { - echo "

Captcha is not valid!

"; - } - // The phrase can't be used twice - unset($_SESSION['phrase']); - } -?> -
- Copy the CAPTCHA: - - - - -
- diff --git a/system/vendor/gregwar/captcha/demo/index.php b/system/vendor/gregwar/captcha/demo/index.php deleted file mode 100644 index e543883..0000000 --- a/system/vendor/gregwar/captcha/demo/index.php +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - -

Captchas gallery

- - - - -
- - - diff --git a/system/vendor/gregwar/captcha/demo/inline.php b/system/vendor/gregwar/captcha/demo/inline.php deleted file mode 100644 index ef1c1e7..0000000 --- a/system/vendor/gregwar/captcha/demo/inline.php +++ /dev/null @@ -1,22 +0,0 @@ -build(); - -?> - - - - - - -

Inline Captcha

- -
- Phrase: getPhrase(); ?> - - - diff --git a/system/vendor/gregwar/captcha/demo/ocr.php b/system/vendor/gregwar/captcha/demo/ocr.php deleted file mode 100644 index 0b0807d..0000000 --- a/system/vendor/gregwar/captcha/demo/ocr.php +++ /dev/null @@ -1,39 +0,0 @@ -setDistortion(false) - ->build() - ; - - if ($captcha->isOCRReadable()) { - $passed++; - $captcha->save("passed$passed.jpg"); - echo "passed at ocr... "; - } else { - echo "failed... "; - } - - echo "pass rate: ".round(100*$passed/($i+1),2)."%\n"; -} - -echo "\n"; -echo "Over, $passed/$tests readed with OCR\n"; diff --git a/system/vendor/gregwar/captcha/demo/output.php b/system/vendor/gregwar/captcha/demo/output.php deleted file mode 100644 index 9223bf6..0000000 --- a/system/vendor/gregwar/captcha/demo/output.php +++ /dev/null @@ -1,12 +0,0 @@ -build() - ->output() -; diff --git a/system/vendor/gregwar/captcha/demo/session.php b/system/vendor/gregwar/captcha/demo/session.php deleted file mode 100644 index becdc13..0000000 --- a/system/vendor/gregwar/captcha/demo/session.php +++ /dev/null @@ -1,22 +0,0 @@ -getPhrase(); - -// Setting the header to image jpeg because we here render an image -header('Content-Type: image/jpeg'); - -// Running the actual rendering of the captcha image -$captcha - ->build() - ->output() -; diff --git a/system/vendor/gregwar/captcha/phpunit.xml.dist b/system/vendor/gregwar/captcha/phpunit.xml.dist deleted file mode 100644 index f17e3b4..0000000 --- a/system/vendor/gregwar/captcha/phpunit.xml.dist +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - ./tests/ - - - - - - ./src - - - diff --git a/system/vendor/gregwar/captcha/src/Gregwar/Captcha/CaptchaBuilder.php b/system/vendor/gregwar/captcha/src/Gregwar/Captcha/CaptchaBuilder.php deleted file mode 100644 index ab8d93f..0000000 --- a/system/vendor/gregwar/captcha/src/Gregwar/Captcha/CaptchaBuilder.php +++ /dev/null @@ -1,737 +0,0 @@ - - * @author Jeremy Livingston - */ -class CaptchaBuilder implements CaptchaBuilderInterface -{ - /** - * @var array - */ - protected $fingerprint = array(); - - /** - * @var bool - */ - protected $useFingerprint = false; - - /** - * @var array - */ - protected $textColor = array(); - - /** - * @var array - */ - protected $lineColor = null; - - /** - * @var array - */ - protected $backgroundColor = null; - - /** - * @var array - */ - protected $backgroundImages = array(); - - /** - * @var resource - */ - protected $contents = null; - - /** - * @var string - */ - protected $phrase = null; - - /** - * @var PhraseBuilderInterface - */ - protected $builder; - - /** - * @var bool - */ - protected $distortion = true; - - /** - * The maximum number of lines to draw in front of - * the image. null - use default algorithm - */ - protected $maxFrontLines = null; - - /** - * The maximum number of lines to draw behind - * the image. null - use default algorithm - */ - protected $maxBehindLines = null; - - /** - * The maximum angle of char - */ - protected $maxAngle = 8; - - /** - * The maximum offset of char - */ - protected $maxOffset = 5; - - /** - * Is the interpolation enabled ? - * - * @var bool - */ - protected $interpolation = true; - - /** - * Ignore all effects - * - * @var bool - */ - protected $ignoreAllEffects = false; - - /** - * Allowed image types for the background images - * - * @var array - */ - protected $allowedBackgroundImageTypes = array('image/png', 'image/jpeg', 'image/gif'); - - /** - * The image contents - */ - public function getContents() - { - return $this->contents; - } - - /** - * Enable/Disables the interpolation - * - * @param $interpolate bool True to enable, false to disable - * - * @return CaptchaBuilder - */ - public function setInterpolation($interpolate = true) - { - $this->interpolation = $interpolate; - - return $this; - } - - /** - * Temporary dir, for OCR check - */ - public $tempDir = 'temp/'; - - public function __construct($phrase = null, PhraseBuilderInterface $builder = null) - { - if ($builder === null) { - $this->builder = new PhraseBuilder; - } else { - $this->builder = $builder; - } - - $this->phrase = is_string($phrase) ? $phrase : $this->builder->build($phrase); - } - - /** - * Setting the phrase - */ - public function setPhrase($phrase) - { - $this->phrase = (string) $phrase; - } - - /** - * Enables/disable distortion - */ - public function setDistortion($distortion) - { - $this->distortion = (bool) $distortion; - - return $this; - } - - public function setMaxBehindLines($maxBehindLines) - { - $this->maxBehindLines = $maxBehindLines; - - return $this; - } - - public function setMaxFrontLines($maxFrontLines) - { - $this->maxFrontLines = $maxFrontLines; - - return $this; - } - - public function setMaxAngle($maxAngle) - { - $this->maxAngle = $maxAngle; - - return $this; - } - - public function setMaxOffset($maxOffset) - { - $this->maxOffset = $maxOffset; - - return $this; - } - - /** - * Gets the captcha phrase - */ - public function getPhrase() - { - return $this->phrase; - } - - /** - * Returns true if the given phrase is good - */ - public function testPhrase($phrase) - { - return ($this->builder->niceize($phrase) == $this->builder->niceize($this->getPhrase())); - } - - /** - * Instantiation - */ - public static function create($phrase = null) - { - return new self($phrase); - } - - /** - * Sets the text color to use - */ - public function setTextColor($r, $g, $b) - { - $this->textColor = array($r, $g, $b); - - return $this; - } - - /** - * Sets the background color to use - */ - public function setBackgroundColor($r, $g, $b) - { - $this->backgroundColor = array($r, $g, $b); - - return $this; - } - - public function setLineColor($r, $g, $b) - { - $this->lineColor = array($r, $g, $b); - - return $this; - } - - /** - * Sets the ignoreAllEffects value - * - * @param bool $ignoreAllEffects - * @return CaptchaBuilder - */ - public function setIgnoreAllEffects($ignoreAllEffects) - { - $this->ignoreAllEffects = $ignoreAllEffects; - - return $this; - } - - /** - * Sets the list of background images to use (one image is randomly selected) - */ - public function setBackgroundImages(array $backgroundImages) - { - $this->backgroundImages = $backgroundImages; - - return $this; - } - - /** - * Draw lines over the image - */ - protected function drawLine($image, $width, $height, $tcol = null) - { - if ($this->lineColor === null) { - $red = $this->rand(100, 255); - $green = $this->rand(100, 255); - $blue = $this->rand(100, 255); - } else { - $red = $this->lineColor[0]; - $green = $this->lineColor[1]; - $blue = $this->lineColor[2]; - } - - if ($tcol === null) { - $tcol = imagecolorallocate($image, $red, $green, $blue); - } - - if ($this->rand(0, 1)) { // Horizontal - $Xa = $this->rand(0, $width/2); - $Ya = $this->rand(0, $height); - $Xb = $this->rand($width/2, $width); - $Yb = $this->rand(0, $height); - } else { // Vertical - $Xa = $this->rand(0, $width); - $Ya = $this->rand(0, $height/2); - $Xb = $this->rand(0, $width); - $Yb = $this->rand($height/2, $height); - } - imagesetthickness($image, $this->rand(1, 3)); - imageline($image, $Xa, $Ya, $Xb, $Yb, $tcol); - } - - /** - * Apply some post effects - */ - protected function postEffect($image) - { - if (!function_exists('imagefilter')) { - return; - } - - if ($this->backgroundColor != null || $this->textColor != null) { - return; - } - - // Negate ? - if ($this->rand(0, 1) == 0) { - imagefilter($image, IMG_FILTER_NEGATE); - } - - // Edge ? - if ($this->rand(0, 10) == 0) { - imagefilter($image, IMG_FILTER_EDGEDETECT); - } - - // Contrast - imagefilter($image, IMG_FILTER_CONTRAST, $this->rand(-50, 10)); - - // Colorize - if ($this->rand(0, 5) == 0) { - imagefilter($image, IMG_FILTER_COLORIZE, $this->rand(-80, 50), $this->rand(-80, 50), $this->rand(-80, 50)); - } - } - - /** - * Writes the phrase on the image - */ - protected function writePhrase($image, $phrase, $font, $width, $height) - { - $length = mb_strlen($phrase); - if ($length === 0) { - return \imagecolorallocate($image, 0, 0, 0); - } - - // Gets the text size and start position - $size = (int) round($width / $length) - $this->rand(0, 3) - 1; - $box = \imagettfbbox($size, 0, $font, $phrase); - $textWidth = $box[2] - $box[0]; - $textHeight = $box[1] - $box[7]; - $x = (int) round(($width - $textWidth) / 2); - $y = (int) round(($height - $textHeight) / 2) + $size; - - if (!$this->textColor) { - $textColor = array($this->rand(0, 150), $this->rand(0, 150), $this->rand(0, 150)); - } else { - $textColor = $this->textColor; - } - $col = \imagecolorallocate($image, $textColor[0], $textColor[1], $textColor[2]); - - // Write the letters one by one, with random angle - for ($i=0; $i<$length; $i++) { - $symbol = mb_substr($phrase, $i, 1); - $box = \imagettfbbox($size, 0, $font, $symbol); - $w = $box[2] - $box[0]; - $angle = $this->rand(-$this->maxAngle, $this->maxAngle); - $offset = $this->rand(-$this->maxOffset, $this->maxOffset); - \imagettftext($image, $size, $angle, $x, $y + $offset, $col, $font, $symbol); - $x += $w; - } - - return $col; - } - - /** - * Try to read the code against an OCR - */ - public function isOCRReadable() - { - if (!is_dir($this->tempDir)) { - @mkdir($this->tempDir, 0755, true); - } - - $tempj = $this->tempDir . uniqid('captcha', true) . '.jpg'; - $tempp = $this->tempDir . uniqid('captcha', true) . '.pgm'; - - $this->save($tempj); - shell_exec("convert $tempj $tempp"); - $value = trim(strtolower(shell_exec("ocrad $tempp"))); - - @unlink($tempj); - @unlink($tempp); - - return $this->testPhrase($value); - } - - /** - * Builds while the code is readable against an OCR - */ - public function buildAgainstOCR($width = 150, $height = 40, $font = null, $fingerprint = null) - { - do { - $this->build($width, $height, $font, $fingerprint); - } while ($this->isOCRReadable()); - } - - /** - * Generate the image - */ - public function build($width = 150, $height = 40, $font = null, $fingerprint = null) - { - if (null !== $fingerprint) { - $this->fingerprint = $fingerprint; - $this->useFingerprint = true; - } else { - $this->fingerprint = array(); - $this->useFingerprint = false; - } - - if ($font === null) { - $font = __DIR__ . '/Font/captcha'.$this->rand(0, 5).'.ttf'; - } - - if (empty($this->backgroundImages)) { - // if background images list is not set, use a color fill as a background - $image = imagecreatetruecolor($width, $height); - if ($this->backgroundColor == null) { - $bg = imagecolorallocate($image, $this->rand(200, 255), $this->rand(200, 255), $this->rand(200, 255)); - } else { - $color = $this->backgroundColor; - $bg = imagecolorallocate($image, $color[0], $color[1], $color[2]); - } - imagefill($image, 0, 0, $bg); - } else { - // use a random background image - $randomBackgroundImage = $this->backgroundImages[rand(0, count($this->backgroundImages)-1)]; - - $imageType = $this->validateBackgroundImage($randomBackgroundImage); - - $image = $this->createBackgroundImageFromType($randomBackgroundImage, $imageType); - } - - // Apply effects - if (!$this->ignoreAllEffects) { - $square = $width * $height; - $effects = $this->rand($square/3000, $square/2000); - - // set the maximum number of lines to draw in front of the text - if ($this->maxBehindLines != null && $this->maxBehindLines > 0) { - $effects = min($this->maxBehindLines, $effects); - } - - if ($this->maxBehindLines !== 0) { - for ($e = 0; $e < $effects; $e++) { - $this->drawLine($image, $width, $height); - } - } - } - - // Write CAPTCHA text - $color = $this->writePhrase($image, $this->phrase, $font, $width, $height); - - // Apply effects - if (!$this->ignoreAllEffects) { - $square = $width * $height; - $effects = $this->rand($square/3000, $square/2000); - - // set the maximum number of lines to draw in front of the text - if ($this->maxFrontLines != null && $this->maxFrontLines > 0) { - $effects = min($this->maxFrontLines, $effects); - } - - if ($this->maxFrontLines !== 0) { - for ($e = 0; $e < $effects; $e++) { - $this->drawLine($image, $width, $height, $color); - } - } - } - - // Distort the image - if ($this->distortion && !$this->ignoreAllEffects) { - $image = $this->distort($image, $width, $height, $bg); - } - - // Post effects - if (!$this->ignoreAllEffects) { - $this->postEffect($image); - } - - $this->contents = $image; - - return $this; - } - - /** - * Distorts the image - */ - public function distort($image, $width, $height, $bg) - { - $contents = imagecreatetruecolor($width, $height); - $X = $this->rand(0, $width); - $Y = $this->rand(0, $height); - $phase = $this->rand(0, 10); - $scale = 1.1 + $this->rand(0, 10000) / 30000; - for ($x = 0; $x < $width; $x++) { - for ($y = 0; $y < $height; $y++) { - $Vx = $x - $X; - $Vy = $y - $Y; - $Vn = sqrt($Vx * $Vx + $Vy * $Vy); - - if ($Vn != 0) { - $Vn2 = $Vn + 4 * sin($Vn / 30); - $nX = $X + ($Vx * $Vn2 / $Vn); - $nY = $Y + ($Vy * $Vn2 / $Vn); - } else { - $nX = $X; - $nY = $Y; - } - $nY = $nY + $scale * sin($phase + $nX * 0.2); - - if ($this->interpolation) { - $p = $this->interpolate( - $nX - floor($nX), - $nY - floor($nY), - $this->getCol($image, floor($nX), floor($nY), $bg), - $this->getCol($image, ceil($nX), floor($nY), $bg), - $this->getCol($image, floor($nX), ceil($nY), $bg), - $this->getCol($image, ceil($nX), ceil($nY), $bg) - ); - } else { - $p = $this->getCol($image, round($nX), round($nY), $bg); - } - - if ($p == 0) { - $p = $bg; - } - - imagesetpixel($contents, $x, $y, $p); - } - } - - return $contents; - } - - /** - * Saves the Captcha to a jpeg file - */ - public function save($filename, $quality = 90) - { - imagejpeg($this->contents, $filename, $quality); - } - - /** - * Gets the image GD - */ - public function getGd() - { - return $this->contents; - } - - /** - * Gets the image contents - */ - public function get($quality = 90) - { - ob_start(); - $this->output($quality); - - return ob_get_clean(); - } - - /** - * Gets the HTML inline base64 - */ - public function inline($quality = 90) - { - return 'data:image/jpeg;base64,' . base64_encode($this->get($quality)); - } - - /** - * Outputs the image - */ - public function output($quality = 90) - { - imagejpeg($this->contents, null, $quality); - } - - /** - * @return array - */ - public function getFingerprint() - { - return $this->fingerprint; - } - - /** - * Returns a random number or the next number in the - * fingerprint - */ - protected function rand($min, $max) - { - if (!is_array($this->fingerprint)) { - $this->fingerprint = array(); - } - - if ($this->useFingerprint) { - $value = current($this->fingerprint); - next($this->fingerprint); - } else { - $value = mt_rand((int)$min, (int)$max); - $this->fingerprint[] = $value; - } - - return $value; - } - - /** - * @param $x - * @param $y - * @param $nw - * @param $ne - * @param $sw - * @param $se - * - * @return int - */ - protected function interpolate($x, $y, $nw, $ne, $sw, $se) - { - list($r0, $g0, $b0) = $this->getRGB($nw); - list($r1, $g1, $b1) = $this->getRGB($ne); - list($r2, $g2, $b2) = $this->getRGB($sw); - list($r3, $g3, $b3) = $this->getRGB($se); - - $cx = 1.0 - $x; - $cy = 1.0 - $y; - - $m0 = $cx * $r0 + $x * $r1; - $m1 = $cx * $r2 + $x * $r3; - $r = (int) ($cy * $m0 + $y * $m1); - - $m0 = $cx * $g0 + $x * $g1; - $m1 = $cx * $g2 + $x * $g3; - $g = (int) ($cy * $m0 + $y * $m1); - - $m0 = $cx * $b0 + $x * $b1; - $m1 = $cx * $b2 + $x * $b3; - $b = (int) ($cy * $m0 + $y * $m1); - - return ($r << 16) | ($g << 8) | $b; - } - - /** - * @param $image - * @param $x - * @param $y - * - * @return int - */ - protected function getCol($image, $x, $y, $background) - { - $L = imagesx($image); - $H = imagesy($image); - if ($x < 0 || $x >= $L || $y < 0 || $y >= $H) { - return $background; - } - - return imagecolorat($image, $x, $y); - } - - /** - * @param $col - * - * @return array - */ - protected function getRGB($col) - { - return array( - (int) ($col >> 16) & 0xff, - (int) ($col >> 8) & 0xff, - (int) ($col) & 0xff, - ); - } - - /** - * Validate the background image path. Return the image type if valid - * - * @param string $backgroundImage - * @return string - * @throws Exception - */ - protected function validateBackgroundImage($backgroundImage) - { - // check if file exists - if (!file_exists($backgroundImage)) { - $backgroundImageExploded = explode('/', $backgroundImage); - $imageFileName = count($backgroundImageExploded) > 1? $backgroundImageExploded[count($backgroundImageExploded)-1] : $backgroundImage; - - throw new Exception('Invalid background image: ' . $imageFileName); - } - - // check image type - $finfo = finfo_open(FILEINFO_MIME_TYPE); // return mime type ala mimetype extension - $imageType = finfo_file($finfo, $backgroundImage); - finfo_close($finfo); - - if (!in_array($imageType, $this->allowedBackgroundImageTypes)) { - throw new Exception('Invalid background image type! Allowed types are: ' . join(', ', $this->allowedBackgroundImageTypes)); - } - - return $imageType; - } - - /** - * Create background image from type - * - * @param string $backgroundImage - * @param string $imageType - * @return resource - * @throws Exception - */ - protected function createBackgroundImageFromType($backgroundImage, $imageType) - { - switch ($imageType) { - case 'image/jpeg': - $image = imagecreatefromjpeg($backgroundImage); - break; - case 'image/png': - $image = imagecreatefrompng($backgroundImage); - break; - case 'image/gif': - $image = imagecreatefromgif($backgroundImage); - break; - - default: - throw new Exception('Not supported file type for background image!'); - } - - return $image; - } -} diff --git a/system/vendor/gregwar/captcha/src/Gregwar/Captcha/CaptchaBuilderInterface.php b/system/vendor/gregwar/captcha/src/Gregwar/Captcha/CaptchaBuilderInterface.php deleted file mode 100644 index bebd070..0000000 --- a/system/vendor/gregwar/captcha/src/Gregwar/Captcha/CaptchaBuilderInterface.php +++ /dev/null @@ -1,29 +0,0 @@ - - * @author Jeremy Livingston - */ -class ImageFileHandler -{ - /** - * Name of folder for captcha images - * @var string - */ - protected $imageFolder; - - /** - * Absolute path to public web folder - * @var string - */ - protected $webPath; - - /** - * Frequency of garbage collection in fractions of 1 - * @var int - */ - protected $gcFreq; - - /** - * Maximum age of images in minutes - * @var int - */ - protected $expiration; - - /** - * @param $imageFolder - * @param $webPath - * @param $gcFreq - * @param $expiration - */ - public function __construct($imageFolder, $webPath, $gcFreq, $expiration) - { - $this->imageFolder = $imageFolder; - $this->webPath = $webPath; - $this->gcFreq = $gcFreq; - $this->expiration = $expiration; - } - - /** - * Saves the provided image content as a file - * - * @param string $contents - * - * @return string - */ - public function saveAsFile($contents) - { - $this->createFolderIfMissing(); - - $filename = md5(uniqid()) . '.jpg'; - $filePath = $this->webPath . '/' . $this->imageFolder . '/' . $filename; - imagejpeg($contents, $filePath, 15); - - return '/' . $this->imageFolder . '/' . $filename; - } - - /** - * Randomly runs garbage collection on the image directory - * - * @return bool - */ - public function collectGarbage() - { - if (!mt_rand(1, $this->gcFreq) == 1) { - return false; - } - - $this->createFolderIfMissing(); - - $finder = new Finder(); - $criteria = sprintf('<= now - %s minutes', $this->expiration); - $finder->in($this->webPath . '/' . $this->imageFolder) - ->date($criteria); - - foreach ($finder->files() as $file) { - unlink($file->getPathname()); - } - - return true; - } - - /** - * Creates the folder if it doesn't exist - */ - protected function createFolderIfMissing() - { - if (!file_exists($this->webPath . '/' . $this->imageFolder)) { - mkdir($this->webPath . '/' . $this->imageFolder, 0755); - } - } -} diff --git a/system/vendor/gregwar/captcha/src/Gregwar/Captcha/PhraseBuilder.php b/system/vendor/gregwar/captcha/src/Gregwar/Captcha/PhraseBuilder.php deleted file mode 100644 index aa6ecf1..0000000 --- a/system/vendor/gregwar/captcha/src/Gregwar/Captcha/PhraseBuilder.php +++ /dev/null @@ -1,75 +0,0 @@ - - */ -class PhraseBuilder implements PhraseBuilderInterface -{ - /** - * @var int - */ - public $length; - - /** - * @var string - */ - public $charset; - /** - * Constructs a PhraseBuilder with given parameters - */ - public function __construct($length = 5, $charset = 'abcdefghijklmnpqrstuvwxyz123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ') - { - $this->length = $length; - $this->charset = $charset; - } - - /** - * Generates random phrase of given length with given charset - */ - public function build($length = null, $charset = null) - { - if ($length !== null) { - $this->length = $length; - } - if ($charset !== null) { - $this->charset = $charset; - } - - $phrase = ''; - $chars = str_split($this->charset); - - for ($i = 0; $i < $this->length; $i++) { - $phrase .= $chars[array_rand($chars)]; - } - - return $phrase; - } - - /** - * "Niceize" a code - */ - public function niceize($str) - { - return self::doNiceize($str); - } - - /** - * A static helper to niceize - */ - public static function doNiceize($str) - { - return strtr(strtolower($str), '01', 'ol'); - } - - /** - * A static helper to compare - */ - public static function comparePhrases($str1, $str2) - { - return self::doNiceize($str1) === self::doNiceize($str2); - } -} diff --git a/system/vendor/gregwar/captcha/src/Gregwar/Captcha/PhraseBuilderInterface.php b/system/vendor/gregwar/captcha/src/Gregwar/Captcha/PhraseBuilderInterface.php deleted file mode 100644 index 62ec4b0..0000000 --- a/system/vendor/gregwar/captcha/src/Gregwar/Captcha/PhraseBuilderInterface.php +++ /dev/null @@ -1,21 +0,0 @@ - - */ -interface PhraseBuilderInterface -{ - /** - * Generates random phrase of given length with given charset - */ - public function build(); - - /** - * "Niceize" a code - */ - public function niceize($str); -} diff --git a/system/vendor/gregwar/captcha/tests/CaptchaBuilderTest.php b/system/vendor/gregwar/captcha/tests/CaptchaBuilderTest.php deleted file mode 100644 index 5325a9c..0000000 --- a/system/vendor/gregwar/captcha/tests/CaptchaBuilderTest.php +++ /dev/null @@ -1,30 +0,0 @@ -build() - ->save('out.jpg') - ; - - $this->assertTrue(file_exists(__DIR__.'/../out.jpg')); - } - - public function testFingerPrint() - { - $int = count(CaptchaBuilder::create() - ->build() - ->getFingerprint() - ); - - $this->assertTrue(is_int($int)); - } -} \ No newline at end of file diff --git a/system/vendor/jbroadway/urlify/.gitignore b/system/vendor/jbroadway/urlify/.gitignore deleted file mode 100644 index 7709e3e..0000000 --- a/system/vendor/jbroadway/urlify/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -vendor -composer.phar -composer.lock -.idea \ No newline at end of file diff --git a/system/vendor/jbroadway/urlify/.travis.yml b/system/vendor/jbroadway/urlify/.travis.yml deleted file mode 100644 index 66b358e..0000000 --- a/system/vendor/jbroadway/urlify/.travis.yml +++ /dev/null @@ -1,16 +0,0 @@ -language: php - -php: - - 5.4 - - 5.5 - - 5.6 - - 7.0 - - 7.1 - - 7.2 - - 7.3 - -before_script: - - composer install --no-interaction --prefer-source - -script: - - vendor/bin/phpunit --coverage-text --verbose diff --git a/system/vendor/jbroadway/urlify/INSTALL b/system/vendor/jbroadway/urlify/INSTALL deleted file mode 100644 index 92e1bb0..0000000 --- a/system/vendor/jbroadway/urlify/INSTALL +++ /dev/null @@ -1,13 +0,0 @@ -To install URLify, you can add it as a dependency by downloading Composer, the PHP package manager. - -`$ curl -s http://getcomposer.org/installer | php` - -Then run this command to install Composer: - -`$ php composer.phar install` - -For more details, see https://getcomposer.org/ - -Then run this command to install the URLify library: - -`$ composer require jbroadway/urlify` diff --git a/system/vendor/jbroadway/urlify/LICENSE b/system/vendor/jbroadway/urlify/LICENSE deleted file mode 100644 index 5f4f225..0000000 --- a/system/vendor/jbroadway/urlify/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) Django Software Foundation and individual contributors. -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - 3. Neither the name of Django nor the names of its contributors may be used - to endorse or promote products derived from this software without - specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/system/vendor/jbroadway/urlify/README.md b/system/vendor/jbroadway/urlify/README.md deleted file mode 100644 index e5aaa86..0000000 --- a/system/vendor/jbroadway/urlify/README.md +++ /dev/null @@ -1,90 +0,0 @@ -# URLify for PHP [![Build Status](https://travis-ci.org/jbroadway/urlify.png)](https://travis-ci.org/jbroadway/urlify) - -A PHP port of [URLify.js](https://github.com/django/django/blob/master/django/contrib/admin/static/admin/js/urlify.js) -from the Django project. Handles symbols from Latin languages as well as Arabic, Azerbaijani, Czech, German, Greek, Kazakh, -Latvian, Lithuanian, Persian, Polish, Romanian, Bulgarian, Russian, Serbian, Turkish, Ukrainian, Vietnamese and Slovak. Symbols it cannot -transliterate it will simply omit. - -## Installation - -Install the latest version with: - -```bash -$ composer require jbroadway/urlify -``` - -## Usage - -To generate slugs for URLs: - -```php - '?', '®' => '(r)', '¼' => '1/4', - '½' => '1/2', '¾' => '3/4', '¶' => 'P' -]); - -echo URLify::downcode ('¿ ® ¼ ¼ ¾ ¶'); -// "? (r) 1/2 1/2 3/4 P" -``` - -To extend the list of words to remove: - -```php - array ( /* German */ - 'Ä' => 'Ae', 'Ö' => 'Oe', 'Ü' => 'Ue', 'ä' => 'ae', 'ö' => 'oe', 'ü' => 'ue', 'ß' => 'ss', - 'ẞ' => 'SS' - ), - 'latin' => array ( - 'À' => 'A', 'Á' => 'A', 'Â' => 'A', 'Ã' => 'A', 'Ä' => 'A', 'Å' => 'A','Ă' => 'A', 'Æ' => 'AE', 'Ç' => - 'C', 'È' => 'E', 'É' => 'E', 'Ê' => 'E', 'Ë' => 'E', 'Ì' => 'I', 'Í' => 'I', 'Î' => 'I', - 'Ï' => 'I', 'Ð' => 'D', 'Ñ' => 'N', 'Ò' => 'O', 'Ó' => 'O', 'Ô' => 'O', 'Õ' => 'O', 'Ö' => - 'O', 'Ő' => 'O', 'Ø' => 'O', 'Œ' => 'OE' ,'Ș' => 'S','Ț' => 'T', 'Ù' => 'U', 'Ú' => 'U', 'Û' => 'U', 'Ü' => 'U', 'Ű' => 'U', - 'Ý' => 'Y', 'Þ' => 'TH', 'ß' => 'ss', 'à' => 'a', 'á' => 'a', 'â' => 'a', 'ã' => 'a', 'ä' => - 'a', 'å' => 'a', 'ă' => 'a', 'æ' => 'ae', 'ç' => 'c', 'è' => 'e', 'é' => 'e', 'ê' => 'e', 'ë' => 'e', - 'ì' => 'i', 'í' => 'i', 'î' => 'i', 'ï' => 'i', 'ð' => 'd', 'ñ' => 'n', 'ò' => 'o', 'ó' => - 'o', 'ô' => 'o', 'õ' => 'o', 'ö' => 'o', 'ő' => 'o', 'ø' => 'o', 'œ' => 'oe', 'ș' => 's', 'ț' => 't', 'ù' => 'u', 'ú' => 'u', - 'û' => 'u', 'ü' => 'u', 'ű' => 'u', 'ý' => 'y', 'þ' => 'th', 'ÿ' => 'y' - ), - 'latin_symbols' => array ( - '©' => '(c)' - ), - 'el' => array ( /* Greek */ - 'α' => 'a', 'β' => 'b', 'γ' => 'g', 'δ' => 'd', 'ε' => 'e', 'ζ' => 'z', 'η' => 'h', 'θ' => '8', - 'ι' => 'i', 'κ' => 'k', 'λ' => 'l', 'μ' => 'm', 'ν' => 'n', 'ξ' => '3', 'ο' => 'o', 'π' => 'p', - 'ρ' => 'r', 'σ' => 's', 'τ' => 't', 'υ' => 'y', 'φ' => 'f', 'χ' => 'x', 'ψ' => 'ps', 'ω' => 'w', - 'ά' => 'a', 'έ' => 'e', 'ί' => 'i', 'ό' => 'o', 'ύ' => 'y', 'ή' => 'h', 'ώ' => 'w', 'ς' => 's', - 'ϊ' => 'i', 'ΰ' => 'y', 'ϋ' => 'y', 'ΐ' => 'i', - 'Α' => 'A', 'Β' => 'B', 'Γ' => 'G', 'Δ' => 'D', 'Ε' => 'E', 'Ζ' => 'Z', 'Η' => 'H', 'Θ' => '8', - 'Ι' => 'I', 'Κ' => 'K', 'Λ' => 'L', 'Μ' => 'M', 'Ν' => 'N', 'Ξ' => '3', 'Ο' => 'O', 'Π' => 'P', - 'Ρ' => 'R', 'Σ' => 'S', 'Τ' => 'T', 'Υ' => 'Y', 'Φ' => 'F', 'Χ' => 'X', 'Ψ' => 'PS', 'Ω' => 'W', - 'Ά' => 'A', 'Έ' => 'E', 'Ί' => 'I', 'Ό' => 'O', 'Ύ' => 'Y', 'Ή' => 'H', 'Ώ' => 'W', 'Ϊ' => 'I', - 'Ϋ' => 'Y' - ), - 'tr' => array ( /* Turkish */ - 'ş' => 's', 'Ş' => 'S', 'ı' => 'i', 'İ' => 'I', 'ç' => 'c', 'Ç' => 'C', 'ü' => 'u', 'Ü' => 'U', - 'ö' => 'o', 'Ö' => 'O', 'ğ' => 'g', 'Ğ' => 'G' - ), - 'bg' => array( /* Bulgarian */ - 'Щ' => 'Sht', 'Ш' => 'Sh', 'Ч' => 'Ch', 'Ц' => 'C', 'Ю' => 'Yu', 'Я' => 'Ya', - 'Ж' => 'J', 'А' => 'A', 'Б' => 'B', 'В' => 'V', 'Г' => 'G', 'Д' => 'D', - 'Е' => 'E', 'З' => 'Z', 'И' => 'I', 'Й' => 'Y', 'К' => 'K', 'Л' => 'L', - 'М' => 'M', 'Н' => 'N', 'О' => 'O', 'П' => 'P', 'Р' => 'R', 'С' => 'S', - 'Т' => 'T', 'У' => 'U', 'Ф' => 'F', 'Х' => 'H', 'Ь' => '', 'Ъ' => 'A', - 'щ' => 'sht', 'ш' => 'sh', 'ч' => 'ch', 'ц' => 'c', 'ю' => 'yu', 'я' => 'ya', - 'ж' => 'j', 'а' => 'a', 'б' => 'b', 'в' => 'v', 'г' => 'g', 'д' => 'd', - 'е' => 'e', 'з' => 'z', 'и' => 'i', 'й' => 'y', 'к' => 'k', 'л' => 'l', - 'м' => 'm', 'н' => 'n', 'о' => 'o', 'п' => 'p', 'р' => 'r', 'с' => 's', - 'т' => 't', 'у' => 'u', 'ф' => 'f', 'х' => 'h', 'ь' => '', 'ъ' => 'a' - ), - 'ru' => array ( /* Russian */ - 'а' => 'a', 'б' => 'b', 'в' => 'v', 'г' => 'g', 'д' => 'd', 'е' => 'e', 'ё' => 'yo', 'ж' => 'zh', - 'з' => 'z', 'и' => 'i', 'й' => 'i', 'к' => 'k', 'л' => 'l', 'м' => 'm', 'н' => 'n', 'о' => 'o', - 'п' => 'p', 'р' => 'r', 'с' => 's', 'т' => 't', 'у' => 'u', 'ф' => 'f', 'х' => 'h', 'ц' => 'c', - 'ч' => 'ch', 'ш' => 'sh', 'щ' => 'sh', 'ъ' => '', 'ы' => 'y', 'ь' => '', 'э' => 'e', 'ю' => 'yu', - 'я' => 'ya', - 'А' => 'A', 'Б' => 'B', 'В' => 'V', 'Г' => 'G', 'Д' => 'D', 'Е' => 'E', 'Ё' => 'Yo', 'Ж' => 'Zh', - 'З' => 'Z', 'И' => 'I', 'Й' => 'I', 'К' => 'K', 'Л' => 'L', 'М' => 'M', 'Н' => 'N', 'О' => 'O', - 'П' => 'P', 'Р' => 'R', 'С' => 'S', 'Т' => 'T', 'У' => 'U', 'Ф' => 'F', 'Х' => 'H', 'Ц' => 'C', - 'Ч' => 'Ch', 'Ш' => 'Sh', 'Щ' => 'Sh', 'Ъ' => '', 'Ы' => 'Y', 'Ь' => '', 'Э' => 'E', 'Ю' => 'Yu', - 'Я' => 'Ya', - '№' => '' - ), - 'uk' => array ( /* Ukrainian */ - 'Є' => 'Ye', 'І' => 'I', 'Ї' => 'Yi', 'Ґ' => 'G', 'є' => 'ye', 'і' => 'i', 'ї' => 'yi', 'ґ' => 'g' - ), - 'kk' => array ( /* Kazakh */ - 'Ә' => 'A', 'Ғ' => 'G', 'Қ' => 'Q', 'Ң' => 'N', 'Ө' => 'O', 'Ұ' => 'U', 'Ү' => 'U', 'Һ' => 'H', - 'ә' => 'a', 'ғ' => 'g', 'қ' => 'q', 'ң' => 'n', 'ө' => 'o', 'ұ' => 'u', 'ү' => 'u', 'һ' => 'h', - ), - 'cs' => array ( /* Czech */ - 'č' => 'c', 'ď' => 'd', 'ě' => 'e', 'ň' => 'n', 'ř' => 'r', 'š' => 's', 'ť' => 't', 'ů' => 'u', - 'ž' => 'z', 'Č' => 'C', 'Ď' => 'D', 'Ě' => 'E', 'Ň' => 'N', 'Ř' => 'R', 'Š' => 'S', 'Ť' => 'T', - 'Ů' => 'U', 'Ž' => 'Z' - ), - 'pl' => array ( /* Polish */ - 'ą' => 'a', 'ć' => 'c', 'ę' => 'e', 'ł' => 'l', 'ń' => 'n', 'ó' => 'o', 'ś' => 's', 'ź' => 'z', - 'ż' => 'z', 'Ą' => 'A', 'Ć' => 'C', 'Ę' => 'e', 'Ł' => 'L', 'Ń' => 'N', 'Ó' => 'O', 'Ś' => 'S', - 'Ź' => 'Z', 'Ż' => 'Z' - ), - 'ro' => array ( /* Romanian */ - 'ă' => 'a', 'â' => 'a', 'î' => 'i', 'ș' => 's', 'ț' => 't', 'Ţ' => 'T', 'ţ' => 't' - ), - 'lv' => array ( /* Latvian */ - 'ā' => 'a', 'č' => 'c', 'ē' => 'e', 'ģ' => 'g', 'ī' => 'i', 'ķ' => 'k', 'ļ' => 'l', 'ņ' => 'n', - 'š' => 's', 'ū' => 'u', 'ž' => 'z', 'Ā' => 'A', 'Č' => 'C', 'Ē' => 'E', 'Ģ' => 'G', 'Ī' => 'i', - 'Ķ' => 'k', 'Ļ' => 'L', 'Ņ' => 'N', 'Š' => 'S', 'Ū' => 'u', 'Ž' => 'Z' - ), - 'lt' => array ( /* Lithuanian */ - 'ą' => 'a', 'č' => 'c', 'ę' => 'e', 'ė' => 'e', 'į' => 'i', 'š' => 's', 'ų' => 'u', 'ū' => 'u', 'ž' => 'z', - 'Ą' => 'A', 'Č' => 'C', 'Ę' => 'E', 'Ė' => 'E', 'Į' => 'I', 'Š' => 'S', 'Ų' => 'U', 'Ū' => 'U', 'Ž' => 'Z' - ), - 'vi' => array ( /* Vietnamese */ - 'Á' => 'A', 'À' => 'A', 'Ả' => 'A', 'Ã' => 'A', 'Ạ' => 'A', 'Ă' => 'A', 'Ắ' => 'A', 'Ằ' => 'A', 'Ẳ' => 'A', 'Ẵ' => 'A', 'Ặ' => 'A', 'Â' => 'A', 'Ấ' => 'A', 'Ầ' => 'A', 'Ẩ' => 'A', 'Ẫ' => 'A', 'Ậ' => 'A', - 'á' => 'a', 'à' => 'a', 'ả' => 'a', 'ã' => 'a', 'ạ' => 'a', 'ă' => 'a', 'ắ' => 'a', 'ằ' => 'a', 'ẳ' => 'a', 'ẵ' => 'a', 'ặ' => 'a', 'â' => 'a', 'ấ' => 'a', 'ầ' => 'a', 'ẩ' => 'a', 'ẫ' => 'a', 'ậ' => 'a', - 'É' => 'E', 'È' => 'E', 'Ẻ' => 'E', 'Ẽ' => 'E', 'Ẹ' => 'E', 'Ê' => 'E', 'Ế' => 'E', 'Ề' => 'E', 'Ể' => 'E', 'Ễ' => 'E', 'Ệ' => 'E', - 'é' => 'e', 'è' => 'e', 'ẻ' => 'e', 'ẽ' => 'e', 'ẹ' => 'e', 'ê' => 'e', 'ế' => 'e', 'ề' => 'e', 'ể' => 'e', 'ễ' => 'e', 'ệ' => 'e', - 'Í' => 'I', 'Ì' => 'I', 'Ỉ' => 'I', 'Ĩ' => 'I', 'Ị' => 'I', 'í' => 'i', 'ì' => 'i', 'ỉ' => 'i', 'ĩ' => 'i', 'ị' => 'i', - 'Ó' => 'O', 'Ò' => 'O', 'Ỏ' => 'O', 'Õ' => 'O', 'Ọ' => 'O', 'Ô' => 'O', 'Ố' => 'O', 'Ồ' => 'O', 'Ổ' => 'O', 'Ỗ' => 'O', 'Ộ' => 'O', 'Ơ' => 'O', 'Ớ' => 'O', 'Ờ' => 'O', 'Ở' => 'O', 'Ỡ' => 'O', 'Ợ' => 'O', - 'ó' => 'o', 'ò' => 'o', 'ỏ' => 'o', 'õ' => 'o', 'ọ' => 'o', 'ô' => 'o', 'ố' => 'o', 'ồ' => 'o', 'ổ' => 'o', 'ỗ' => 'o', 'ộ' => 'o', 'ơ' => 'o', 'ớ' => 'o', 'ờ' => 'o', 'ở' => 'o', 'ỡ' => 'o', 'ợ' => 'o', - 'Ú' => 'U', 'Ù' => 'U', 'Ủ' => 'U', 'Ũ' => 'U', 'Ụ' => 'U', 'Ư' => 'U', 'Ứ' => 'U', 'Ừ' => 'U', 'Ử' => 'U', 'Ữ' => 'U', 'Ự' => 'U', - 'ú' => 'u', 'ù' => 'u', 'ủ' => 'u', 'ũ' => 'u', 'ụ' => 'u', 'ư' => 'u', 'ứ' => 'u', 'ừ' => 'u', 'ử' => 'u', 'ữ' => 'u', 'ự' => 'u', - 'Ý' => 'Y', 'Ỳ' => 'Y', 'Ỷ' => 'Y', 'Ỹ' => 'Y', 'Ỵ' => 'Y', 'ý' => 'y', 'ỳ' => 'y', 'ỷ' => 'y', 'ỹ' => 'y', 'ỵ' => 'y', - 'Đ' => 'D', 'đ' => 'd' - ), - 'ar' => array ( /* Arabic */ - 'أ' => 'a', 'ب' => 'b', 'ت' => 't', 'ث' => 'th', 'ج' => 'g', 'ح' => 'h', 'خ' => 'kh', 'د' => 'd', - 'ذ' => 'th', 'ر' => 'r', 'ز' => 'z', 'س' => 's', 'ش' => 'sh', 'ص' => 's', 'ض' => 'd', 'ط' => 't', - 'ظ' => 'th', 'ع' => 'aa', 'غ' => 'gh', 'ف' => 'f', 'ق' => 'k', 'ك' => 'k', 'ل' => 'l', 'م' => 'm', - 'ن' => 'n', 'ه' => 'h', 'و' => 'o', 'ي' => 'y', - 'ا' => 'a', 'إ' => 'a', 'آ' => 'a', 'ؤ' => 'o', 'ئ' => 'y', 'ء' => 'aa', - '٠' => '0', '١' => '1', '٢' => '2', '٣' => '3', '٤' => '4', '٥' => '5', '٦' => '6', '٧' => '7', '٨' => '8', '٩' => '9', - ), - 'fa' => array ( /* Persian */ - 'گ' => 'g', 'ژ' => 'j', 'پ' => 'p', 'چ' => 'ch', 'ی' => 'y', 'ک' => 'k', - '۰' => '0', '۱' => '1', '۲' => '2', '۳' => '3', '۴' => '4', '۵' => '5', '۶' => '6', '۷' => '7', '۸' => '8', '۹' => '9', - ), - 'sr' => array ( /* Serbian */ - 'ђ' => 'dj', 'ј' => 'j', 'љ' => 'lj', 'њ' => 'nj', 'ћ' => 'c', 'џ' => 'dz', 'đ' => 'dj', - 'Ђ' => 'Dj', 'Ј' => 'j', 'Љ' => 'Lj', 'Њ' => 'Nj', 'Ћ' => 'C', 'Џ' => 'Dz', 'Đ' => 'Dj' - ), - 'az' => array ( /* Azerbaijani */ - 'ç' => 'c', 'ə' => 'e', 'ğ' => 'g', 'ı' => 'i', 'ö' => 'o', 'ş' => 's', 'ü' => 'u', - 'Ç' => 'C', 'Ə' => 'E', 'Ğ' => 'G', 'İ' => 'I', 'Ö' => 'O', 'Ş' => 'S', 'Ü' => 'U' - ), - 'sk' => array ( /* Slovak */ - 'ĺ' => 'l', 'ľ' => 'l', 'ŕ' => 'r' - ) - ); - - /** - * List of words to remove from URLs. - */ - public static $remove_list = array ( - 'a', 'an', 'as', 'at', 'before', 'but', 'by', 'for', 'from', - 'is', 'in', 'into', 'like', 'of', 'off', 'on', 'onto', 'per', - 'since', 'than', 'the', 'this', 'that', 'to', 'up', 'via', - 'with' - ); - - /** - * The character map. - */ - private static $map = array (); - - /** - * The character list as a string. - */ - private static $chars = ''; - - /** - * The character list as a regular expression. - */ - private static $regex = ''; - - /** - * The current language - */ - private static $language = ''; - - /** - * Initializes the character map. - * @param string $language - */ - private static function init ($language = "") - { - if (count (self::$map) > 0 && (($language == "") || ($language == self::$language))) { - return; - } - - /* Is a specific map associated with $language ? */ - if (isset(self::$maps[$language]) && is_array(self::$maps[$language])) { - /* Move this map to end. This means it will have priority over others */ - $m = self::$maps[$language]; - unset(self::$maps[$language]); - self::$maps[$language] = $m; - } - /* Reset static vars */ - self::$language = $language; - self::$map = array(); - self::$chars = ''; - - foreach (self::$maps as $map) { - foreach ($map as $orig => $conv) { - self::$map[$orig] = $conv; - self::$chars .= $orig; - } - } - - self::$regex = '/[' . preg_quote(self::$chars, '/') . ']/u'; - } - - /** - * Add new characters to the list. `$map` should be a hash. - * @param array $map - */ - public static function add_chars ($map) - { - if (! is_array ($map)) { - throw new LogicException ('$map must be an associative array.'); - } - self::$maps[] = $map; - self::$map = array (); - self::$chars = ''; - } - - /** - * Append words to the remove list. Accepts either single words - * or an array of words. - * @param mixed $words - */ - public static function remove_words ($words) - { - $words = is_array ($words) ? $words : array ($words); - self::$remove_list = array_unique (array_merge (self::$remove_list, $words)); - } - - /** - * Transliterates characters to their ASCII equivalents. - * $language specifies a priority for a specific language. - * The latter is useful if languages have different rules for the same character. - * @param string $text - * @param string $language - * @return string - */ - public static function downcode ($text, $language = "") - { - self::init ($language); - - if (preg_match_all (self::$regex, $text, $matches)) { - for ($i = 0; $i < count ($matches[0]); $i++) { - $char = $matches[0][$i]; - if (isset (self::$map[$char])) { - $text = str_replace ($char, self::$map[$char], $text); - } - } - } - return $text; - } - - /** - * Filters a string, e.g., "Petty theft" to "petty-theft" - * @param string $text The text to return filtered - * @param int $length The length (after filtering) of the string to be returned - * @param string $language The transliteration language, passed down to downcode() - * @param bool $file_name Whether there should be and additional filter considering this is a filename - * @param bool $use_remove_list Whether you want to remove specific elements previously set in self::$remove_list - * @param bool $lower_case Whether you want the filter to maintain casing or lowercase everything (default) - * @param bool $treat_underscore_as_space Treat underscore as space, so it will replaced with "-" - * @return string - */ - public static function filter ($text, $length = 60, $language = "", $file_name = false, $use_remove_list = true, $lower_case = true, $treat_underscore_as_space = true) - { - $text = self::downcode ($text,$language); - - if ($use_remove_list) { - // remove all these words from the string before urlifying - $text = preg_replace ('/\b(' . join ('|', self::$remove_list) . ')\b/i', '', $text); - } - - // if downcode doesn't hit, the char will be stripped here - $remove_pattern = ($file_name) ? '/[^_\-.\-a-zA-Z0-9\s]/u' : '/[^\s_\-a-zA-Z0-9]/u'; - $text = preg_replace ($remove_pattern, '', $text); // remove unneeded chars - if ($treat_underscore_as_space) { - $text = str_replace ('_', ' ', $text); // treat underscores as spaces - } - $text = preg_replace ('/^\s+|\s+$/u', '', $text); // trim leading/trailing spaces - $text = preg_replace ('/[-\s]+/u', '-', $text); // convert spaces to hyphens - if ($lower_case) { - $text = strtolower ($text); // convert to lowercase - } - - return trim (substr ($text, 0, $length), '-'); // trim to first $length chars - } - - /** - * Alias of `URLify::downcode()`. - */ - public static function transliterate ($text) - { - return self::downcode ($text); - } -} diff --git a/system/vendor/jbroadway/urlify/composer.json b/system/vendor/jbroadway/urlify/composer.json deleted file mode 100644 index 38846a2..0000000 --- a/system/vendor/jbroadway/urlify/composer.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "jbroadway/urlify", - "type": "library", - "description": "PHP port of URLify.js from the Django project. Transliterates non-ascii characters for use in URLs.", - "keywords": ["urlify","transliterate","translit","transliteration","url","encode","slug","link","iconv"], - "homepage": "https://github.com/jbroadway/urlify", - "license": "BSD-3-Clause-Clear", - "authors": [ - { - "name": "Johnny Broadway", - "email": "johnny@johnnybroadway.com", - "homepage": "http://www.johnnybroadway.com/" - } - ], - "require": { - "php": ">=5.3.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.36 || ^5.7 || ^6.5" - }, - "autoload": { - "psr-0": { "URLify": "" } - }, - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - } -} diff --git a/system/vendor/jbroadway/urlify/phpunit.xml b/system/vendor/jbroadway/urlify/phpunit.xml deleted file mode 100644 index eeebfcc..0000000 --- a/system/vendor/jbroadway/urlify/phpunit.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - tests - - - - - diff --git a/system/vendor/jbroadway/urlify/scripts/downcode.php b/system/vendor/jbroadway/urlify/scripts/downcode.php deleted file mode 100644 index f2a7fda..0000000 --- a/system/vendor/jbroadway/urlify/scripts/downcode.php +++ /dev/null @@ -1,20 +0,0 @@ - 2) { - die ("Usage (argument): php " . basename(__FILE__) . " \"\"\nUsage (pipe): | php " . basename(__FILE__) . "\n"); -} - -//Process the provided argument -if($argc === 2) { - $s = $argv[1]; -//Or read from stdin if the argument wasn't present -} else { - $piped = true; - $s = file_get_contents("php://stdin"); -} - -echo URLify::downcode ($s) . ($piped ? "\n" : ""); diff --git a/system/vendor/jbroadway/urlify/scripts/filter.php b/system/vendor/jbroadway/urlify/scripts/filter.php deleted file mode 100644 index aec6a0a..0000000 --- a/system/vendor/jbroadway/urlify/scripts/filter.php +++ /dev/null @@ -1,20 +0,0 @@ - 2) { - die ("Usage (argument): php " . basename(__FILE__) . " \"\"\nUsage (pipe): | php " . basename(__FILE__) . "\n"); -} - -//Process the provided argument -if($argc === 2) { - $s = $argv[1]; -//Or read from stdin if the argument wasn't present -} else { - $piped = true; - $s = file_get_contents("php://stdin"); -} - -echo URLify::filter ($s) . ($piped ? "\n" : ""); diff --git a/system/vendor/jbroadway/urlify/scripts/transliterate.php b/system/vendor/jbroadway/urlify/scripts/transliterate.php deleted file mode 100644 index 258581b..0000000 --- a/system/vendor/jbroadway/urlify/scripts/transliterate.php +++ /dev/null @@ -1,20 +0,0 @@ - 2) { - die ("Usage (argument): php " . basename(__FILE__) . " \"\"\nUsage (pipe): | php " . basename(__FILE__) . "\n"); -} - -//Process the provided argument -if($argc === 2) { - $s = $argv[1]; -//Or read from stdin if the argument wasn't present -} else { - $piped = true; - $s = file_get_contents("php://stdin"); -} - -echo URLify::transliterate($s) . ($piped ? "\n" : ""); diff --git a/system/vendor/jbroadway/urlify/tests/URLifyTest.php b/system/vendor/jbroadway/urlify/tests/URLifyTest.php deleted file mode 100644 index aa3ac30..0000000 --- a/system/vendor/jbroadway/urlify/tests/URLifyTest.php +++ /dev/null @@ -1,60 +0,0 @@ -assertEquals (' J\'etudie le francais ', URLify::downcode (' J\'étudie le français ')); - $this->assertEquals ('Lo siento, no hablo espanol.', URLify::downcode ('Lo siento, no hablo español.')); - $this->assertEquals ('F3PWS', URLify::downcode ('ΦΞΠΏΣ')); - $this->assertEquals ('foo-bar', URLify::filter ('_foo_bar_')); - } - - function test_filter () { - $this->assertEquals ('jetudie-le-francais', URLify::filter (' J\'étudie le français ')); - $this->assertEquals ('lo-siento-no-hablo-espanol', URLify::filter ('Lo siento, no hablo español.')); - $this->assertEquals ('f3pws', URLify::filter ('ΦΞΠΏΣ')); - $this->assertEquals ('', URLify::filter('大般若經')); - $this->assertEquals ('test-.txt', URLify::filter('test-大般若經.txt', 60, "", $file_name = true)); - $this->assertEquals ('yakrhy-ltoytr', URLify::filter('ياكرهي لتويتر')); - $this->assertEquals ('saaat-25', URLify::filter('ساعت ۲۵')); - $this->assertEquals ('foto.jpg', URLify::filter ('фото.jpg', 60, "", $file_name = true)); - // priorization of language-specific maps - $this->assertEquals ('aouaou', URLify::filter ('ÄÖÜäöü',60,"tr")); - $this->assertEquals ('aeoeueaeoeue', URLify::filter ('ÄÖÜäöü',60,"de")); - - $this->assertEquals ('bobby-mcferrin-dont-worry-be-happy', URLify::filter ("Bobby McFerrin — Don't worry be happy",600,"en")); - // test stripping and conversion of UTF-8 spaces - $this->assertEquals ('test-mahito-mukai', URLify::filter('向井 真人test (Mahito Mukai)')); - // Treat underscore as space - $this->assertEquals ('text_with_underscore', URLify::filter('text_with_underscore', 60, "en", true, true, true, false)); - } - - function test_add_chars () { - $this->assertEquals ('¿ ® ¼ ¼ ¾ ¶', URLify::downcode ('¿ ® ¼ ¼ ¾ ¶')); - URLify::add_chars (array ( - '¿' => '?', '®' => '(r)', '¼' => '1/4', - '¼' => '1/2', '¾' => '3/4', '¶' => 'P' - )); - $this->assertEquals ('? (r) 1/2 1/2 3/4 P', URLify::downcode ('¿ ® ¼ ¼ ¾ ¶')); - } - - function test_remove_words () { - $this->assertEquals ('foo-bar', URLify::filter ('foo bar')); - URLify::remove_words (array ('foo', 'bar')); - $this->assertEquals ('', URLify::filter ('foo bar')); - } - - function test_many_rounds_with_unknown_language_code () { - for ($i = 0; $i < 1000; $i++) { - URLify::downcode ('Lo siento, no hablo español.',-1); - } - } - - function test_remove_words_disable () { - URLify::remove_words (array ('foo', 'bar')); - $this->assertEquals ('foo-bar', URLify::filter ('foo bar', 60, '', false, false)); - } -} - -?> diff --git a/system/vendor/jbroadway/urlify/tests/bootstrap.php b/system/vendor/jbroadway/urlify/tests/bootstrap.php deleted file mode 100644 index d56d466..0000000 --- a/system/vendor/jbroadway/urlify/tests/bootstrap.php +++ /dev/null @@ -1,9 +0,0 @@ - - Build Status - - - Total Downloads - - - Latest Stable Version - - - License - - -## Introduction - -> This project is a fork of the excellent [opis/closure: 3.x](https://github.com/opis/closure) package. At Laravel, we decided to fork this package as the upcoming version [4.x](https://github.com/opis/closure) is a complete rewrite on top of the [FFI extension](https://www.php.net/manual/en/book.ffi.php). As Laravel is a web framework, and FFI is not enabled by default in web requests, this fork allows us to keep using the `3.x` series while adding support for new PHP versions. - -Laravel Serializable Closure provides an easy and secure way to **serialize closures in PHP**. - -## Official Documentation - -### Installation - -> **Requires [PHP 7.4+](https://php.net/releases/)** - -First, install Laravel Serializable Closure via the [Composer](https://getcomposer.org/) package manager: - -```bash -composer require laravel/serializable-closure -``` - -### Usage - -You may serialize a closure this way: - -```php -use Laravel\SerializableClosure\SerializableClosure; - -$closure = fn () => 'james'; - -// Recommended -SerializableClosure::setSecretKey('secret'); - -$serialized = serialize(new SerializableClosure($closure)); -$closure = unserialize($serialized)->getClosure(); - -echo $closure(); // james; -``` - -### Caveats - -* Anonymous classes cannot be created within closures. -* Attributes cannot be used within closures. -* Serializing closures on REPL environments like Laravel Tinker is not supported. -* Serializing closures that reference objects with readonly properties is not supported. - -## Contributing - -Thank you for considering contributing to Serializable Closure! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions). - -## Code of Conduct - -In order to ensure that the Laravel community is welcoming to all, please review and abide by the [Code of Conduct](https://laravel.com/docs/contributions#code-of-conduct). - -## Security Vulnerabilities - -Please review [our security policy](https://github.com/laravel/serializable-closure/security/policy) on how to report security vulnerabilities. - -## License - -Serializable Closure is open-sourced software licensed under the [MIT license](LICENSE.md). diff --git a/system/vendor/laravel/serializable-closure/composer.json b/system/vendor/laravel/serializable-closure/composer.json deleted file mode 100644 index 7142366..0000000 --- a/system/vendor/laravel/serializable-closure/composer.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "name": "laravel/serializable-closure", - "description": "Laravel Serializable Closure provides an easy and secure way to serialize closures in PHP.", - "keywords": ["laravel", "Serializable", "closure"], - "license": "MIT", - "support": { - "issues": "https://github.com/laravel/serializable-closure/issues", - "source": "https://github.com/laravel/serializable-closure" - }, - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - }, - { - "name": "Nuno Maduro", - "email": "nuno@laravel.com" - } - ], - "require": { - "php": "^7.3|^8.0" - }, - "require-dev": { - "nesbot/carbon": "^2.61", - "pestphp/pest": "^1.21.3", - "phpstan/phpstan": "^1.8.2", - "symfony/var-dumper": "^5.4.11" - }, - "autoload": { - "psr-4": { - "Laravel\\SerializableClosure\\": "src/" - } - }, - "autoload-dev": { - "psr-4": { - "Tests\\": "tests/" - } - }, - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "config": { - "sort-packages": true, - "allow-plugins": { - "pestphp/pest-plugin": true - } - }, - "minimum-stability": "dev", - "prefer-stable": true -} diff --git a/system/vendor/laravel/serializable-closure/src/Contracts/Serializable.php b/system/vendor/laravel/serializable-closure/src/Contracts/Serializable.php deleted file mode 100644 index 1a62922..0000000 --- a/system/vendor/laravel/serializable-closure/src/Contracts/Serializable.php +++ /dev/null @@ -1,20 +0,0 @@ -serializable = Serializers\Signed::$signer - ? new Serializers\Signed($closure) - : new Serializers\Native($closure); - } - - /** - * Resolve the closure with the given arguments. - * - * @return mixed - */ - public function __invoke() - { - if (\PHP_VERSION_ID < 70400) { - throw new PhpVersionNotSupportedException(); - } - - return call_user_func_array($this->serializable, func_get_args()); - } - - /** - * Gets the closure. - * - * @return \Closure - */ - public function getClosure() - { - if (\PHP_VERSION_ID < 70400) { - throw new PhpVersionNotSupportedException(); - } - - return $this->serializable->getClosure(); - } - - /** - * Create a new unsigned serializable closure instance. - * - * @param Closure $closure - * @return \Laravel\SerializableClosure\UnsignedSerializableClosure - */ - public static function unsigned(Closure $closure) - { - return new UnsignedSerializableClosure($closure); - } - - /** - * Sets the serializable closure secret key. - * - * @param string|null $secret - * @return void - */ - public static function setSecretKey($secret) - { - Serializers\Signed::$signer = $secret - ? new Hmac($secret) - : null; - } - - /** - * Sets the serializable closure secret key. - * - * @param \Closure|null $transformer - * @return void - */ - public static function transformUseVariablesUsing($transformer) - { - Serializers\Native::$transformUseVariables = $transformer; - } - - /** - * Sets the serializable closure secret key. - * - * @param \Closure|null $resolver - * @return void - */ - public static function resolveUseVariablesUsing($resolver) - { - Serializers\Native::$resolveUseVariables = $resolver; - } - - /** - * Get the serializable representation of the closure. - * - * @return array - */ - public function __serialize() - { - return [ - 'serializable' => $this->serializable, - ]; - } - - /** - * Restore the closure after serialization. - * - * @param array $data - * @return void - * - * @throws \Laravel\SerializableClosure\Exceptions\InvalidSignatureException - */ - public function __unserialize($data) - { - if (Signed::$signer && ! $data['serializable'] instanceof Signed) { - throw new InvalidSignatureException(); - } - - $this->serializable = $data['serializable']; - } -} diff --git a/system/vendor/laravel/serializable-closure/src/Serializers/Native.php b/system/vendor/laravel/serializable-closure/src/Serializers/Native.php deleted file mode 100644 index 4a04b98..0000000 --- a/system/vendor/laravel/serializable-closure/src/Serializers/Native.php +++ /dev/null @@ -1,514 +0,0 @@ -closure = $closure; - } - - /** - * Resolve the closure with the given arguments. - * - * @return mixed - */ - public function __invoke() - { - return call_user_func_array($this->closure, func_get_args()); - } - - /** - * Gets the closure. - * - * @return \Closure - */ - public function getClosure() - { - return $this->closure; - } - - /** - * Get the serializable representation of the closure. - * - * @return array - */ - public function __serialize() - { - if ($this->scope === null) { - $this->scope = new ClosureScope(); - $this->scope->toSerialize++; - } - - $this->scope->serializations++; - - $scope = $object = null; - $reflector = $this->getReflector(); - - if ($reflector->isBindingRequired()) { - $object = $reflector->getClosureThis(); - - static::wrapClosures($object, $this->scope); - } - - if ($scope = $reflector->getClosureScopeClass()) { - $scope = $scope->name; - } - - $this->reference = spl_object_hash($this->closure); - - $this->scope[$this->closure] = $this; - - $use = $reflector->getUseVariables(); - - if (static::$transformUseVariables) { - $use = call_user_func(static::$transformUseVariables, $reflector->getUseVariables()); - } - - $code = $reflector->getCode(); - - $this->mapByReference($use); - - $data = [ - 'use' => $use, - 'function' => $code, - 'scope' => $scope, - 'this' => $object, - 'self' => $this->reference, - ]; - - if (! --$this->scope->serializations && ! --$this->scope->toSerialize) { - $this->scope = null; - } - - return $data; - } - - /** - * Restore the closure after serialization. - * - * @param array $data - * @return void - */ - public function __unserialize($data) - { - ClosureStream::register(); - - $this->code = $data; - unset($data); - - $this->code['objects'] = []; - - if ($this->code['use']) { - $this->scope = new ClosureScope(); - - if (static::$resolveUseVariables) { - $this->code['use'] = call_user_func(static::$resolveUseVariables, $this->code['use']); - } - - $this->mapPointers($this->code['use']); - - extract($this->code['use'], EXTR_OVERWRITE | EXTR_REFS); - - $this->scope = null; - } - - $this->closure = include ClosureStream::STREAM_PROTO.'://'.$this->code['function']; - - if ($this->code['this'] === $this) { - $this->code['this'] = null; - } - - $this->closure = $this->closure->bindTo($this->code['this'], $this->code['scope']); - - if (! empty($this->code['objects'])) { - foreach ($this->code['objects'] as $item) { - $item['property']->setValue($item['instance'], $item['object']->getClosure()); - } - } - - $this->code = $this->code['function']; - } - - /** - * Ensures the given closures are serializable. - * - * @param mixed $data - * @param \Laravel\SerializableClosure\Support\ClosureScope $storage - * @return void - */ - public static function wrapClosures(&$data, $storage) - { - if ($data instanceof Closure) { - $data = new static($data); - } elseif (is_array($data)) { - if (isset($data[self::ARRAY_RECURSIVE_KEY])) { - return; - } - - $data[self::ARRAY_RECURSIVE_KEY] = true; - - foreach ($data as $key => &$value) { - if ($key === self::ARRAY_RECURSIVE_KEY) { - continue; - } - static::wrapClosures($value, $storage); - } - - unset($value); - unset($data[self::ARRAY_RECURSIVE_KEY]); - } elseif ($data instanceof \stdClass) { - if (isset($storage[$data])) { - $data = $storage[$data]; - - return; - } - - $data = $storage[$data] = clone $data; - - foreach ($data as &$value) { - static::wrapClosures($value, $storage); - } - - unset($value); - } elseif (is_object($data) && ! $data instanceof static && ! $data instanceof UnitEnum) { - if (isset($storage[$data])) { - $data = $storage[$data]; - - return; - } - - $instance = $data; - $reflection = new ReflectionObject($instance); - - if (! $reflection->isUserDefined()) { - $storage[$instance] = $data; - - return; - } - - $storage[$instance] = $data = $reflection->newInstanceWithoutConstructor(); - - do { - if (! $reflection->isUserDefined()) { - break; - } - - foreach ($reflection->getProperties() as $property) { - if ($property->isStatic() || ! $property->getDeclaringClass()->isUserDefined()) { - continue; - } - - $property->setAccessible(true); - - if (PHP_VERSION >= 7.4 && ! $property->isInitialized($instance)) { - continue; - } - - $value = $property->getValue($instance); - - if (is_array($value) || is_object($value)) { - static::wrapClosures($value, $storage); - } - - $property->setValue($data, $value); - } - } while ($reflection = $reflection->getParentClass()); - } - } - - /** - * Gets the closure's reflector. - * - * @return \Laravel\SerializableClosure\Support\ReflectionClosure - */ - public function getReflector() - { - if ($this->reflector === null) { - $this->code = null; - $this->reflector = new ReflectionClosure($this->closure); - } - - return $this->reflector; - } - - /** - * Internal method used to map closure pointers. - * - * @param mixed $data - * @return void - */ - protected function mapPointers(&$data) - { - $scope = $this->scope; - - if ($data instanceof static) { - $data = &$data->closure; - } elseif (is_array($data)) { - if (isset($data[self::ARRAY_RECURSIVE_KEY])) { - return; - } - - $data[self::ARRAY_RECURSIVE_KEY] = true; - - foreach ($data as $key => &$value) { - if ($key === self::ARRAY_RECURSIVE_KEY) { - continue; - } elseif ($value instanceof static) { - $data[$key] = &$value->closure; - } elseif ($value instanceof SelfReference && $value->hash === $this->code['self']) { - $data[$key] = &$this->closure; - } else { - $this->mapPointers($value); - } - } - - unset($value); - unset($data[self::ARRAY_RECURSIVE_KEY]); - } elseif ($data instanceof \stdClass) { - if (isset($scope[$data])) { - return; - } - - $scope[$data] = true; - - foreach ($data as $key => &$value) { - if ($value instanceof SelfReference && $value->hash === $this->code['self']) { - $data->{$key} = &$this->closure; - } elseif (is_array($value) || is_object($value)) { - $this->mapPointers($value); - } - } - - unset($value); - } elseif (is_object($data) && ! ($data instanceof Closure)) { - if (isset($scope[$data])) { - return; - } - - $scope[$data] = true; - $reflection = new ReflectionObject($data); - - do { - if (! $reflection->isUserDefined()) { - break; - } - - foreach ($reflection->getProperties() as $property) { - if ($property->isStatic() || ! $property->getDeclaringClass()->isUserDefined()) { - continue; - } - - $property->setAccessible(true); - - if (PHP_VERSION >= 7.4 && ! $property->isInitialized($data)) { - continue; - } - - $item = $property->getValue($data); - - if ($item instanceof SerializableClosure || $item instanceof UnsignedSerializableClosure || ($item instanceof SelfReference && $item->hash === $this->code['self'])) { - $this->code['objects'][] = [ - 'instance' => $data, - 'property' => $property, - 'object' => $item instanceof SelfReference ? $this : $item, - ]; - } elseif (is_array($item) || is_object($item)) { - $this->mapPointers($item); - $property->setValue($data, $item); - } - } - } while ($reflection = $reflection->getParentClass()); - } - } - - /** - * Internal method used to map closures by reference. - * - * @param mixed $data - * @return void - */ - protected function mapByReference(&$data) - { - if ($data instanceof Closure) { - if ($data === $this->closure) { - $data = new SelfReference($this->reference); - - return; - } - - if (isset($this->scope[$data])) { - $data = $this->scope[$data]; - - return; - } - - $instance = new static($data); - - $instance->scope = $this->scope; - - $data = $this->scope[$data] = $instance; - } elseif (is_array($data)) { - if (isset($data[self::ARRAY_RECURSIVE_KEY])) { - return; - } - - $data[self::ARRAY_RECURSIVE_KEY] = true; - - foreach ($data as $key => &$value) { - if ($key === self::ARRAY_RECURSIVE_KEY) { - continue; - } - - $this->mapByReference($value); - } - - unset($value); - unset($data[self::ARRAY_RECURSIVE_KEY]); - } elseif ($data instanceof \stdClass) { - if (isset($this->scope[$data])) { - $data = $this->scope[$data]; - - return; - } - - $instance = $data; - $this->scope[$instance] = $data = clone $data; - - foreach ($data as &$value) { - $this->mapByReference($value); - } - - unset($value); - } elseif (is_object($data) && ! $data instanceof SerializableClosure && ! $data instanceof UnsignedSerializableClosure) { - if (isset($this->scope[$data])) { - $data = $this->scope[$data]; - - return; - } - - $instance = $data; - - if ($data instanceof DateTimeInterface) { - $this->scope[$instance] = $data; - - return; - } - - if ($data instanceof UnitEnum) { - $this->scope[$instance] = $data; - - return; - } - - $reflection = new ReflectionObject($data); - - if (! $reflection->isUserDefined()) { - $this->scope[$instance] = $data; - - return; - } - - $this->scope[$instance] = $data = $reflection->newInstanceWithoutConstructor(); - - do { - if (! $reflection->isUserDefined()) { - break; - } - - foreach ($reflection->getProperties() as $property) { - if ($property->isStatic() || ! $property->getDeclaringClass()->isUserDefined()) { - continue; - } - - $property->setAccessible(true); - - if (PHP_VERSION >= 7.4 && ! $property->isInitialized($instance)) { - continue; - } - - $value = $property->getValue($instance); - - if (is_array($value) || is_object($value)) { - $this->mapByReference($value); - } - - $property->setValue($data, $value); - } - } while ($reflection = $reflection->getParentClass()); - } - } -} diff --git a/system/vendor/laravel/serializable-closure/src/Serializers/Signed.php b/system/vendor/laravel/serializable-closure/src/Serializers/Signed.php deleted file mode 100644 index 391d20d..0000000 --- a/system/vendor/laravel/serializable-closure/src/Serializers/Signed.php +++ /dev/null @@ -1,91 +0,0 @@ -closure = $closure; - } - - /** - * Resolve the closure with the given arguments. - * - * @return mixed - */ - public function __invoke() - { - return call_user_func_array($this->closure, func_get_args()); - } - - /** - * Gets the closure. - * - * @return \Closure - */ - public function getClosure() - { - return $this->closure; - } - - /** - * Get the serializable representation of the closure. - * - * @return array - */ - public function __serialize() - { - if (! static::$signer) { - throw new MissingSecretKeyException(); - } - - return static::$signer->sign( - serialize(new Native($this->closure)) - ); - } - - /** - * Restore the closure after serialization. - * - * @param array $signature - * @return void - * - * @throws \Laravel\SerializableClosure\Exceptions\InvalidSignatureException - */ - public function __unserialize($signature) - { - if (static::$signer && ! static::$signer->verify($signature)) { - throw new InvalidSignatureException(); - } - - /** @var \Laravel\SerializableClosure\Contracts\Serializable $serializable */ - $serializable = unserialize($signature['serializable']); - - $this->closure = $serializable->getClosure(); - } -} diff --git a/system/vendor/laravel/serializable-closure/src/Signers/Hmac.php b/system/vendor/laravel/serializable-closure/src/Signers/Hmac.php deleted file mode 100644 index d94b0a2..0000000 --- a/system/vendor/laravel/serializable-closure/src/Signers/Hmac.php +++ /dev/null @@ -1,53 +0,0 @@ -secret = $secret; - } - - /** - * Sign the given serializable. - * - * @param string $serialized - * @return array - */ - public function sign($serialized) - { - return [ - 'serializable' => $serialized, - 'hash' => base64_encode(hash_hmac('sha256', $serialized, $this->secret, true)), - ]; - } - - /** - * Verify the given signature. - * - * @param array $signature - * @return bool - */ - public function verify($signature) - { - return hash_equals(base64_encode( - hash_hmac('sha256', $signature['serializable'], $this->secret, true) - ), $signature['hash']); - } -} diff --git a/system/vendor/laravel/serializable-closure/src/Support/ClosureScope.php b/system/vendor/laravel/serializable-closure/src/Support/ClosureScope.php deleted file mode 100644 index 64ca19a..0000000 --- a/system/vendor/laravel/serializable-closure/src/Support/ClosureScope.php +++ /dev/null @@ -1,22 +0,0 @@ -content = "length = strlen($this->content); - - return true; - } - - /** - * Read from stream. - * - * @param int $count - * @return string - */ - public function stream_read($count) - { - $value = substr($this->content, $this->pointer, $count); - - $this->pointer += $count; - - return $value; - } - - /** - * Tests for end-of-file on a file pointer. - * - * @return bool - */ - public function stream_eof() - { - return $this->pointer >= $this->length; - } - - /** - * Change stream options. - * - * @param int $option - * @param int $arg1 - * @param int $arg2 - * @return bool - */ - public function stream_set_option($option, $arg1, $arg2) - { - return false; - } - - /** - * Retrieve information about a file resource. - * - * @return array|bool - */ - public function stream_stat() - { - $stat = stat(__FILE__); - // @phpstan-ignore-next-line - $stat[7] = $stat['size'] = $this->length; - - return $stat; - } - - /** - * Retrieve information about a file. - * - * @param string $path - * @param int $flags - * @return array|bool - */ - public function url_stat($path, $flags) - { - $stat = stat(__FILE__); - // @phpstan-ignore-next-line - $stat[7] = $stat['size'] = $this->length; - - return $stat; - } - - /** - * Seeks to specific location in a stream. - * - * @param int $offset - * @param int $whence - * @return bool - */ - public function stream_seek($offset, $whence = SEEK_SET) - { - $crt = $this->pointer; - - switch ($whence) { - case SEEK_SET: - $this->pointer = $offset; - break; - case SEEK_CUR: - $this->pointer += $offset; - break; - case SEEK_END: - $this->pointer = $this->length + $offset; - break; - } - - if ($this->pointer < 0 || $this->pointer >= $this->length) { - $this->pointer = $crt; - - return false; - } - - return true; - } - - /** - * Retrieve the current position of a stream. - * - * @return int - */ - public function stream_tell() - { - return $this->pointer; - } - - /** - * Registers the stream. - * - * @return void - */ - public static function register() - { - if (! static::$isRegistered) { - static::$isRegistered = stream_wrapper_register(static::STREAM_PROTO, __CLASS__); - } - } -} diff --git a/system/vendor/laravel/serializable-closure/src/Support/ReflectionClosure.php b/system/vendor/laravel/serializable-closure/src/Support/ReflectionClosure.php deleted file mode 100644 index 0544004..0000000 --- a/system/vendor/laravel/serializable-closure/src/Support/ReflectionClosure.php +++ /dev/null @@ -1,1198 +0,0 @@ -isStaticClosure === null) { - $this->isStaticClosure = strtolower(substr($this->getCode(), 0, 6)) === 'static'; - } - - return $this->isStaticClosure; - } - - /** - * Checks if the closure is a "short closure". - * - * @return bool - */ - public function isShortClosure() - { - if ($this->isShortClosure === null) { - $code = $this->getCode(); - - if ($this->isStatic()) { - $code = substr($code, 6); - } - - $this->isShortClosure = strtolower(substr(trim($code), 0, 2)) === 'fn'; - } - - return $this->isShortClosure; - } - - /** - * Get the closure's code. - * - * @return string - */ - public function getCode() - { - if ($this->code !== null) { - return $this->code; - } - - $fileName = $this->getFileName(); - $line = $this->getStartLine() - 1; - - $className = null; - - if (null !== $className = $this->getClosureScopeClass()) { - $className = '\\'.trim($className->getName(), '\\'); - } - - $builtin_types = self::getBuiltinTypes(); - $class_keywords = ['self', 'static', 'parent']; - - $ns = $this->getClosureNamespaceName(); - $nsf = $ns == '' ? '' : ($ns[0] == '\\' ? $ns : '\\'.$ns); - - $_file = var_export($fileName, true); - $_dir = var_export(dirname($fileName), true); - $_namespace = var_export($ns, true); - $_class = var_export(trim($className ?: '', '\\'), true); - $_function = $ns.($ns == '' ? '' : '\\').'{closure}'; - $_method = ($className == '' ? '' : trim($className, '\\').'::').$_function; - $_function = var_export($_function, true); - $_method = var_export($_method, true); - $_trait = null; - - $tokens = $this->getTokens(); - $state = $lastState = 'start'; - $inside_structure = false; - $isFirstClassCallable = false; - $isShortClosure = false; - - $inside_structure_mark = 0; - $open = 0; - $code = ''; - $id_start = $id_start_ci = $id_name = $context = ''; - $classes = $functions = $constants = null; - $use = []; - $lineAdd = 0; - $isUsingScope = false; - $isUsingThisObject = false; - - for ($i = 0, $l = count($tokens); $i < $l; $i++) { - $token = $tokens[$i]; - - switch ($state) { - case 'start': - if ($token[0] === T_FUNCTION || $token[0] === T_STATIC) { - $code .= $token[1]; - - $state = $token[0] === T_FUNCTION ? 'function' : 'static'; - } elseif ($token[0] === T_FN) { - $isShortClosure = true; - $code .= $token[1]; - $state = 'closure_args'; - } elseif ($token[0] === T_PUBLIC || $token[0] === T_PROTECTED || $token[0] === T_PRIVATE) { - $code = ''; - $isFirstClassCallable = true; - } - break; - case 'static': - if ($token[0] === T_WHITESPACE || $token[0] === T_COMMENT || $token[0] === T_FUNCTION) { - $code .= $token[1]; - if ($token[0] === T_FUNCTION) { - $state = 'function'; - } - } elseif ($token[0] === T_FN) { - $isShortClosure = true; - $code .= $token[1]; - $state = 'closure_args'; - } else { - $code = ''; - $state = 'start'; - } - break; - case 'function': - switch ($token[0]) { - case T_STRING: - if ($isFirstClassCallable) { - $state = 'closure_args'; - break; - } - - $code = ''; - $state = 'named_function'; - break; - case '(': - $code .= '('; - $state = 'closure_args'; - break; - default: - $code .= is_array($token) ? $token[1] : $token; - } - break; - case 'named_function': - if ($token[0] === T_FUNCTION || $token[0] === T_STATIC) { - $code = $token[1]; - $state = $token[0] === T_FUNCTION ? 'function' : 'static'; - } elseif ($token[0] === T_FN) { - $isShortClosure = true; - $code .= $token[1]; - $state = 'closure_args'; - } - break; - case 'closure_args': - switch ($token[0]) { - case T_NAME_QUALIFIED: - [$id_start, $id_start_ci, $id_name] = $this->parseNameQualified($token[1]); - $context = 'args'; - $state = 'id_name'; - $lastState = 'closure_args'; - break; - case T_NS_SEPARATOR: - case T_STRING: - $id_start = $token[1]; - $id_start_ci = strtolower($id_start); - $id_name = ''; - $context = 'args'; - $state = 'id_name'; - $lastState = 'closure_args'; - break; - case T_USE: - $code .= $token[1]; - $state = 'use'; - break; - case T_DOUBLE_ARROW: - $code .= $token[1]; - if ($isShortClosure) { - $state = 'closure'; - } - break; - case ':': - $code .= ':'; - $state = 'return'; - break; - case '{': - $code .= '{'; - $state = 'closure'; - $open++; - break; - default: - $code .= is_array($token) ? $token[1] : $token; - } - break; - case 'use': - switch ($token[0]) { - case T_VARIABLE: - $use[] = substr($token[1], 1); - $code .= $token[1]; - break; - case '{': - $code .= '{'; - $state = 'closure'; - $open++; - break; - case ':': - $code .= ':'; - $state = 'return'; - break; - default: - $code .= is_array($token) ? $token[1] : $token; - break; - } - break; - case 'return': - switch ($token[0]) { - case T_WHITESPACE: - case T_COMMENT: - case T_DOC_COMMENT: - $code .= $token[1]; - break; - case T_NS_SEPARATOR: - case T_STRING: - $id_start = $token[1]; - $id_start_ci = strtolower($id_start); - $id_name = ''; - $context = 'return_type'; - $state = 'id_name'; - $lastState = 'return'; - break 2; - case T_NAME_QUALIFIED: - [$id_start, $id_start_ci, $id_name] = $this->parseNameQualified($token[1]); - $context = 'return_type'; - $state = 'id_name'; - $lastState = 'return'; - break 2; - case T_DOUBLE_ARROW: - $code .= $token[1]; - if ($isShortClosure) { - $state = 'closure'; - } - break; - case '{': - $code .= '{'; - $state = 'closure'; - $open++; - break; - default: - $code .= is_array($token) ? $token[1] : $token; - break; - } - break; - case 'closure': - switch ($token[0]) { - case T_CURLY_OPEN: - case T_DOLLAR_OPEN_CURLY_BRACES: - case '{': - $code .= is_array($token) ? $token[1] : $token; - $open++; - break; - case '}': - $code .= '}'; - if (--$open === 0 && ! $isShortClosure) { - break 3; - } elseif ($inside_structure) { - $inside_structure = ! ($open === $inside_structure_mark); - } - break; - case '(': - case '[': - $code .= $token[0]; - if ($isShortClosure) { - $open++; - } - break; - case ')': - case ']': - if ($isShortClosure) { - if ($open === 0) { - break 3; - } - $open--; - } - $code .= $token[0]; - break; - case ',': - case ';': - if ($isShortClosure && $open === 0) { - break 3; - } - $code .= $token[0]; - break; - case T_LINE: - $code .= $token[2] - $line + $lineAdd; - break; - case T_FILE: - $code .= $_file; - break; - case T_DIR: - $code .= $_dir; - break; - case T_NS_C: - $code .= $_namespace; - break; - case T_CLASS_C: - $code .= $inside_structure ? $token[1] : $_class; - break; - case T_FUNC_C: - $code .= $inside_structure ? $token[1] : $_function; - break; - case T_METHOD_C: - $code .= $inside_structure ? $token[1] : $_method; - break; - case T_COMMENT: - if (substr($token[1], 0, 8) === '#trackme') { - $timestamp = time(); - $code .= '/**'.PHP_EOL; - $code .= '* Date : '.date(DATE_W3C, $timestamp).PHP_EOL; - $code .= '* Timestamp : '.$timestamp.PHP_EOL; - $code .= '* Line : '.($line + 1).PHP_EOL; - $code .= '* File : '.$_file.PHP_EOL.'*/'.PHP_EOL; - $lineAdd += 5; - } else { - $code .= $token[1]; - } - break; - case T_VARIABLE: - if ($token[1] == '$this' && ! $inside_structure) { - $isUsingThisObject = true; - } - $code .= $token[1]; - break; - case T_STATIC: - case T_NS_SEPARATOR: - case T_STRING: - $id_start = $token[1]; - $id_start_ci = strtolower($id_start); - $id_name = ''; - $context = 'root'; - $state = 'id_name'; - $lastState = 'closure'; - break 2; - case T_NAME_QUALIFIED: - [$id_start, $id_start_ci, $id_name] = $this->parseNameQualified($token[1]); - $context = 'root'; - $state = 'id_name'; - $lastState = 'closure'; - break 2; - case T_NEW: - $code .= $token[1]; - $context = 'new'; - $state = 'id_start'; - $lastState = 'closure'; - break 2; - case T_USE: - $code .= $token[1]; - $context = 'use'; - $state = 'id_start'; - $lastState = 'closure'; - break; - case T_INSTANCEOF: - case T_INSTEADOF: - $code .= $token[1]; - $context = 'instanceof'; - $state = 'id_start'; - $lastState = 'closure'; - break; - case T_OBJECT_OPERATOR: - case T_NULLSAFE_OBJECT_OPERATOR: - case T_DOUBLE_COLON: - $code .= $token[1]; - $lastState = 'closure'; - $state = 'ignore_next'; - break; - case T_FUNCTION: - $code .= $token[1]; - $state = 'closure_args'; - if (! $inside_structure) { - $inside_structure = true; - $inside_structure_mark = $open; - } - break; - case T_TRAIT_C: - if ($_trait === null) { - $startLine = $this->getStartLine(); - $endLine = $this->getEndLine(); - $structures = $this->getStructures(); - - $_trait = ''; - - foreach ($structures as &$struct) { - if ($struct['type'] === 'trait' && - $struct['start'] <= $startLine && - $struct['end'] >= $endLine - ) { - $_trait = ($ns == '' ? '' : $ns.'\\').$struct['name']; - break; - } - } - - $_trait = var_export($_trait, true); - } - - $code .= $_trait; - break; - default: - $code .= is_array($token) ? $token[1] : $token; - } - break; - case 'ignore_next': - switch ($token[0]) { - case T_WHITESPACE: - case T_COMMENT: - case T_DOC_COMMENT: - $code .= $token[1]; - break; - case T_CLASS: - case T_NEW: - case T_STATIC: - case T_VARIABLE: - case T_STRING: - case T_CLASS_C: - case T_FILE: - case T_DIR: - case T_METHOD_C: - case T_FUNC_C: - case T_FUNCTION: - case T_INSTANCEOF: - case T_LINE: - case T_NS_C: - case T_TRAIT_C: - case T_USE: - $code .= $token[1]; - $state = $lastState; - break; - default: - $state = $lastState; - $i--; - } - break; - case 'id_start': - switch ($token[0]) { - case T_WHITESPACE: - case T_COMMENT: - case T_DOC_COMMENT: - $code .= $token[1]; - break; - case T_NS_SEPARATOR: - case T_NAME_FULLY_QUALIFIED: - case T_STRING: - case T_STATIC: - $id_start = $token[1]; - $id_start_ci = strtolower($id_start); - $id_name = ''; - $state = 'id_name'; - break 2; - case T_NAME_QUALIFIED: - [$id_start, $id_start_ci, $id_name] = $this->parseNameQualified($token[1]); - $state = 'id_name'; - break 2; - case T_VARIABLE: - $code .= $token[1]; - $state = $lastState; - break; - case T_CLASS: - $code .= $token[1]; - $state = 'anonymous'; - break; - default: - $i--; //reprocess last - $state = 'id_name'; - } - break; - case 'id_name': - switch ($token[0]) { - case $token[0] === ':' && $context !== 'instanceof': - if ($lastState === 'closure' && $context === 'root') { - $state = 'closure'; - $code .= $id_start.$token; - } - - break; - case T_NAME_QUALIFIED: - case T_NS_SEPARATOR: - case T_STRING: - case T_WHITESPACE: - case T_COMMENT: - case T_DOC_COMMENT: - $id_name .= $token[1]; - break; - case '(': - if ($isShortClosure) { - $open++; - } - if ($context === 'new' || false !== strpos($id_name, '\\')) { - if ($id_start_ci === 'self' || $id_start_ci === 'static') { - if (! $inside_structure) { - $isUsingScope = true; - } - } elseif ($id_start !== '\\' && ! in_array($id_start_ci, $class_keywords)) { - if ($classes === null) { - $classes = $this->getClasses(); - } - if (isset($classes[$id_start_ci])) { - $id_start = $classes[$id_start_ci]; - } - if ($id_start[0] !== '\\') { - $id_start = $nsf.'\\'.$id_start; - } - } - } else { - if ($id_start !== '\\') { - if ($functions === null) { - $functions = $this->getFunctions(); - } - if (isset($functions[$id_start_ci])) { - $id_start = $functions[$id_start_ci]; - } elseif ($nsf !== '\\' && function_exists($nsf.'\\'.$id_start)) { - $id_start = $nsf.'\\'.$id_start; - // Cache it to functions array - $functions[$id_start_ci] = $id_start; - } - } - } - $code .= $id_start.$id_name.'('; - $state = $lastState; - break; - case T_VARIABLE: - case T_DOUBLE_COLON: - if ($id_start !== '\\') { - if ($id_start_ci === 'self' || $id_start_ci === 'parent') { - if (! $inside_structure) { - $isUsingScope = true; - } - } elseif ($id_start_ci === 'static') { - if (! $inside_structure) { - $isUsingScope = $token[0] === T_DOUBLE_COLON; - } - } elseif (! (\PHP_MAJOR_VERSION >= 7 && in_array($id_start_ci, $builtin_types))) { - if ($classes === null) { - $classes = $this->getClasses(); - } - if (isset($classes[$id_start_ci])) { - $id_start = $classes[$id_start_ci]; - } - if ($id_start[0] !== '\\') { - $id_start = $nsf.'\\'.$id_start; - } - } - } - - $code .= $id_start.$id_name.$token[1]; - $state = $token[0] === T_DOUBLE_COLON ? 'ignore_next' : $lastState; - break; - default: - if ($id_start !== '\\' && ! defined($id_start)) { - if ($constants === null) { - $constants = $this->getConstants(); - } - if (isset($constants[$id_start])) { - $id_start = $constants[$id_start]; - } elseif ($context === 'new') { - if (in_array($id_start_ci, $class_keywords)) { - if (! $inside_structure) { - $isUsingScope = true; - } - } else { - if ($classes === null) { - $classes = $this->getClasses(); - } - if (isset($classes[$id_start_ci])) { - $id_start = $classes[$id_start_ci]; - } - if ($id_start[0] !== '\\') { - $id_start = $nsf.'\\'.$id_start; - } - } - } elseif ($context === 'use' || - $context === 'instanceof' || - $context === 'args' || - $context === 'return_type' || - $context === 'extends' || - $context === 'root' - ) { - if (in_array($id_start_ci, $class_keywords)) { - if (! $inside_structure && ! $id_start_ci === 'static') { - $isUsingScope = true; - } - } elseif (! (\PHP_MAJOR_VERSION >= 7 && in_array($id_start_ci, $builtin_types))) { - if ($classes === null) { - $classes = $this->getClasses(); - } - if (isset($classes[$id_start_ci])) { - $id_start = $classes[$id_start_ci]; - } - if ($id_start[0] !== '\\') { - $id_start = $nsf.'\\'.$id_start; - } - } - } - } - $code .= $id_start.$id_name; - $state = $lastState; - $i--; //reprocess last token - } - break; - case 'anonymous': - switch ($token[0]) { - case T_NAME_QUALIFIED: - [$id_start, $id_start_ci, $id_name] = $this->parseNameQualified($token[1]); - $state = 'id_name'; - $lastState = 'anonymous'; - break 2; - case T_NS_SEPARATOR: - case T_STRING: - $id_start = $token[1]; - $id_start_ci = strtolower($id_start); - $id_name = ''; - $state = 'id_name'; - $context = 'extends'; - $lastState = 'anonymous'; - break; - case '{': - $state = 'closure'; - if (! $inside_structure) { - $inside_structure = true; - $inside_structure_mark = $open; - } - $i--; - break; - default: - $code .= is_array($token) ? $token[1] : $token; - } - break; - } - } - - if ($isShortClosure) { - $this->useVariables = $this->getStaticVariables(); - } else { - $this->useVariables = empty($use) ? $use : array_intersect_key($this->getStaticVariables(), array_flip($use)); - } - - $this->isShortClosure = $isShortClosure; - $this->isBindingRequired = $isUsingThisObject; - $this->isScopeRequired = $isUsingScope; - - if (PHP_VERSION_ID >= 80100) { - $attributesCode = array_map(function ($attribute) { - $arguments = $attribute->getArguments(); - - $name = $attribute->getName(); - $arguments = implode(', ', array_map(function ($argument, $key) { - $argument = sprintf("'%s'", str_replace("'", "\\'", $argument)); - - if (is_string($key)) { - $argument = sprintf('%s: %s', $key, $argument); - } - - return $argument; - }, $arguments, array_keys($arguments))); - - return "#[$name($arguments)]"; - }, $this->getAttributes()); - - if (! empty($attributesCode)) { - $code = implode("\n", array_merge($attributesCode, [$code])); - } - } - - $this->code = $code; - - return $this->code; - } - - /** - * Get PHP native built in types. - * - * @return array - */ - protected static function getBuiltinTypes() - { - // PHP 8.1 - if (PHP_VERSION_ID >= 80100) { - return ['array', 'callable', 'string', 'int', 'bool', 'float', 'iterable', 'void', 'object', 'mixed', 'false', 'null', 'never']; - } - - // PHP 8 - if (\PHP_MAJOR_VERSION === 8) { - return ['array', 'callable', 'string', 'int', 'bool', 'float', 'iterable', 'void', 'object', 'mixed', 'false', 'null']; - } - - // PHP 7 - switch (\PHP_MINOR_VERSION) { - case 0: - return ['array', 'callable', 'string', 'int', 'bool', 'float']; - case 1: - return ['array', 'callable', 'string', 'int', 'bool', 'float', 'iterable', 'void']; - default: - return ['array', 'callable', 'string', 'int', 'bool', 'float', 'iterable', 'void', 'object']; - } - } - - /** - * Gets the use variables by the closure. - * - * @return array - */ - public function getUseVariables() - { - if ($this->useVariables !== null) { - return $this->useVariables; - } - - $tokens = $this->getTokens(); - $use = []; - $state = 'start'; - - foreach ($tokens as &$token) { - $is_array = is_array($token); - - switch ($state) { - case 'start': - if ($is_array && $token[0] === T_USE) { - $state = 'use'; - } - break; - case 'use': - if ($is_array) { - if ($token[0] === T_VARIABLE) { - $use[] = substr($token[1], 1); - } - } elseif ($token == ')') { - break 2; - } - break; - } - } - - $this->useVariables = empty($use) ? $use : array_intersect_key($this->getStaticVariables(), array_flip($use)); - - return $this->useVariables; - } - - /** - * Checks if binding is required. - * - * @return bool - */ - public function isBindingRequired() - { - if ($this->isBindingRequired === null) { - $this->getCode(); - } - - return $this->isBindingRequired; - } - - /** - * Checks if access to the scope is required. - * - * @return bool - */ - public function isScopeRequired() - { - if ($this->isScopeRequired === null) { - $this->getCode(); - } - - return $this->isScopeRequired; - } - - /** - * The the hash of the current file name. - * - * @return string - */ - protected function getHashedFileName() - { - if ($this->hashedName === null) { - $this->hashedName = sha1($this->getFileName()); - } - - return $this->hashedName; - } - - /** - * Get the file tokens. - * - * @return array - */ - protected function getFileTokens() - { - $key = $this->getHashedFileName(); - - if (! isset(static::$files[$key])) { - static::$files[$key] = token_get_all(file_get_contents($this->getFileName())); - } - - return static::$files[$key]; - } - - /** - * Get the tokens. - * - * @return array - */ - protected function getTokens() - { - if ($this->tokens === null) { - $tokens = $this->getFileTokens(); - $startLine = $this->getStartLine(); - $endLine = $this->getEndLine(); - $results = []; - $start = false; - - foreach ($tokens as &$token) { - if (! is_array($token)) { - if ($start) { - $results[] = $token; - } - - continue; - } - - $line = $token[2]; - - if ($line <= $endLine) { - if ($line >= $startLine) { - $start = true; - $results[] = $token; - } - - continue; - } - - break; - } - - $this->tokens = $results; - } - - return $this->tokens; - } - - /** - * Get the classes. - * - * @return array - */ - protected function getClasses() - { - $key = $this->getHashedFileName(); - - if (! isset(static::$classes[$key])) { - $this->fetchItems(); - } - - return static::$classes[$key]; - } - - /** - * Get the functions. - * - * @return array - */ - protected function getFunctions() - { - $key = $this->getHashedFileName(); - - if (! isset(static::$functions[$key])) { - $this->fetchItems(); - } - - return static::$functions[$key]; - } - - /** - * Gets the constants. - * - * @return array - */ - protected function getConstants() - { - $key = $this->getHashedFileName(); - - if (! isset(static::$constants[$key])) { - $this->fetchItems(); - } - - return static::$constants[$key]; - } - - /** - * Get the structures. - * - * @return array - */ - protected function getStructures() - { - $key = $this->getHashedFileName(); - - if (! isset(static::$structures[$key])) { - $this->fetchItems(); - } - - return static::$structures[$key]; - } - - /** - * Fetch the items. - * - * @return void. - */ - protected function fetchItems() - { - $key = $this->getHashedFileName(); - - $classes = []; - $functions = []; - $constants = []; - $structures = []; - $tokens = $this->getFileTokens(); - - $open = 0; - $state = 'start'; - $lastState = ''; - $prefix = ''; - $name = ''; - $alias = ''; - $isFunc = $isConst = false; - - $startLine = $endLine = 0; - $structType = $structName = ''; - $structIgnore = false; - - foreach ($tokens as $token) { - switch ($state) { - case 'start': - switch ($token[0]) { - case T_CLASS: - case T_INTERFACE: - case T_TRAIT: - $state = 'before_structure'; - $startLine = $token[2]; - $structType = $token[0] == T_CLASS - ? 'class' - : ($token[0] == T_INTERFACE ? 'interface' : 'trait'); - break; - case T_USE: - $state = 'use'; - $prefix = $name = $alias = ''; - $isFunc = $isConst = false; - break; - case T_FUNCTION: - $state = 'structure'; - $structIgnore = true; - break; - case T_NEW: - $state = 'new'; - break; - case T_OBJECT_OPERATOR: - case T_DOUBLE_COLON: - $state = 'invoke'; - break; - } - break; - case 'use': - switch ($token[0]) { - case T_FUNCTION: - $isFunc = true; - break; - case T_CONST: - $isConst = true; - break; - case T_NS_SEPARATOR: - $name .= $token[1]; - break; - case T_STRING: - $name .= $token[1]; - $alias = $token[1]; - break; - case T_NAME_QUALIFIED: - $name .= $token[1]; - $pieces = explode('\\', $token[1]); - $alias = end($pieces); - break; - case T_AS: - $lastState = 'use'; - $state = 'alias'; - break; - case '{': - $prefix = $name; - $name = $alias = ''; - $state = 'use-group'; - break; - case ',': - case ';': - if ($name === '' || $name[0] !== '\\') { - $name = '\\'.$name; - } - - if ($alias !== '') { - if ($isFunc) { - $functions[strtolower($alias)] = $name; - } elseif ($isConst) { - $constants[$alias] = $name; - } else { - $classes[strtolower($alias)] = $name; - } - } - $name = $alias = ''; - $state = $token === ';' ? 'start' : 'use'; - break; - } - break; - case 'use-group': - switch ($token[0]) { - case T_NS_SEPARATOR: - $name .= $token[1]; - break; - case T_NAME_QUALIFIED: - $name .= $token[1]; - $pieces = explode('\\', $token[1]); - $alias = end($pieces); - break; - case T_STRING: - $name .= $token[1]; - $alias = $token[1]; - break; - case T_AS: - $lastState = 'use-group'; - $state = 'alias'; - break; - case ',': - case '}': - - if ($prefix === '' || $prefix[0] !== '\\') { - $prefix = '\\'.$prefix; - } - - if ($alias !== '') { - if ($isFunc) { - $functions[strtolower($alias)] = $prefix.$name; - } elseif ($isConst) { - $constants[$alias] = $prefix.$name; - } else { - $classes[strtolower($alias)] = $prefix.$name; - } - } - $name = $alias = ''; - $state = $token === '}' ? 'use' : 'use-group'; - break; - } - break; - case 'alias': - if ($token[0] === T_STRING) { - $alias = $token[1]; - $state = $lastState; - } - break; - case 'new': - switch ($token[0]) { - case T_WHITESPACE: - case T_COMMENT: - case T_DOC_COMMENT: - break 2; - case T_CLASS: - $state = 'structure'; - $structIgnore = true; - break; - default: - $state = 'start'; - } - break; - case 'invoke': - switch ($token[0]) { - case T_WHITESPACE: - case T_COMMENT: - case T_DOC_COMMENT: - break 2; - default: - $state = 'start'; - } - break; - case 'before_structure': - if ($token[0] == T_STRING) { - $structName = $token[1]; - $state = 'structure'; - } - break; - case 'structure': - switch ($token[0]) { - case '{': - case T_CURLY_OPEN: - case T_DOLLAR_OPEN_CURLY_BRACES: - $open++; - break; - case '}': - if (--$open == 0) { - if (! $structIgnore) { - $structures[] = [ - 'type' => $structType, - 'name' => $structName, - 'start' => $startLine, - 'end' => $endLine, - ]; - } - $structIgnore = false; - $state = 'start'; - } - break; - default: - if (is_array($token)) { - $endLine = $token[2]; - } - } - break; - } - } - - static::$classes[$key] = $classes; - static::$functions[$key] = $functions; - static::$constants[$key] = $constants; - static::$structures[$key] = $structures; - } - - /** - * Returns the namespace associated to the closure. - * - * @return string - */ - protected function getClosureNamespaceName() - { - $ns = $this->getNamespaceName(); - - // First class callables... - if ($this->getName() !== '{closure}' && empty($ns) && ! is_null($this->getClosureScopeClass())) { - $ns = $this->getClosureScopeClass()->getNamespaceName(); - } - - return $ns; - } - - /** - * Parse the given token. - * - * @param string $token - * @return array - */ - protected function parseNameQualified($token) - { - $pieces = explode('\\', $token); - - $id_start = array_shift($pieces); - - $id_start_ci = strtolower($id_start); - - $id_name = '\\'.implode('\\', $pieces); - - return [$id_start, $id_start_ci, $id_name]; - } -} diff --git a/system/vendor/laravel/serializable-closure/src/Support/SelfReference.php b/system/vendor/laravel/serializable-closure/src/Support/SelfReference.php deleted file mode 100644 index 5831950..0000000 --- a/system/vendor/laravel/serializable-closure/src/Support/SelfReference.php +++ /dev/null @@ -1,24 +0,0 @@ -hash = $hash; - } -} diff --git a/system/vendor/laravel/serializable-closure/src/UnsignedSerializableClosure.php b/system/vendor/laravel/serializable-closure/src/UnsignedSerializableClosure.php deleted file mode 100644 index 1588e7c..0000000 --- a/system/vendor/laravel/serializable-closure/src/UnsignedSerializableClosure.php +++ /dev/null @@ -1,82 +0,0 @@ -serializable = new Serializers\Native($closure); - } - - /** - * Resolve the closure with the given arguments. - * - * @return mixed - */ - public function __invoke() - { - if (\PHP_VERSION_ID < 70400) { - throw new PhpVersionNotSupportedException(); - } - - return call_user_func_array($this->serializable, func_get_args()); - } - - /** - * Gets the closure. - * - * @return \Closure - */ - public function getClosure() - { - if (\PHP_VERSION_ID < 70400) { - throw new PhpVersionNotSupportedException(); - } - - return $this->serializable->getClosure(); - } - - /** - * Get the serializable representation of the closure. - * - * @return array - */ - public function __serialize() - { - return [ - 'serializable' => $this->serializable, - ]; - } - - /** - * Restore the closure after serialization. - * - * @param array $data - * @return void - */ - public function __unserialize($data) - { - $this->serializable = $data['serializable']; - } -} diff --git a/system/vendor/nikic/fast-route/.gitignore b/system/vendor/nikic/fast-route/.gitignore deleted file mode 100644 index e378a07..0000000 --- a/system/vendor/nikic/fast-route/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -/vendor/ -.idea/ - -# ignore lock file since we have no extra dependencies -composer.lock diff --git a/system/vendor/nikic/fast-route/.hhconfig b/system/vendor/nikic/fast-route/.hhconfig deleted file mode 100644 index 0c2153c..0000000 --- a/system/vendor/nikic/fast-route/.hhconfig +++ /dev/null @@ -1 +0,0 @@ -assume_php=false diff --git a/system/vendor/nikic/fast-route/.travis.yml b/system/vendor/nikic/fast-route/.travis.yml deleted file mode 100644 index 10f8381..0000000 --- a/system/vendor/nikic/fast-route/.travis.yml +++ /dev/null @@ -1,20 +0,0 @@ -sudo: false -language: php - -php: - - 5.4 - - 5.5 - - 5.6 - - 7.0 - - 7.1 - - 7.2 - - hhvm - -script: - - ./vendor/bin/phpunit - -before_install: - - travis_retry composer self-update - -install: - - composer install diff --git a/system/vendor/nikic/fast-route/FastRoute.hhi b/system/vendor/nikic/fast-route/FastRoute.hhi deleted file mode 100644 index 8d50738..0000000 --- a/system/vendor/nikic/fast-route/FastRoute.hhi +++ /dev/null @@ -1,126 +0,0 @@ -; - } - - class RouteCollector { - public function __construct(RouteParser $routeParser, DataGenerator $dataGenerator); - public function addRoute(mixed $httpMethod, string $route, mixed $handler): void; - public function getData(): array; - } - - class Route { - public function __construct(string $httpMethod, mixed $handler, string $regex, array $variables); - public function matches(string $str): bool; - } - - interface DataGenerator { - public function addRoute(string $httpMethod, array $routeData, mixed $handler); - public function getData(): array; - } - - interface Dispatcher { - const int NOT_FOUND = 0; - const int FOUND = 1; - const int METHOD_NOT_ALLOWED = 2; - public function dispatch(string $httpMethod, string $uri): array; - } - - function simpleDispatcher( - (function(RouteCollector): void) $routeDefinitionCallback, - shape( - ?'routeParser' => classname, - ?'dataGenerator' => classname, - ?'dispatcher' => classname, - ?'routeCollector' => classname, - ) $options = shape()): Dispatcher; - - function cachedDispatcher( - (function(RouteCollector): void) $routeDefinitionCallback, - shape( - ?'routeParser' => classname, - ?'dataGenerator' => classname, - ?'dispatcher' => classname, - ?'routeCollector' => classname, - ?'cacheDisabled' => bool, - ?'cacheFile' => string, - ) $options = shape()): Dispatcher; -} - -namespace FastRoute\DataGenerator { - abstract class RegexBasedAbstract implements \FastRoute\DataGenerator { - protected abstract function getApproxChunkSize(); - protected abstract function processChunk($regexToRoutesMap); - - public function addRoute(string $httpMethod, array $routeData, mixed $handler): void; - public function getData(): array; - } - - class CharCountBased extends RegexBasedAbstract { - protected function getApproxChunkSize(): int; - protected function processChunk(array $regexToRoutesMap): array; - } - - class GroupCountBased extends RegexBasedAbstract { - protected function getApproxChunkSize(): int; - protected function processChunk(array $regexToRoutesMap): array; - } - - class GroupPosBased extends RegexBasedAbstract { - protected function getApproxChunkSize(): int; - protected function processChunk(array $regexToRoutesMap): array; - } - - class MarkBased extends RegexBasedAbstract { - protected function getApproxChunkSize(): int; - protected function processChunk(array $regexToRoutesMap): array; - } -} - -namespace FastRoute\Dispatcher { - abstract class RegexBasedAbstract implements \FastRoute\Dispatcher { - protected abstract function dispatchVariableRoute(array $routeData, string $uri): array; - - public function dispatch(string $httpMethod, string $uri): array; - } - - class GroupPosBased extends RegexBasedAbstract { - public function __construct(array $data); - protected function dispatchVariableRoute(array $routeData, string $uri): array; - } - - class GroupCountBased extends RegexBasedAbstract { - public function __construct(array $data); - protected function dispatchVariableRoute(array $routeData, string $uri): array; - } - - class CharCountBased extends RegexBasedAbstract { - public function __construct(array $data); - protected function dispatchVariableRoute(array $routeData, string $uri): array; - } - - class MarkBased extends RegexBasedAbstract { - public function __construct(array $data); - protected function dispatchVariableRoute(array $routeData, string $uri): array; - } -} - -namespace FastRoute\RouteParser { - class Std implements \FastRoute\RouteParser { - const string VARIABLE_REGEX = <<<'REGEX' -\{ - \s* ([a-zA-Z][a-zA-Z0-9_]*) \s* - (?: - : \s* ([^{}]*(?:\{(?-1)\}[^{}]*)*) - )? -\} -REGEX; - const string DEFAULT_DISPATCH_REGEX = '[^/]+'; - public function parse(string $route): array; - } -} diff --git a/system/vendor/nikic/fast-route/LICENSE b/system/vendor/nikic/fast-route/LICENSE deleted file mode 100644 index 478e764..0000000 --- a/system/vendor/nikic/fast-route/LICENSE +++ /dev/null @@ -1,31 +0,0 @@ -Copyright (c) 2013 by Nikita Popov. - -Some rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - - * The names of the contributors may not be used to endorse or - promote products derived from this software without specific - prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/system/vendor/nikic/fast-route/README.md b/system/vendor/nikic/fast-route/README.md deleted file mode 100644 index 91bd466..0000000 --- a/system/vendor/nikic/fast-route/README.md +++ /dev/null @@ -1,313 +0,0 @@ -FastRoute - Fast request router for PHP -======================================= - -This library provides a fast implementation of a regular expression based router. [Blog post explaining how the -implementation works and why it is fast.][blog_post] - -Install -------- - -To install with composer: - -```sh -composer require nikic/fast-route -``` - -Requires PHP 5.4 or newer. - -Usage ------ - -Here's a basic usage example: - -```php -addRoute('GET', '/users', 'get_all_users_handler'); - // {id} must be a number (\d+) - $r->addRoute('GET', '/user/{id:\d+}', 'get_user_handler'); - // The /{title} suffix is optional - $r->addRoute('GET', '/articles/{id:\d+}[/{title}]', 'get_article_handler'); -}); - -// Fetch method and URI from somewhere -$httpMethod = $_SERVER['REQUEST_METHOD']; -$uri = $_SERVER['REQUEST_URI']; - -// Strip query string (?foo=bar) and decode URI -if (false !== $pos = strpos($uri, '?')) { - $uri = substr($uri, 0, $pos); -} -$uri = rawurldecode($uri); - -$routeInfo = $dispatcher->dispatch($httpMethod, $uri); -switch ($routeInfo[0]) { - case FastRoute\Dispatcher::NOT_FOUND: - // ... 404 Not Found - break; - case FastRoute\Dispatcher::METHOD_NOT_ALLOWED: - $allowedMethods = $routeInfo[1]; - // ... 405 Method Not Allowed - break; - case FastRoute\Dispatcher::FOUND: - $handler = $routeInfo[1]; - $vars = $routeInfo[2]; - // ... call $handler with $vars - break; -} -``` - -### Defining routes - -The routes are defined by calling the `FastRoute\simpleDispatcher()` function, which accepts -a callable taking a `FastRoute\RouteCollector` instance. The routes are added by calling -`addRoute()` on the collector instance: - -```php -$r->addRoute($method, $routePattern, $handler); -``` - -The `$method` is an uppercase HTTP method string for which a certain route should match. It -is possible to specify multiple valid methods using an array: - -```php -// These two calls -$r->addRoute('GET', '/test', 'handler'); -$r->addRoute('POST', '/test', 'handler'); -// Are equivalent to this one call -$r->addRoute(['GET', 'POST'], '/test', 'handler'); -``` - -By default the `$routePattern` uses a syntax where `{foo}` specifies a placeholder with name `foo` -and matching the regex `[^/]+`. To adjust the pattern the placeholder matches, you can specify -a custom pattern by writing `{bar:[0-9]+}`. Some examples: - -```php -// Matches /user/42, but not /user/xyz -$r->addRoute('GET', '/user/{id:\d+}', 'handler'); - -// Matches /user/foobar, but not /user/foo/bar -$r->addRoute('GET', '/user/{name}', 'handler'); - -// Matches /user/foo/bar as well -$r->addRoute('GET', '/user/{name:.+}', 'handler'); -``` - -Custom patterns for route placeholders cannot use capturing groups. For example `{lang:(en|de)}` -is not a valid placeholder, because `()` is a capturing group. Instead you can use either -`{lang:en|de}` or `{lang:(?:en|de)}`. - -Furthermore parts of the route enclosed in `[...]` are considered optional, so that `/foo[bar]` -will match both `/foo` and `/foobar`. Optional parts are only supported in a trailing position, -not in the middle of a route. - -```php -// This route -$r->addRoute('GET', '/user/{id:\d+}[/{name}]', 'handler'); -// Is equivalent to these two routes -$r->addRoute('GET', '/user/{id:\d+}', 'handler'); -$r->addRoute('GET', '/user/{id:\d+}/{name}', 'handler'); - -// Multiple nested optional parts are possible as well -$r->addRoute('GET', '/user[/{id:\d+}[/{name}]]', 'handler'); - -// This route is NOT valid, because optional parts can only occur at the end -$r->addRoute('GET', '/user[/{id:\d+}]/{name}', 'handler'); -``` - -The `$handler` parameter does not necessarily have to be a callback, it could also be a controller -class name or any other kind of data you wish to associate with the route. FastRoute only tells you -which handler corresponds to your URI, how you interpret it is up to you. - -#### Shorcut methods for common request methods - -For the `GET`, `POST`, `PUT`, `PATCH`, `DELETE` and `HEAD` request methods shortcut methods are available. For example: - -```php -$r->get('/get-route', 'get_handler'); -$r->post('/post-route', 'post_handler'); -``` - -Is equivalent to: - -```php -$r->addRoute('GET', '/get-route', 'get_handler'); -$r->addRoute('POST', '/post-route', 'post_handler'); -``` - -#### Route Groups - -Additionally, you can specify routes inside of a group. All routes defined inside a group will have a common prefix. - -For example, defining your routes as: - -```php -$r->addGroup('/admin', function (RouteCollector $r) { - $r->addRoute('GET', '/do-something', 'handler'); - $r->addRoute('GET', '/do-another-thing', 'handler'); - $r->addRoute('GET', '/do-something-else', 'handler'); -}); -``` - -Will have the same result as: - - ```php -$r->addRoute('GET', '/admin/do-something', 'handler'); -$r->addRoute('GET', '/admin/do-another-thing', 'handler'); -$r->addRoute('GET', '/admin/do-something-else', 'handler'); - ``` - -Nested groups are also supported, in which case the prefixes of all the nested groups are combined. - -### Caching - -The reason `simpleDispatcher` accepts a callback for defining the routes is to allow seamless -caching. By using `cachedDispatcher` instead of `simpleDispatcher` you can cache the generated -routing data and construct the dispatcher from the cached information: - -```php -addRoute('GET', '/user/{name}/{id:[0-9]+}', 'handler0'); - $r->addRoute('GET', '/user/{id:[0-9]+}', 'handler1'); - $r->addRoute('GET', '/user/{name}', 'handler2'); -}, [ - 'cacheFile' => __DIR__ . '/route.cache', /* required */ - 'cacheDisabled' => IS_DEBUG_ENABLED, /* optional, enabled by default */ -]); -``` - -The second parameter to the function is an options array, which can be used to specify the cache -file location, among other things. - -### Dispatching a URI - -A URI is dispatched by calling the `dispatch()` method of the created dispatcher. This method -accepts the HTTP method and a URI. Getting those two bits of information (and normalizing them -appropriately) is your job - this library is not bound to the PHP web SAPIs. - -The `dispatch()` method returns an array whose first element contains a status code. It is one -of `Dispatcher::NOT_FOUND`, `Dispatcher::METHOD_NOT_ALLOWED` and `Dispatcher::FOUND`. For the -method not allowed status the second array element contains a list of HTTP methods allowed for -the supplied URI. For example: - - [FastRoute\Dispatcher::METHOD_NOT_ALLOWED, ['GET', 'POST']] - -> **NOTE:** The HTTP specification requires that a `405 Method Not Allowed` response include the -`Allow:` header to detail available methods for the requested resource. Applications using FastRoute -should use the second array element to add this header when relaying a 405 response. - -For the found status the second array element is the handler that was associated with the route -and the third array element is a dictionary of placeholder names to their values. For example: - - /* Routing against GET /user/nikic/42 */ - - [FastRoute\Dispatcher::FOUND, 'handler0', ['name' => 'nikic', 'id' => '42']] - -### Overriding the route parser and dispatcher - -The routing process makes use of three components: A route parser, a data generator and a -dispatcher. The three components adhere to the following interfaces: - -```php - 'FastRoute\\RouteParser\\Std', - 'dataGenerator' => 'FastRoute\\DataGenerator\\GroupCountBased', - 'dispatcher' => 'FastRoute\\Dispatcher\\GroupCountBased', -]); -``` - -The above options array corresponds to the defaults. By replacing `GroupCountBased` by -`GroupPosBased` you could switch to a different dispatching strategy. - -### A Note on HEAD Requests - -The HTTP spec requires servers to [support both GET and HEAD methods][2616-511]: - -> The methods GET and HEAD MUST be supported by all general-purpose servers - -To avoid forcing users to manually register HEAD routes for each resource we fallback to matching an -available GET route for a given resource. The PHP web SAPI transparently removes the entity body -from HEAD responses so this behavior has no effect on the vast majority of users. - -However, implementers using FastRoute outside the web SAPI environment (e.g. a custom server) MUST -NOT send entity bodies generated in response to HEAD requests. If you are a non-SAPI user this is -*your responsibility*; FastRoute has no purview to prevent you from breaking HTTP in such cases. - -Finally, note that applications MAY always specify their own HEAD method route for a given -resource to bypass this behavior entirely. - -### Credits - -This library is based on a router that [Levi Morrison][levi] implemented for the Aerys server. - -A large number of tests, as well as HTTP compliance considerations, were provided by [Daniel Lowrey][rdlowrey]. - - -[2616-511]: http://www.w3.org/Protocols/rfc2616/rfc2616-sec5.html#sec5.1.1 "RFC 2616 Section 5.1.1" -[blog_post]: http://nikic.github.io/2014/02/18/Fast-request-routing-using-regular-expressions.html -[levi]: https://github.com/morrisonlevi -[rdlowrey]: https://github.com/rdlowrey diff --git a/system/vendor/nikic/fast-route/composer.json b/system/vendor/nikic/fast-route/composer.json deleted file mode 100644 index fb446a2..0000000 --- a/system/vendor/nikic/fast-route/composer.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "nikic/fast-route", - "description": "Fast request router for PHP", - "keywords": ["routing", "router"], - "license": "BSD-3-Clause", - "authors": [ - { - "name": "Nikita Popov", - "email": "nikic@php.net" - } - ], - "autoload": { - "psr-4": { - "FastRoute\\": "src/" - }, - "files": ["src/functions.php"] - }, - "require": { - "php": ">=5.4.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.35|~5.7" - } -} diff --git a/system/vendor/nikic/fast-route/phpunit.xml b/system/vendor/nikic/fast-route/phpunit.xml deleted file mode 100644 index 3c807b6..0000000 --- a/system/vendor/nikic/fast-route/phpunit.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - ./test/ - - - - - - ./src/ - - - diff --git a/system/vendor/nikic/fast-route/psalm.xml b/system/vendor/nikic/fast-route/psalm.xml deleted file mode 100644 index 0dca5d7..0000000 --- a/system/vendor/nikic/fast-route/psalm.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/system/vendor/nikic/fast-route/src/BadRouteException.php b/system/vendor/nikic/fast-route/src/BadRouteException.php deleted file mode 100644 index 62262ec..0000000 --- a/system/vendor/nikic/fast-route/src/BadRouteException.php +++ /dev/null @@ -1,7 +0,0 @@ - $route) { - $suffixLen++; - $suffix .= "\t"; - - $regexes[] = '(?:' . $regex . '/(\t{' . $suffixLen . '})\t{' . ($count - $suffixLen) . '})'; - $routeMap[$suffix] = [$route->handler, $route->variables]; - } - - $regex = '~^(?|' . implode('|', $regexes) . ')$~'; - return ['regex' => $regex, 'suffix' => '/' . $suffix, 'routeMap' => $routeMap]; - } -} diff --git a/system/vendor/nikic/fast-route/src/DataGenerator/GroupCountBased.php b/system/vendor/nikic/fast-route/src/DataGenerator/GroupCountBased.php deleted file mode 100644 index 54d9a05..0000000 --- a/system/vendor/nikic/fast-route/src/DataGenerator/GroupCountBased.php +++ /dev/null @@ -1,30 +0,0 @@ - $route) { - $numVariables = count($route->variables); - $numGroups = max($numGroups, $numVariables); - - $regexes[] = $regex . str_repeat('()', $numGroups - $numVariables); - $routeMap[$numGroups + 1] = [$route->handler, $route->variables]; - - ++$numGroups; - } - - $regex = '~^(?|' . implode('|', $regexes) . ')$~'; - return ['regex' => $regex, 'routeMap' => $routeMap]; - } -} diff --git a/system/vendor/nikic/fast-route/src/DataGenerator/GroupPosBased.php b/system/vendor/nikic/fast-route/src/DataGenerator/GroupPosBased.php deleted file mode 100644 index fc4dc0a..0000000 --- a/system/vendor/nikic/fast-route/src/DataGenerator/GroupPosBased.php +++ /dev/null @@ -1,27 +0,0 @@ - $route) { - $regexes[] = $regex; - $routeMap[$offset] = [$route->handler, $route->variables]; - - $offset += count($route->variables); - } - - $regex = '~^(?:' . implode('|', $regexes) . ')$~'; - return ['regex' => $regex, 'routeMap' => $routeMap]; - } -} diff --git a/system/vendor/nikic/fast-route/src/DataGenerator/MarkBased.php b/system/vendor/nikic/fast-route/src/DataGenerator/MarkBased.php deleted file mode 100644 index 0aebed9..0000000 --- a/system/vendor/nikic/fast-route/src/DataGenerator/MarkBased.php +++ /dev/null @@ -1,27 +0,0 @@ - $route) { - $regexes[] = $regex . '(*MARK:' . $markName . ')'; - $routeMap[$markName] = [$route->handler, $route->variables]; - - ++$markName; - } - - $regex = '~^(?|' . implode('|', $regexes) . ')$~'; - return ['regex' => $regex, 'routeMap' => $routeMap]; - } -} diff --git a/system/vendor/nikic/fast-route/src/DataGenerator/RegexBasedAbstract.php b/system/vendor/nikic/fast-route/src/DataGenerator/RegexBasedAbstract.php deleted file mode 100644 index 6457290..0000000 --- a/system/vendor/nikic/fast-route/src/DataGenerator/RegexBasedAbstract.php +++ /dev/null @@ -1,186 +0,0 @@ -isStaticRoute($routeData)) { - $this->addStaticRoute($httpMethod, $routeData, $handler); - } else { - $this->addVariableRoute($httpMethod, $routeData, $handler); - } - } - - /** - * @return mixed[] - */ - public function getData() - { - if (empty($this->methodToRegexToRoutesMap)) { - return [$this->staticRoutes, []]; - } - - return [$this->staticRoutes, $this->generateVariableRouteData()]; - } - - /** - * @return mixed[] - */ - private function generateVariableRouteData() - { - $data = []; - foreach ($this->methodToRegexToRoutesMap as $method => $regexToRoutesMap) { - $chunkSize = $this->computeChunkSize(count($regexToRoutesMap)); - $chunks = array_chunk($regexToRoutesMap, $chunkSize, true); - $data[$method] = array_map([$this, 'processChunk'], $chunks); - } - return $data; - } - - /** - * @param int - * @return int - */ - private function computeChunkSize($count) - { - $numParts = max(1, round($count / $this->getApproxChunkSize())); - return (int) ceil($count / $numParts); - } - - /** - * @param mixed[] - * @return bool - */ - private function isStaticRoute($routeData) - { - return count($routeData) === 1 && is_string($routeData[0]); - } - - private function addStaticRoute($httpMethod, $routeData, $handler) - { - $routeStr = $routeData[0]; - - if (isset($this->staticRoutes[$httpMethod][$routeStr])) { - throw new BadRouteException(sprintf( - 'Cannot register two routes matching "%s" for method "%s"', - $routeStr, $httpMethod - )); - } - - if (isset($this->methodToRegexToRoutesMap[$httpMethod])) { - foreach ($this->methodToRegexToRoutesMap[$httpMethod] as $route) { - if ($route->matches($routeStr)) { - throw new BadRouteException(sprintf( - 'Static route "%s" is shadowed by previously defined variable route "%s" for method "%s"', - $routeStr, $route->regex, $httpMethod - )); - } - } - } - - $this->staticRoutes[$httpMethod][$routeStr] = $handler; - } - - private function addVariableRoute($httpMethod, $routeData, $handler) - { - list($regex, $variables) = $this->buildRegexForRoute($routeData); - - if (isset($this->methodToRegexToRoutesMap[$httpMethod][$regex])) { - throw new BadRouteException(sprintf( - 'Cannot register two routes matching "%s" for method "%s"', - $regex, $httpMethod - )); - } - - $this->methodToRegexToRoutesMap[$httpMethod][$regex] = new Route( - $httpMethod, $handler, $regex, $variables - ); - } - - /** - * @param mixed[] - * @return mixed[] - */ - private function buildRegexForRoute($routeData) - { - $regex = ''; - $variables = []; - foreach ($routeData as $part) { - if (is_string($part)) { - $regex .= preg_quote($part, '~'); - continue; - } - - list($varName, $regexPart) = $part; - - if (isset($variables[$varName])) { - throw new BadRouteException(sprintf( - 'Cannot use the same placeholder "%s" twice', $varName - )); - } - - if ($this->regexHasCapturingGroups($regexPart)) { - throw new BadRouteException(sprintf( - 'Regex "%s" for parameter "%s" contains a capturing group', - $regexPart, $varName - )); - } - - $variables[$varName] = $varName; - $regex .= '(' . $regexPart . ')'; - } - - return [$regex, $variables]; - } - - /** - * @param string - * @return bool - */ - private function regexHasCapturingGroups($regex) - { - if (false === strpos($regex, '(')) { - // Needs to have at least a ( to contain a capturing group - return false; - } - - // Semi-accurate detection for capturing groups - return (bool) preg_match( - '~ - (?: - \(\?\( - | \[ [^\]\\\\]* (?: \\\\ . [^\]\\\\]* )* \] - | \\\\ . - ) (*SKIP)(*FAIL) | - \( - (?! - \? (?! <(?![!=]) | P< | \' ) - | \* - ) - ~x', - $regex - ); - } -} diff --git a/system/vendor/nikic/fast-route/src/Dispatcher.php b/system/vendor/nikic/fast-route/src/Dispatcher.php deleted file mode 100644 index 4ae72a3..0000000 --- a/system/vendor/nikic/fast-route/src/Dispatcher.php +++ /dev/null @@ -1,26 +0,0 @@ - 'value', ...]] - * - * @param string $httpMethod - * @param string $uri - * - * @return array - */ - public function dispatch($httpMethod, $uri); -} diff --git a/system/vendor/nikic/fast-route/src/Dispatcher/CharCountBased.php b/system/vendor/nikic/fast-route/src/Dispatcher/CharCountBased.php deleted file mode 100644 index ef1eec1..0000000 --- a/system/vendor/nikic/fast-route/src/Dispatcher/CharCountBased.php +++ /dev/null @@ -1,31 +0,0 @@ -staticRouteMap, $this->variableRouteData) = $data; - } - - protected function dispatchVariableRoute($routeData, $uri) - { - foreach ($routeData as $data) { - if (!preg_match($data['regex'], $uri . $data['suffix'], $matches)) { - continue; - } - - list($handler, $varNames) = $data['routeMap'][end($matches)]; - - $vars = []; - $i = 0; - foreach ($varNames as $varName) { - $vars[$varName] = $matches[++$i]; - } - return [self::FOUND, $handler, $vars]; - } - - return [self::NOT_FOUND]; - } -} diff --git a/system/vendor/nikic/fast-route/src/Dispatcher/GroupCountBased.php b/system/vendor/nikic/fast-route/src/Dispatcher/GroupCountBased.php deleted file mode 100644 index 493e7a9..0000000 --- a/system/vendor/nikic/fast-route/src/Dispatcher/GroupCountBased.php +++ /dev/null @@ -1,31 +0,0 @@ -staticRouteMap, $this->variableRouteData) = $data; - } - - protected function dispatchVariableRoute($routeData, $uri) - { - foreach ($routeData as $data) { - if (!preg_match($data['regex'], $uri, $matches)) { - continue; - } - - list($handler, $varNames) = $data['routeMap'][count($matches)]; - - $vars = []; - $i = 0; - foreach ($varNames as $varName) { - $vars[$varName] = $matches[++$i]; - } - return [self::FOUND, $handler, $vars]; - } - - return [self::NOT_FOUND]; - } -} diff --git a/system/vendor/nikic/fast-route/src/Dispatcher/GroupPosBased.php b/system/vendor/nikic/fast-route/src/Dispatcher/GroupPosBased.php deleted file mode 100644 index 498220e..0000000 --- a/system/vendor/nikic/fast-route/src/Dispatcher/GroupPosBased.php +++ /dev/null @@ -1,33 +0,0 @@ -staticRouteMap, $this->variableRouteData) = $data; - } - - protected function dispatchVariableRoute($routeData, $uri) - { - foreach ($routeData as $data) { - if (!preg_match($data['regex'], $uri, $matches)) { - continue; - } - - // find first non-empty match - for ($i = 1; '' === $matches[$i]; ++$i); - - list($handler, $varNames) = $data['routeMap'][$i]; - - $vars = []; - foreach ($varNames as $varName) { - $vars[$varName] = $matches[$i++]; - } - return [self::FOUND, $handler, $vars]; - } - - return [self::NOT_FOUND]; - } -} diff --git a/system/vendor/nikic/fast-route/src/Dispatcher/MarkBased.php b/system/vendor/nikic/fast-route/src/Dispatcher/MarkBased.php deleted file mode 100644 index 22eb09b..0000000 --- a/system/vendor/nikic/fast-route/src/Dispatcher/MarkBased.php +++ /dev/null @@ -1,31 +0,0 @@ -staticRouteMap, $this->variableRouteData) = $data; - } - - protected function dispatchVariableRoute($routeData, $uri) - { - foreach ($routeData as $data) { - if (!preg_match($data['regex'], $uri, $matches)) { - continue; - } - - list($handler, $varNames) = $data['routeMap'][$matches['MARK']]; - - $vars = []; - $i = 0; - foreach ($varNames as $varName) { - $vars[$varName] = $matches[++$i]; - } - return [self::FOUND, $handler, $vars]; - } - - return [self::NOT_FOUND]; - } -} diff --git a/system/vendor/nikic/fast-route/src/Dispatcher/RegexBasedAbstract.php b/system/vendor/nikic/fast-route/src/Dispatcher/RegexBasedAbstract.php deleted file mode 100644 index 206e879..0000000 --- a/system/vendor/nikic/fast-route/src/Dispatcher/RegexBasedAbstract.php +++ /dev/null @@ -1,88 +0,0 @@ -staticRouteMap[$httpMethod][$uri])) { - $handler = $this->staticRouteMap[$httpMethod][$uri]; - return [self::FOUND, $handler, []]; - } - - $varRouteData = $this->variableRouteData; - if (isset($varRouteData[$httpMethod])) { - $result = $this->dispatchVariableRoute($varRouteData[$httpMethod], $uri); - if ($result[0] === self::FOUND) { - return $result; - } - } - - // For HEAD requests, attempt fallback to GET - if ($httpMethod === 'HEAD') { - if (isset($this->staticRouteMap['GET'][$uri])) { - $handler = $this->staticRouteMap['GET'][$uri]; - return [self::FOUND, $handler, []]; - } - if (isset($varRouteData['GET'])) { - $result = $this->dispatchVariableRoute($varRouteData['GET'], $uri); - if ($result[0] === self::FOUND) { - return $result; - } - } - } - - // If nothing else matches, try fallback routes - if (isset($this->staticRouteMap['*'][$uri])) { - $handler = $this->staticRouteMap['*'][$uri]; - return [self::FOUND, $handler, []]; - } - if (isset($varRouteData['*'])) { - $result = $this->dispatchVariableRoute($varRouteData['*'], $uri); - if ($result[0] === self::FOUND) { - return $result; - } - } - - // Find allowed methods for this URI by matching against all other HTTP methods as well - $allowedMethods = []; - - foreach ($this->staticRouteMap as $method => $uriMap) { - if ($method !== $httpMethod && isset($uriMap[$uri])) { - $allowedMethods[] = $method; - } - } - - foreach ($varRouteData as $method => $routeData) { - if ($method === $httpMethod) { - continue; - } - - $result = $this->dispatchVariableRoute($routeData, $uri); - if ($result[0] === self::FOUND) { - $allowedMethods[] = $method; - } - } - - // If there are no allowed methods the route simply does not exist - if ($allowedMethods) { - return [self::METHOD_NOT_ALLOWED, $allowedMethods]; - } - - return [self::NOT_FOUND]; - } -} diff --git a/system/vendor/nikic/fast-route/src/Route.php b/system/vendor/nikic/fast-route/src/Route.php deleted file mode 100644 index e1bf7dd..0000000 --- a/system/vendor/nikic/fast-route/src/Route.php +++ /dev/null @@ -1,47 +0,0 @@ -httpMethod = $httpMethod; - $this->handler = $handler; - $this->regex = $regex; - $this->variables = $variables; - } - - /** - * Tests whether this route matches the given string. - * - * @param string $str - * - * @return bool - */ - public function matches($str) - { - $regex = '~^' . $this->regex . '$~'; - return (bool) preg_match($regex, $str); - } -} diff --git a/system/vendor/nikic/fast-route/src/RouteCollector.php b/system/vendor/nikic/fast-route/src/RouteCollector.php deleted file mode 100644 index c1c1762..0000000 --- a/system/vendor/nikic/fast-route/src/RouteCollector.php +++ /dev/null @@ -1,152 +0,0 @@ -routeParser = $routeParser; - $this->dataGenerator = $dataGenerator; - $this->currentGroupPrefix = ''; - } - - /** - * Adds a route to the collection. - * - * The syntax used in the $route string depends on the used route parser. - * - * @param string|string[] $httpMethod - * @param string $route - * @param mixed $handler - */ - public function addRoute($httpMethod, $route, $handler) - { - $route = $this->currentGroupPrefix . $route; - $routeDatas = $this->routeParser->parse($route); - foreach ((array) $httpMethod as $method) { - foreach ($routeDatas as $routeData) { - $this->dataGenerator->addRoute($method, $routeData, $handler); - } - } - } - - /** - * Create a route group with a common prefix. - * - * All routes created in the passed callback will have the given group prefix prepended. - * - * @param string $prefix - * @param callable $callback - */ - public function addGroup($prefix, callable $callback) - { - $previousGroupPrefix = $this->currentGroupPrefix; - $this->currentGroupPrefix = $previousGroupPrefix . $prefix; - $callback($this); - $this->currentGroupPrefix = $previousGroupPrefix; - } - - /** - * Adds a GET route to the collection - * - * This is simply an alias of $this->addRoute('GET', $route, $handler) - * - * @param string $route - * @param mixed $handler - */ - public function get($route, $handler) - { - $this->addRoute('GET', $route, $handler); - } - - /** - * Adds a POST route to the collection - * - * This is simply an alias of $this->addRoute('POST', $route, $handler) - * - * @param string $route - * @param mixed $handler - */ - public function post($route, $handler) - { - $this->addRoute('POST', $route, $handler); - } - - /** - * Adds a PUT route to the collection - * - * This is simply an alias of $this->addRoute('PUT', $route, $handler) - * - * @param string $route - * @param mixed $handler - */ - public function put($route, $handler) - { - $this->addRoute('PUT', $route, $handler); - } - - /** - * Adds a DELETE route to the collection - * - * This is simply an alias of $this->addRoute('DELETE', $route, $handler) - * - * @param string $route - * @param mixed $handler - */ - public function delete($route, $handler) - { - $this->addRoute('DELETE', $route, $handler); - } - - /** - * Adds a PATCH route to the collection - * - * This is simply an alias of $this->addRoute('PATCH', $route, $handler) - * - * @param string $route - * @param mixed $handler - */ - public function patch($route, $handler) - { - $this->addRoute('PATCH', $route, $handler); - } - - /** - * Adds a HEAD route to the collection - * - * This is simply an alias of $this->addRoute('HEAD', $route, $handler) - * - * @param string $route - * @param mixed $handler - */ - public function head($route, $handler) - { - $this->addRoute('HEAD', $route, $handler); - } - - /** - * Returns the collected route data, as provided by the data generator. - * - * @return array - */ - public function getData() - { - return $this->dataGenerator->getData(); - } -} diff --git a/system/vendor/nikic/fast-route/src/RouteParser.php b/system/vendor/nikic/fast-route/src/RouteParser.php deleted file mode 100644 index 6a7685c..0000000 --- a/system/vendor/nikic/fast-route/src/RouteParser.php +++ /dev/null @@ -1,37 +0,0 @@ - $segment) { - if ($segment === '' && $n !== 0) { - throw new BadRouteException('Empty optional part'); - } - - $currentRoute .= $segment; - $routeDatas[] = $this->parsePlaceholders($currentRoute); - } - return $routeDatas; - } - - /** - * Parses a route string that does not contain optional segments. - * - * @param string - * @return mixed[] - */ - private function parsePlaceholders($route) - { - if (!preg_match_all( - '~' . self::VARIABLE_REGEX . '~x', $route, $matches, - PREG_OFFSET_CAPTURE | PREG_SET_ORDER - )) { - return [$route]; - } - - $offset = 0; - $routeData = []; - foreach ($matches as $set) { - if ($set[0][1] > $offset) { - $routeData[] = substr($route, $offset, $set[0][1] - $offset); - } - $routeData[] = [ - $set[1][0], - isset($set[2]) ? trim($set[2][0]) : self::DEFAULT_DISPATCH_REGEX - ]; - $offset = $set[0][1] + strlen($set[0][0]); - } - - if ($offset !== strlen($route)) { - $routeData[] = substr($route, $offset); - } - - return $routeData; - } -} diff --git a/system/vendor/nikic/fast-route/src/bootstrap.php b/system/vendor/nikic/fast-route/src/bootstrap.php deleted file mode 100644 index 0bce3a4..0000000 --- a/system/vendor/nikic/fast-route/src/bootstrap.php +++ /dev/null @@ -1,12 +0,0 @@ - 'FastRoute\\RouteParser\\Std', - 'dataGenerator' => 'FastRoute\\DataGenerator\\GroupCountBased', - 'dispatcher' => 'FastRoute\\Dispatcher\\GroupCountBased', - 'routeCollector' => 'FastRoute\\RouteCollector', - ]; - - /** @var RouteCollector $routeCollector */ - $routeCollector = new $options['routeCollector']( - new $options['routeParser'], new $options['dataGenerator'] - ); - $routeDefinitionCallback($routeCollector); - - return new $options['dispatcher']($routeCollector->getData()); - } - - /** - * @param callable $routeDefinitionCallback - * @param array $options - * - * @return Dispatcher - */ - function cachedDispatcher(callable $routeDefinitionCallback, array $options = []) - { - $options += [ - 'routeParser' => 'FastRoute\\RouteParser\\Std', - 'dataGenerator' => 'FastRoute\\DataGenerator\\GroupCountBased', - 'dispatcher' => 'FastRoute\\Dispatcher\\GroupCountBased', - 'routeCollector' => 'FastRoute\\RouteCollector', - 'cacheDisabled' => false, - ]; - - if (!isset($options['cacheFile'])) { - throw new \LogicException('Must specify "cacheFile" option'); - } - - if (!$options['cacheDisabled'] && file_exists($options['cacheFile'])) { - $dispatchData = require $options['cacheFile']; - if (!is_array($dispatchData)) { - throw new \RuntimeException('Invalid cache file "' . $options['cacheFile'] . '"'); - } - return new $options['dispatcher']($dispatchData); - } - - $routeCollector = new $options['routeCollector']( - new $options['routeParser'], new $options['dataGenerator'] - ); - $routeDefinitionCallback($routeCollector); - - /** @var RouteCollector $routeCollector */ - $dispatchData = $routeCollector->getData(); - if (!$options['cacheDisabled']) { - file_put_contents( - $options['cacheFile'], - ' $this->getDataGeneratorClass(), - 'dispatcher' => $this->getDispatcherClass() - ]; - } - - /** - * @dataProvider provideFoundDispatchCases - */ - public function testFoundDispatches($method, $uri, $callback, $handler, $argDict) - { - $dispatcher = \FastRoute\simpleDispatcher($callback, $this->generateDispatcherOptions()); - $info = $dispatcher->dispatch($method, $uri); - $this->assertSame($dispatcher::FOUND, $info[0]); - $this->assertSame($handler, $info[1]); - $this->assertSame($argDict, $info[2]); - } - - /** - * @dataProvider provideNotFoundDispatchCases - */ - public function testNotFoundDispatches($method, $uri, $callback) - { - $dispatcher = \FastRoute\simpleDispatcher($callback, $this->generateDispatcherOptions()); - $routeInfo = $dispatcher->dispatch($method, $uri); - $this->assertArrayNotHasKey(1, $routeInfo, - 'NOT_FOUND result must only contain a single element in the returned info array' - ); - $this->assertSame($dispatcher::NOT_FOUND, $routeInfo[0]); - } - - /** - * @dataProvider provideMethodNotAllowedDispatchCases - */ - public function testMethodNotAllowedDispatches($method, $uri, $callback, $availableMethods) - { - $dispatcher = \FastRoute\simpleDispatcher($callback, $this->generateDispatcherOptions()); - $routeInfo = $dispatcher->dispatch($method, $uri); - $this->assertArrayHasKey(1, $routeInfo, - 'METHOD_NOT_ALLOWED result must return an array of allowed methods at index 1' - ); - - list($routedStatus, $methodArray) = $dispatcher->dispatch($method, $uri); - $this->assertSame($dispatcher::METHOD_NOT_ALLOWED, $routedStatus); - $this->assertSame($availableMethods, $methodArray); - } - - /** - * @expectedException \FastRoute\BadRouteException - * @expectedExceptionMessage Cannot use the same placeholder "test" twice - */ - public function testDuplicateVariableNameError() - { - \FastRoute\simpleDispatcher(function (RouteCollector $r) { - $r->addRoute('GET', '/foo/{test}/{test:\d+}', 'handler0'); - }, $this->generateDispatcherOptions()); - } - - /** - * @expectedException \FastRoute\BadRouteException - * @expectedExceptionMessage Cannot register two routes matching "/user/([^/]+)" for method "GET" - */ - public function testDuplicateVariableRoute() - { - \FastRoute\simpleDispatcher(function (RouteCollector $r) { - $r->addRoute('GET', '/user/{id}', 'handler0'); // oops, forgot \d+ restriction ;) - $r->addRoute('GET', '/user/{name}', 'handler1'); - }, $this->generateDispatcherOptions()); - } - - /** - * @expectedException \FastRoute\BadRouteException - * @expectedExceptionMessage Cannot register two routes matching "/user" for method "GET" - */ - public function testDuplicateStaticRoute() - { - \FastRoute\simpleDispatcher(function (RouteCollector $r) { - $r->addRoute('GET', '/user', 'handler0'); - $r->addRoute('GET', '/user', 'handler1'); - }, $this->generateDispatcherOptions()); - } - - /** - * @expectedException \FastRoute\BadRouteException - * @expectedExceptionMessage Static route "/user/nikic" is shadowed by previously defined variable route "/user/([^/]+)" for method "GET" - */ - public function testShadowedStaticRoute() - { - \FastRoute\simpleDispatcher(function (RouteCollector $r) { - $r->addRoute('GET', '/user/{name}', 'handler0'); - $r->addRoute('GET', '/user/nikic', 'handler1'); - }, $this->generateDispatcherOptions()); - } - - /** - * @expectedException \FastRoute\BadRouteException - * @expectedExceptionMessage Regex "(en|de)" for parameter "lang" contains a capturing group - */ - public function testCapturing() - { - \FastRoute\simpleDispatcher(function (RouteCollector $r) { - $r->addRoute('GET', '/{lang:(en|de)}', 'handler0'); - }, $this->generateDispatcherOptions()); - } - - public function provideFoundDispatchCases() - { - $cases = []; - - // 0 --------------------------------------------------------------------------------------> - - $callback = function (RouteCollector $r) { - $r->addRoute('GET', '/resource/123/456', 'handler0'); - }; - - $method = 'GET'; - $uri = '/resource/123/456'; - $handler = 'handler0'; - $argDict = []; - - $cases[] = [$method, $uri, $callback, $handler, $argDict]; - - // 1 --------------------------------------------------------------------------------------> - - $callback = function (RouteCollector $r) { - $r->addRoute('GET', '/handler0', 'handler0'); - $r->addRoute('GET', '/handler1', 'handler1'); - $r->addRoute('GET', '/handler2', 'handler2'); - }; - - $method = 'GET'; - $uri = '/handler2'; - $handler = 'handler2'; - $argDict = []; - - $cases[] = [$method, $uri, $callback, $handler, $argDict]; - - // 2 --------------------------------------------------------------------------------------> - - $callback = function (RouteCollector $r) { - $r->addRoute('GET', '/user/{name}/{id:[0-9]+}', 'handler0'); - $r->addRoute('GET', '/user/{id:[0-9]+}', 'handler1'); - $r->addRoute('GET', '/user/{name}', 'handler2'); - }; - - $method = 'GET'; - $uri = '/user/rdlowrey'; - $handler = 'handler2'; - $argDict = ['name' => 'rdlowrey']; - - $cases[] = [$method, $uri, $callback, $handler, $argDict]; - - // 3 --------------------------------------------------------------------------------------> - - // reuse $callback from #2 - - $method = 'GET'; - $uri = '/user/12345'; - $handler = 'handler1'; - $argDict = ['id' => '12345']; - - $cases[] = [$method, $uri, $callback, $handler, $argDict]; - - // 4 --------------------------------------------------------------------------------------> - - // reuse $callback from #3 - - $method = 'GET'; - $uri = '/user/NaN'; - $handler = 'handler2'; - $argDict = ['name' => 'NaN']; - - $cases[] = [$method, $uri, $callback, $handler, $argDict]; - - // 5 --------------------------------------------------------------------------------------> - - // reuse $callback from #4 - - $method = 'GET'; - $uri = '/user/rdlowrey/12345'; - $handler = 'handler0'; - $argDict = ['name' => 'rdlowrey', 'id' => '12345']; - - $cases[] = [$method, $uri, $callback, $handler, $argDict]; - - // 6 --------------------------------------------------------------------------------------> - - $callback = function (RouteCollector $r) { - $r->addRoute('GET', '/user/{id:[0-9]+}', 'handler0'); - $r->addRoute('GET', '/user/12345/extension', 'handler1'); - $r->addRoute('GET', '/user/{id:[0-9]+}.{extension}', 'handler2'); - }; - - $method = 'GET'; - $uri = '/user/12345.svg'; - $handler = 'handler2'; - $argDict = ['id' => '12345', 'extension' => 'svg']; - - $cases[] = [$method, $uri, $callback, $handler, $argDict]; - - // 7 ----- Test GET method fallback on HEAD route miss ------------------------------------> - - $callback = function (RouteCollector $r) { - $r->addRoute('GET', '/user/{name}', 'handler0'); - $r->addRoute('GET', '/user/{name}/{id:[0-9]+}', 'handler1'); - $r->addRoute('GET', '/static0', 'handler2'); - $r->addRoute('GET', '/static1', 'handler3'); - $r->addRoute('HEAD', '/static1', 'handler4'); - }; - - $method = 'HEAD'; - $uri = '/user/rdlowrey'; - $handler = 'handler0'; - $argDict = ['name' => 'rdlowrey']; - - $cases[] = [$method, $uri, $callback, $handler, $argDict]; - - // 8 ----- Test GET method fallback on HEAD route miss ------------------------------------> - - // reuse $callback from #7 - - $method = 'HEAD'; - $uri = '/user/rdlowrey/1234'; - $handler = 'handler1'; - $argDict = ['name' => 'rdlowrey', 'id' => '1234']; - - $cases[] = [$method, $uri, $callback, $handler, $argDict]; - - // 9 ----- Test GET method fallback on HEAD route miss ------------------------------------> - - // reuse $callback from #8 - - $method = 'HEAD'; - $uri = '/static0'; - $handler = 'handler2'; - $argDict = []; - - $cases[] = [$method, $uri, $callback, $handler, $argDict]; - - // 10 ---- Test existing HEAD route used if available (no fallback) -----------------------> - - // reuse $callback from #9 - - $method = 'HEAD'; - $uri = '/static1'; - $handler = 'handler4'; - $argDict = []; - - $cases[] = [$method, $uri, $callback, $handler, $argDict]; - - // 11 ---- More specified routes are not shadowed by less specific of another method ------> - - $callback = function (RouteCollector $r) { - $r->addRoute('GET', '/user/{name}', 'handler0'); - $r->addRoute('POST', '/user/{name:[a-z]+}', 'handler1'); - }; - - $method = 'POST'; - $uri = '/user/rdlowrey'; - $handler = 'handler1'; - $argDict = ['name' => 'rdlowrey']; - - $cases[] = [$method, $uri, $callback, $handler, $argDict]; - - // 12 ---- Handler of more specific routes is used, if it occurs first --------------------> - - $callback = function (RouteCollector $r) { - $r->addRoute('GET', '/user/{name}', 'handler0'); - $r->addRoute('POST', '/user/{name:[a-z]+}', 'handler1'); - $r->addRoute('POST', '/user/{name}', 'handler2'); - }; - - $method = 'POST'; - $uri = '/user/rdlowrey'; - $handler = 'handler1'; - $argDict = ['name' => 'rdlowrey']; - - $cases[] = [$method, $uri, $callback, $handler, $argDict]; - - // 13 ---- Route with constant suffix -----------------------------------------------------> - - $callback = function (RouteCollector $r) { - $r->addRoute('GET', '/user/{name}', 'handler0'); - $r->addRoute('GET', '/user/{name}/edit', 'handler1'); - }; - - $method = 'GET'; - $uri = '/user/rdlowrey/edit'; - $handler = 'handler1'; - $argDict = ['name' => 'rdlowrey']; - - $cases[] = [$method, $uri, $callback, $handler, $argDict]; - - // 14 ---- Handle multiple methods with the same handler ----------------------------------> - - $callback = function (RouteCollector $r) { - $r->addRoute(['GET', 'POST'], '/user', 'handlerGetPost'); - $r->addRoute(['DELETE'], '/user', 'handlerDelete'); - $r->addRoute([], '/user', 'handlerNone'); - }; - - $argDict = []; - $cases[] = ['GET', '/user', $callback, 'handlerGetPost', $argDict]; - $cases[] = ['POST', '/user', $callback, 'handlerGetPost', $argDict]; - $cases[] = ['DELETE', '/user', $callback, 'handlerDelete', $argDict]; - - // 17 ---- - - $callback = function (RouteCollector $r) { - $r->addRoute('POST', '/user.json', 'handler0'); - $r->addRoute('GET', '/{entity}.json', 'handler1'); - }; - - $cases[] = ['GET', '/user.json', $callback, 'handler1', ['entity' => 'user']]; - - // 18 ---- - - $callback = function (RouteCollector $r) { - $r->addRoute('GET', '', 'handler0'); - }; - - $cases[] = ['GET', '', $callback, 'handler0', []]; - - // 19 ---- - - $callback = function (RouteCollector $r) { - $r->addRoute('HEAD', '/a/{foo}', 'handler0'); - $r->addRoute('GET', '/b/{foo}', 'handler1'); - }; - - $cases[] = ['HEAD', '/b/bar', $callback, 'handler1', ['foo' => 'bar']]; - - // 20 ---- - - $callback = function (RouteCollector $r) { - $r->addRoute('HEAD', '/a', 'handler0'); - $r->addRoute('GET', '/b', 'handler1'); - }; - - $cases[] = ['HEAD', '/b', $callback, 'handler1', []]; - - // 21 ---- - - $callback = function (RouteCollector $r) { - $r->addRoute('GET', '/foo', 'handler0'); - $r->addRoute('HEAD', '/{bar}', 'handler1'); - }; - - $cases[] = ['HEAD', '/foo', $callback, 'handler1', ['bar' => 'foo']]; - - // 22 ---- - - $callback = function (RouteCollector $r) { - $r->addRoute('*', '/user', 'handler0'); - $r->addRoute('*', '/{user}', 'handler1'); - $r->addRoute('GET', '/user', 'handler2'); - }; - - $cases[] = ['GET', '/user', $callback, 'handler2', []]; - - // 23 ---- - - $callback = function (RouteCollector $r) { - $r->addRoute('*', '/user', 'handler0'); - $r->addRoute('GET', '/user', 'handler1'); - }; - - $cases[] = ['POST', '/user', $callback, 'handler0', []]; - - // 24 ---- - - $cases[] = ['HEAD', '/user', $callback, 'handler1', []]; - - // 25 ---- - - $callback = function (RouteCollector $r) { - $r->addRoute('GET', '/{bar}', 'handler0'); - $r->addRoute('*', '/foo', 'handler1'); - }; - - $cases[] = ['GET', '/foo', $callback, 'handler0', ['bar' => 'foo']]; - - // 26 ---- - - $callback = function(RouteCollector $r) { - $r->addRoute('GET', '/user', 'handler0'); - $r->addRoute('*', '/{foo:.*}', 'handler1'); - }; - - $cases[] = ['POST', '/bar', $callback, 'handler1', ['foo' => 'bar']]; - - // x --------------------------------------------------------------------------------------> - - return $cases; - } - - public function provideNotFoundDispatchCases() - { - $cases = []; - - // 0 --------------------------------------------------------------------------------------> - - $callback = function (RouteCollector $r) { - $r->addRoute('GET', '/resource/123/456', 'handler0'); - }; - - $method = 'GET'; - $uri = '/not-found'; - - $cases[] = [$method, $uri, $callback]; - - // 1 --------------------------------------------------------------------------------------> - - // reuse callback from #0 - $method = 'POST'; - $uri = '/not-found'; - - $cases[] = [$method, $uri, $callback]; - - // 2 --------------------------------------------------------------------------------------> - - // reuse callback from #1 - $method = 'PUT'; - $uri = '/not-found'; - - $cases[] = [$method, $uri, $callback]; - - // 3 --------------------------------------------------------------------------------------> - - $callback = function (RouteCollector $r) { - $r->addRoute('GET', '/handler0', 'handler0'); - $r->addRoute('GET', '/handler1', 'handler1'); - $r->addRoute('GET', '/handler2', 'handler2'); - }; - - $method = 'GET'; - $uri = '/not-found'; - - $cases[] = [$method, $uri, $callback]; - - // 4 --------------------------------------------------------------------------------------> - - $callback = function (RouteCollector $r) { - $r->addRoute('GET', '/user/{name}/{id:[0-9]+}', 'handler0'); - $r->addRoute('GET', '/user/{id:[0-9]+}', 'handler1'); - $r->addRoute('GET', '/user/{name}', 'handler2'); - }; - - $method = 'GET'; - $uri = '/not-found'; - - $cases[] = [$method, $uri, $callback]; - - // 5 --------------------------------------------------------------------------------------> - - // reuse callback from #4 - $method = 'GET'; - $uri = '/user/rdlowrey/12345/not-found'; - - $cases[] = [$method, $uri, $callback]; - - // 6 --------------------------------------------------------------------------------------> - - // reuse callback from #5 - $method = 'HEAD'; - - $cases[] = [$method, $uri, $callback]; - - // x --------------------------------------------------------------------------------------> - - return $cases; - } - - public function provideMethodNotAllowedDispatchCases() - { - $cases = []; - - // 0 --------------------------------------------------------------------------------------> - - $callback = function (RouteCollector $r) { - $r->addRoute('GET', '/resource/123/456', 'handler0'); - }; - - $method = 'POST'; - $uri = '/resource/123/456'; - $allowedMethods = ['GET']; - - $cases[] = [$method, $uri, $callback, $allowedMethods]; - - // 1 --------------------------------------------------------------------------------------> - - $callback = function (RouteCollector $r) { - $r->addRoute('GET', '/resource/123/456', 'handler0'); - $r->addRoute('POST', '/resource/123/456', 'handler1'); - $r->addRoute('PUT', '/resource/123/456', 'handler2'); - $r->addRoute('*', '/', 'handler3'); - }; - - $method = 'DELETE'; - $uri = '/resource/123/456'; - $allowedMethods = ['GET', 'POST', 'PUT']; - - $cases[] = [$method, $uri, $callback, $allowedMethods]; - - // 2 --------------------------------------------------------------------------------------> - - $callback = function (RouteCollector $r) { - $r->addRoute('GET', '/user/{name}/{id:[0-9]+}', 'handler0'); - $r->addRoute('POST', '/user/{name}/{id:[0-9]+}', 'handler1'); - $r->addRoute('PUT', '/user/{name}/{id:[0-9]+}', 'handler2'); - $r->addRoute('PATCH', '/user/{name}/{id:[0-9]+}', 'handler3'); - }; - - $method = 'DELETE'; - $uri = '/user/rdlowrey/42'; - $allowedMethods = ['GET', 'POST', 'PUT', 'PATCH']; - - $cases[] = [$method, $uri, $callback, $allowedMethods]; - - // 3 --------------------------------------------------------------------------------------> - - $callback = function (RouteCollector $r) { - $r->addRoute('POST', '/user/{name}', 'handler1'); - $r->addRoute('PUT', '/user/{name:[a-z]+}', 'handler2'); - $r->addRoute('PATCH', '/user/{name:[a-z]+}', 'handler3'); - }; - - $method = 'GET'; - $uri = '/user/rdlowrey'; - $allowedMethods = ['POST', 'PUT', 'PATCH']; - - $cases[] = [$method, $uri, $callback, $allowedMethods]; - - // 4 --------------------------------------------------------------------------------------> - - $callback = function (RouteCollector $r) { - $r->addRoute(['GET', 'POST'], '/user', 'handlerGetPost'); - $r->addRoute(['DELETE'], '/user', 'handlerDelete'); - $r->addRoute([], '/user', 'handlerNone'); - }; - - $cases[] = ['PUT', '/user', $callback, ['GET', 'POST', 'DELETE']]; - - // 5 - - $callback = function (RouteCollector $r) { - $r->addRoute('POST', '/user.json', 'handler0'); - $r->addRoute('GET', '/{entity}.json', 'handler1'); - }; - - $cases[] = ['PUT', '/user.json', $callback, ['POST', 'GET']]; - - // x --------------------------------------------------------------------------------------> - - return $cases; - } -} diff --git a/system/vendor/nikic/fast-route/test/Dispatcher/GroupCountBasedTest.php b/system/vendor/nikic/fast-route/test/Dispatcher/GroupCountBasedTest.php deleted file mode 100644 index f821ef5..0000000 --- a/system/vendor/nikic/fast-route/test/Dispatcher/GroupCountBasedTest.php +++ /dev/null @@ -1,16 +0,0 @@ -markTestSkipped('PHP 5.6 required for MARK support'); - } - } - - protected function getDispatcherClass() - { - return 'FastRoute\\Dispatcher\\MarkBased'; - } - - protected function getDataGeneratorClass() - { - return 'FastRoute\\DataGenerator\\MarkBased'; - } -} diff --git a/system/vendor/nikic/fast-route/test/HackTypechecker/HackTypecheckerTest.php b/system/vendor/nikic/fast-route/test/HackTypechecker/HackTypecheckerTest.php deleted file mode 100644 index b6fc53f..0000000 --- a/system/vendor/nikic/fast-route/test/HackTypechecker/HackTypecheckerTest.php +++ /dev/null @@ -1,44 +0,0 @@ -markTestSkipped('HHVM only'); - } - if (!version_compare(HHVM_VERSION, '3.9.0', '>=')) { - $this->markTestSkipped('classname requires HHVM 3.9+'); - } - - // The typechecker recurses the whole tree, so it makes sure - // that everything in fixtures/ is valid when this runs. - - $output = []; - $exit_code = null; - exec( - 'hh_server --check ' . escapeshellarg(__DIR__ . '/../../') . ' 2>&1', - $output, - $exit_code - ); - if ($exit_code === self::SERVER_ALREADY_RUNNING_CODE) { - $this->assertTrue( - $recurse, - 'Typechecker still running after running hh_client stop' - ); - // Server already running - 3.10 => 3.11 regression: - // https://github.com/facebook/hhvm/issues/6646 - exec('hh_client stop 2>/dev/null'); - $this->testTypechecks(/* recurse = */ false); - return; - - } - $this->assertSame(0, $exit_code, implode("\n", $output)); - } -} diff --git a/system/vendor/nikic/fast-route/test/HackTypechecker/fixtures/all_options.php b/system/vendor/nikic/fast-route/test/HackTypechecker/fixtures/all_options.php deleted file mode 100644 index 05a9af2..0000000 --- a/system/vendor/nikic/fast-route/test/HackTypechecker/fixtures/all_options.php +++ /dev/null @@ -1,29 +0,0 @@ - {}, - shape( - 'routeParser' => \FastRoute\RouteParser\Std::class, - 'dataGenerator' => \FastRoute\DataGenerator\GroupCountBased::class, - 'dispatcher' => \FastRoute\Dispatcher\GroupCountBased::class, - 'routeCollector' => \FastRoute\RouteCollector::class, - ), - ); -} - -function all_options_cached(): \FastRoute\Dispatcher { - return \FastRoute\cachedDispatcher( - $collector ==> {}, - shape( - 'routeParser' => \FastRoute\RouteParser\Std::class, - 'dataGenerator' => \FastRoute\DataGenerator\GroupCountBased::class, - 'dispatcher' => \FastRoute\Dispatcher\GroupCountBased::class, - 'routeCollector' => \FastRoute\RouteCollector::class, - 'cacheFile' => '/dev/null', - 'cacheDisabled' => false, - ), - ); -} diff --git a/system/vendor/nikic/fast-route/test/HackTypechecker/fixtures/empty_options.php b/system/vendor/nikic/fast-route/test/HackTypechecker/fixtures/empty_options.php deleted file mode 100644 index 61eb541..0000000 --- a/system/vendor/nikic/fast-route/test/HackTypechecker/fixtures/empty_options.php +++ /dev/null @@ -1,11 +0,0 @@ - {}, shape()); -} - -function empty_options_cached(): \FastRoute\Dispatcher { - return \FastRoute\cachedDispatcher($collector ==> {}, shape()); -} diff --git a/system/vendor/nikic/fast-route/test/HackTypechecker/fixtures/no_options.php b/system/vendor/nikic/fast-route/test/HackTypechecker/fixtures/no_options.php deleted file mode 100644 index 44b5422..0000000 --- a/system/vendor/nikic/fast-route/test/HackTypechecker/fixtures/no_options.php +++ /dev/null @@ -1,11 +0,0 @@ - {}); -} - -function no_options_cached(): \FastRoute\Dispatcher { - return \FastRoute\cachedDispatcher($collector ==> {}); -} diff --git a/system/vendor/nikic/fast-route/test/RouteCollectorTest.php b/system/vendor/nikic/fast-route/test/RouteCollectorTest.php deleted file mode 100644 index cc54407..0000000 --- a/system/vendor/nikic/fast-route/test/RouteCollectorTest.php +++ /dev/null @@ -1,108 +0,0 @@ -delete('/delete', 'delete'); - $r->get('/get', 'get'); - $r->head('/head', 'head'); - $r->patch('/patch', 'patch'); - $r->post('/post', 'post'); - $r->put('/put', 'put'); - - $expected = [ - ['DELETE', '/delete', 'delete'], - ['GET', '/get', 'get'], - ['HEAD', '/head', 'head'], - ['PATCH', '/patch', 'patch'], - ['POST', '/post', 'post'], - ['PUT', '/put', 'put'], - ]; - - $this->assertSame($expected, $r->routes); - } - - public function testGroups() - { - $r = new DummyRouteCollector(); - - $r->delete('/delete', 'delete'); - $r->get('/get', 'get'); - $r->head('/head', 'head'); - $r->patch('/patch', 'patch'); - $r->post('/post', 'post'); - $r->put('/put', 'put'); - - $r->addGroup('/group-one', function (DummyRouteCollector $r) { - $r->delete('/delete', 'delete'); - $r->get('/get', 'get'); - $r->head('/head', 'head'); - $r->patch('/patch', 'patch'); - $r->post('/post', 'post'); - $r->put('/put', 'put'); - - $r->addGroup('/group-two', function (DummyRouteCollector $r) { - $r->delete('/delete', 'delete'); - $r->get('/get', 'get'); - $r->head('/head', 'head'); - $r->patch('/patch', 'patch'); - $r->post('/post', 'post'); - $r->put('/put', 'put'); - }); - }); - - $r->addGroup('/admin', function (DummyRouteCollector $r) { - $r->get('-some-info', 'admin-some-info'); - }); - $r->addGroup('/admin-', function (DummyRouteCollector $r) { - $r->get('more-info', 'admin-more-info'); - }); - - $expected = [ - ['DELETE', '/delete', 'delete'], - ['GET', '/get', 'get'], - ['HEAD', '/head', 'head'], - ['PATCH', '/patch', 'patch'], - ['POST', '/post', 'post'], - ['PUT', '/put', 'put'], - ['DELETE', '/group-one/delete', 'delete'], - ['GET', '/group-one/get', 'get'], - ['HEAD', '/group-one/head', 'head'], - ['PATCH', '/group-one/patch', 'patch'], - ['POST', '/group-one/post', 'post'], - ['PUT', '/group-one/put', 'put'], - ['DELETE', '/group-one/group-two/delete', 'delete'], - ['GET', '/group-one/group-two/get', 'get'], - ['HEAD', '/group-one/group-two/head', 'head'], - ['PATCH', '/group-one/group-two/patch', 'patch'], - ['POST', '/group-one/group-two/post', 'post'], - ['PUT', '/group-one/group-two/put', 'put'], - ['GET', '/admin-some-info', 'admin-some-info'], - ['GET', '/admin-more-info', 'admin-more-info'], - ]; - - $this->assertSame($expected, $r->routes); - } -} - -class DummyRouteCollector extends RouteCollector -{ - public $routes = []; - - public function __construct() - { - } - - public function addRoute($method, $route, $handler) - { - $route = $this->currentGroupPrefix . $route; - $this->routes[] = [$method, $route, $handler]; - } -} diff --git a/system/vendor/nikic/fast-route/test/RouteParser/StdTest.php b/system/vendor/nikic/fast-route/test/RouteParser/StdTest.php deleted file mode 100644 index e13e4de..0000000 --- a/system/vendor/nikic/fast-route/test/RouteParser/StdTest.php +++ /dev/null @@ -1,154 +0,0 @@ -parse($routeString); - $this->assertSame($expectedRouteDatas, $routeDatas); - } - - /** @dataProvider provideTestParseError */ - public function testParseError($routeString, $expectedExceptionMessage) - { - $parser = new Std(); - $this->setExpectedException('FastRoute\\BadRouteException', $expectedExceptionMessage); - $parser->parse($routeString); - } - - public function provideTestParse() - { - return [ - [ - '/test', - [ - ['/test'], - ] - ], - [ - '/test/{param}', - [ - ['/test/', ['param', '[^/]+']], - ] - ], - [ - '/te{ param }st', - [ - ['/te', ['param', '[^/]+'], 'st'] - ] - ], - [ - '/test/{param1}/test2/{param2}', - [ - ['/test/', ['param1', '[^/]+'], '/test2/', ['param2', '[^/]+']] - ] - ], - [ - '/test/{param:\d+}', - [ - ['/test/', ['param', '\d+']] - ] - ], - [ - '/test/{ param : \d{1,9} }', - [ - ['/test/', ['param', '\d{1,9}']] - ] - ], - [ - '/test[opt]', - [ - ['/test'], - ['/testopt'], - ] - ], - [ - '/test[/{param}]', - [ - ['/test'], - ['/test/', ['param', '[^/]+']], - ] - ], - [ - '/{param}[opt]', - [ - ['/', ['param', '[^/]+']], - ['/', ['param', '[^/]+'], 'opt'] - ] - ], - [ - '/test[/{name}[/{id:[0-9]+}]]', - [ - ['/test'], - ['/test/', ['name', '[^/]+']], - ['/test/', ['name', '[^/]+'], '/', ['id', '[0-9]+']], - ] - ], - [ - '', - [ - [''], - ] - ], - [ - '[test]', - [ - [''], - ['test'], - ] - ], - [ - '/{foo-bar}', - [ - ['/', ['foo-bar', '[^/]+']] - ] - ], - [ - '/{_foo:.*}', - [ - ['/', ['_foo', '.*']] - ] - ], - ]; - } - - public function provideTestParseError() - { - return [ - [ - '/test[opt', - "Number of opening '[' and closing ']' does not match" - ], - [ - '/test[opt[opt2]', - "Number of opening '[' and closing ']' does not match" - ], - [ - '/testopt]', - "Number of opening '[' and closing ']' does not match" - ], - [ - '/test[]', - 'Empty optional part' - ], - [ - '/test[[opt]]', - 'Empty optional part' - ], - [ - '[[test]]', - 'Empty optional part' - ], - [ - '/test[/opt]/required', - 'Optional segments can only occur at the end of a route' - ], - ]; - } -} diff --git a/system/vendor/nikic/fast-route/test/bootstrap.php b/system/vendor/nikic/fast-route/test/bootstrap.php deleted file mode 100644 index 3023f41..0000000 --- a/system/vendor/nikic/fast-route/test/bootstrap.php +++ /dev/null @@ -1,11 +0,0 @@ -get('/project/{project}/issue/{issue}', function ($project, $issue) { - // ... -}); -``` - -Or this command defined with [Silly](https://github.com/mnapoli/silly#usage): - -```php -$app->command('greet [name] [--yell]', function ($name, $yell) { - // ... -}); -``` - -Same pattern in [Slim](https://www.slimframework.com): - -```php -$app->get('/hello/:name', function ($name) { - // ... -}); -``` - -You get the point. These frameworks invoke the controller/command/handler using something akin to named parameters: whatever the order of the parameters, they are matched by their name. - -**This library allows to invoke callables with named parameters in a generic and extensible way.** - -### Dependency injection - -Anyone familiar with AngularJS is familiar with how dependency injection is performed: - -```js -angular.controller('MyController', ['dep1', 'dep2', function(dep1, dep2) { - // ... -}]); -``` - -In PHP we find this pattern again in some frameworks and DI containers with partial to full support. For example in Silex you can type-hint the application to get it injected, but it only works with `Silex\Application`: - -```php -$app->get('/hello/{name}', function (Silex\Application $app, $name) { - // ... -}); -``` - -In Silly, it only works with `OutputInterface` to inject the application output: - -```php -$app->command('greet [name]', function ($name, OutputInterface $output) { - // ... -}); -``` - -[PHP-DI](https://php-di.org/doc/container.html) provides a way to invoke a callable and resolve all dependencies from the container using type-hints: - -```php -$container->call(function (Logger $logger, EntityManager $em) { - // ... -}); -``` - -**This library provides clear extension points to let frameworks implement any kind of dependency injection support they want.** - -### TL/DR - -In short, this library is meant to be a base building block for calling a function with named parameters and/or dependency injection. - -## Installation - -```sh -$ composer require PHP-DI/invoker -``` - -## Usage - -### Default behavior - -By default the `Invoker` can call using named parameters: - -```php -$invoker = new Invoker\Invoker; - -$invoker->call(function () { - echo 'Hello world!'; -}); - -// Simple parameter array -$invoker->call(function ($name) { - echo 'Hello ' . $name; -}, ['John']); - -// Named parameters -$invoker->call(function ($name) { - echo 'Hello ' . $name; -}, [ - 'name' => 'John' -]); - -// Use the default value -$invoker->call(function ($name = 'world') { - echo 'Hello ' . $name; -}); - -// Invoke any PHP callable -$invoker->call(['MyClass', 'myStaticMethod']); - -// Using Class::method syntax -$invoker->call('MyClass::myStaticMethod'); -``` - -Dependency injection in parameters is supported but needs to be configured with your container. Read on or jump to [*Built-in support for dependency injection*](#built-in-support-for-dependency-injection) if you are impatient. - -Additionally, callables can also be resolved from your container. Read on or jump to [*Resolving callables from a container*](#resolving-callables-from-a-container) if you are impatient. - -### Parameter resolvers - -Extending the behavior of the `Invoker` is easy and is done by implementing a [`ParameterResolver`](https://github.com/PHP-DI/Invoker/blob/master/src/ParameterResolver/ParameterResolver.php). - -This is explained in details the [Parameter resolvers documentation](doc/parameter-resolvers.md). - -#### Built-in support for dependency injection - -Rather than have you re-implement support for dependency injection with different containers every time, this package ships with 2 optional resolvers: - -- [`TypeHintContainerResolver`](https://github.com/PHP-DI/Invoker/blob/master/src/ParameterResolver/Container/TypeHintContainerResolver.php) - - This resolver will inject container entries by searching for the class name using the type-hint: - - ```php - $invoker->call(function (Psr\Logger\LoggerInterface $logger) { - // ... - }); - ``` - - In this example it will `->get('Psr\Logger\LoggerInterface')` from the container and inject it. - - This resolver is only useful if you store objects in your container using the class (or interface) name. Silex or Symfony for example store services under a custom name (e.g. `twig`, `db`, etc.) instead of the class name: in that case use the resolver shown below. - -- [`ParameterNameContainerResolver`](https://github.com/PHP-DI/Invoker/blob/master/src/ParameterResolver/Container/ParameterNameContainerResolver.php) - - This resolver will inject container entries by searching for the name of the parameter: - - ```php - $invoker->call(function ($twig) { - // ... - }); - ``` - - In this example it will `->get('twig')` from the container and inject it. - -These resolvers can work with any dependency injection container compliant with [PSR-11](http://www.php-fig.org/psr/psr-11/). - -Setting up those resolvers is simple: - -```php -// $container must be an instance of Psr\Container\ContainerInterface -$container = ... - -$containerResolver = new TypeHintContainerResolver($container); -// or -$containerResolver = new ParameterNameContainerResolver($container); - -$invoker = new Invoker\Invoker; -// Register it before all the other parameter resolvers -$invoker->getParameterResolver()->prependResolver($containerResolver); -``` - -You can also register both resolvers at the same time if you wish by prepending both. Implementing support for more tricky things is easy and up to you! - -### Resolving callables from a container - -The `Invoker` can be wired to your DI container to resolve the callables. - -For example with an invokable class: - -```php -class MyHandler -{ - public function __invoke() - { - // ... - } -} - -// By default this doesn't work: an instance of the class should be provided -$invoker->call('MyHandler'); - -// If we set up the container to use -$invoker = new Invoker\Invoker(null, $container); -// Now 'MyHandler' is resolved using the container! -$invoker->call('MyHandler'); -``` - -The same works for a class method: - -```php -class WelcomeController -{ - public function home() - { - // ... - } -} - -// By default this doesn't work: home() is not a static method -$invoker->call(['WelcomeController', 'home']); - -// If we set up the container to use -$invoker = new Invoker\Invoker(null, $container); -// Now 'WelcomeController' is resolved using the container! -$invoker->call(['WelcomeController', 'home']); -// Alternatively we can use the Class::method syntax -$invoker->call('WelcomeController::home'); -``` - -That feature can be used as the base building block for a framework's dispatcher. - -Again, any [PSR-11](https://www.php-fig.org/psr/psr-11/) compliant container can be provided. diff --git a/system/vendor/php-di/invoker/composer.json b/system/vendor/php-di/invoker/composer.json deleted file mode 100644 index e78e406..0000000 --- a/system/vendor/php-di/invoker/composer.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "php-di/invoker", - "description": "Generic and extensible callable invoker", - "keywords": ["invoker", "dependency-injection", "dependency", "injection", "callable", "invoke"], - "homepage": "https://github.com/PHP-DI/Invoker", - "license": "MIT", - "type": "library", - "autoload": { - "psr-4": { - "Invoker\\": "src/" - } - }, - "autoload-dev": { - "psr-4": { - "Invoker\\Test\\": "tests/" - } - }, - "require": { - "php": ">=7.3", - "psr/container": "^1.0|^2.0" - }, - "require-dev": { - "phpunit/phpunit": "^9.0", - "athletic/athletic": "~0.1.8", - "mnapoli/hard-mode": "~0.3.0" - } -} diff --git a/system/vendor/php-di/invoker/src/CallableResolver.php b/system/vendor/php-di/invoker/src/CallableResolver.php deleted file mode 100644 index e3b11b2..0000000 --- a/system/vendor/php-di/invoker/src/CallableResolver.php +++ /dev/null @@ -1,124 +0,0 @@ -container = $container; - } - - /** - * Resolve the given callable into a real PHP callable. - * - * @param callable|string|array $callable - * @return callable Real PHP callable. - * @throws NotCallableException|ReflectionException - */ - public function resolve($callable): callable - { - if (is_string($callable) && strpos($callable, '::') !== false) { - $callable = explode('::', $callable, 2); - } - - $callable = $this->resolveFromContainer($callable); - - if (! is_callable($callable)) { - throw NotCallableException::fromInvalidCallable($callable, true); - } - - return $callable; - } - - /** - * @param callable|string|array $callable - * @return callable|mixed - * @throws NotCallableException|ReflectionException - */ - private function resolveFromContainer($callable) - { - // Shortcut for a very common use case - if ($callable instanceof Closure) { - return $callable; - } - - // If it's already a callable there is nothing to do - if (is_callable($callable)) { - // TODO with PHP 8 that should not be necessary to check this anymore - if (! $this->isStaticCallToNonStaticMethod($callable)) { - return $callable; - } - } - - // The callable is a container entry name - if (is_string($callable)) { - try { - return $this->container->get($callable); - } catch (NotFoundExceptionInterface $e) { - if ($this->container->has($callable)) { - throw $e; - } - throw NotCallableException::fromInvalidCallable($callable, true); - } - } - - // The callable is an array whose first item is a container entry name - // e.g. ['some-container-entry', 'methodToCall'] - if (is_array($callable) && is_string($callable[0])) { - try { - // Replace the container entry name by the actual object - $callable[0] = $this->container->get($callable[0]); - return $callable; - } catch (NotFoundExceptionInterface $e) { - if ($this->container->has($callable[0])) { - throw $e; - } - throw new NotCallableException(sprintf( - 'Cannot call %s() on %s because it is not a class nor a valid container entry', - $callable[1], - $callable[0] - )); - } - } - - // Unrecognized stuff, we let it fail later - return $callable; - } - - /** - * Check if the callable represents a static call to a non-static method. - * - * @param mixed $callable - * @throws ReflectionException - */ - private function isStaticCallToNonStaticMethod($callable): bool - { - if (is_array($callable) && is_string($callable[0])) { - [$class, $method] = $callable; - - if (! method_exists($class, $method)) { - return false; - } - - $reflection = new ReflectionMethod($class, $method); - - return ! $reflection->isStatic(); - } - - return false; - } -} diff --git a/system/vendor/php-di/invoker/src/Exception/InvocationException.php b/system/vendor/php-di/invoker/src/Exception/InvocationException.php deleted file mode 100644 index 90f6585..0000000 --- a/system/vendor/php-di/invoker/src/Exception/InvocationException.php +++ /dev/null @@ -1,10 +0,0 @@ -parameterResolver = $parameterResolver ?: $this->createParameterResolver(); - $this->container = $container; - - if ($container) { - $this->callableResolver = new CallableResolver($container); - } - } - - /** - * {@inheritdoc} - */ - public function call($callable, array $parameters = []) - { - if ($this->callableResolver) { - $callable = $this->callableResolver->resolve($callable); - } - - if (! is_callable($callable)) { - throw new NotCallableException(sprintf( - '%s is not a callable', - is_object($callable) ? 'Instance of ' . get_class($callable) : var_export($callable, true) - )); - } - - $callableReflection = CallableReflection::create($callable); - - $args = $this->parameterResolver->getParameters($callableReflection, $parameters, []); - - // Sort by array key because call_user_func_array ignores numeric keys - ksort($args); - - // Check all parameters are resolved - $diff = array_diff_key($callableReflection->getParameters(), $args); - $parameter = reset($diff); - if ($parameter && \assert($parameter instanceof ReflectionParameter) && ! $parameter->isVariadic()) { - throw new NotEnoughParametersException(sprintf( - 'Unable to invoke the callable because no value was given for parameter %d ($%s)', - $parameter->getPosition() + 1, - $parameter->name - )); - } - - return call_user_func_array($callable, $args); - } - - /** - * Create the default parameter resolver. - */ - private function createParameterResolver(): ParameterResolver - { - return new ResolverChain([ - new NumericArrayResolver, - new AssociativeArrayResolver, - new DefaultValueResolver, - ]); - } - - /** - * @return ParameterResolver By default it's a ResolverChain - */ - public function getParameterResolver(): ParameterResolver - { - return $this->parameterResolver; - } - - public function getContainer(): ?ContainerInterface - { - return $this->container; - } - - /** - * @return CallableResolver|null Returns null if no container was given in the constructor. - */ - public function getCallableResolver(): ?CallableResolver - { - return $this->callableResolver; - } -} diff --git a/system/vendor/php-di/invoker/src/InvokerInterface.php b/system/vendor/php-di/invoker/src/InvokerInterface.php deleted file mode 100644 index 06f0064..0000000 --- a/system/vendor/php-di/invoker/src/InvokerInterface.php +++ /dev/null @@ -1,25 +0,0 @@ -call($callable, ['foo' => 'bar'])` will inject the string `'bar'` - * in the parameter named `$foo`. - * - * Parameters that are not indexed by a string are ignored. - */ -class AssociativeArrayResolver implements ParameterResolver -{ - public function getParameters( - ReflectionFunctionAbstract $reflection, - array $providedParameters, - array $resolvedParameters - ): array { - $parameters = $reflection->getParameters(); - - // Skip parameters already resolved - if (! empty($resolvedParameters)) { - $parameters = array_diff_key($parameters, $resolvedParameters); - } - - foreach ($parameters as $index => $parameter) { - if (array_key_exists($parameter->name, $providedParameters)) { - $resolvedParameters[$index] = $providedParameters[$parameter->name]; - } - } - - return $resolvedParameters; - } -} diff --git a/system/vendor/php-di/invoker/src/ParameterResolver/Container/ParameterNameContainerResolver.php b/system/vendor/php-di/invoker/src/ParameterResolver/Container/ParameterNameContainerResolver.php deleted file mode 100644 index 126e14c..0000000 --- a/system/vendor/php-di/invoker/src/ParameterResolver/Container/ParameterNameContainerResolver.php +++ /dev/null @@ -1,47 +0,0 @@ -container = $container; - } - - public function getParameters( - ReflectionFunctionAbstract $reflection, - array $providedParameters, - array $resolvedParameters - ): array { - $parameters = $reflection->getParameters(); - - // Skip parameters already resolved - if (! empty($resolvedParameters)) { - $parameters = array_diff_key($parameters, $resolvedParameters); - } - - foreach ($parameters as $index => $parameter) { - $name = $parameter->name; - - if ($name && $this->container->has($name)) { - $resolvedParameters[$index] = $this->container->get($name); - } - } - - return $resolvedParameters; - } -} diff --git a/system/vendor/php-di/invoker/src/ParameterResolver/Container/TypeHintContainerResolver.php b/system/vendor/php-di/invoker/src/ParameterResolver/Container/TypeHintContainerResolver.php deleted file mode 100644 index 014956e..0000000 --- a/system/vendor/php-di/invoker/src/ParameterResolver/Container/TypeHintContainerResolver.php +++ /dev/null @@ -1,65 +0,0 @@ -container = $container; - } - - public function getParameters( - ReflectionFunctionAbstract $reflection, - array $providedParameters, - array $resolvedParameters - ): array { - $parameters = $reflection->getParameters(); - - // Skip parameters already resolved - if (! empty($resolvedParameters)) { - $parameters = array_diff_key($parameters, $resolvedParameters); - } - - foreach ($parameters as $index => $parameter) { - $parameterType = $parameter->getType(); - if (! $parameterType) { - // No type - continue; - } - if (! $parameterType instanceof ReflectionNamedType) { - // Union types are not supported - continue; - } - if ($parameterType->isBuiltin()) { - // Primitive types are not supported - continue; - } - - $parameterClass = $parameterType->getName(); - if ($parameterClass === 'self') { - $parameterClass = $parameter->getDeclaringClass()->getName(); - } - - if ($this->container->has($parameterClass)) { - $resolvedParameters[$index] = $this->container->get($parameterClass); - } - } - - return $resolvedParameters; - } -} diff --git a/system/vendor/php-di/invoker/src/ParameterResolver/DefaultValueResolver.php b/system/vendor/php-di/invoker/src/ParameterResolver/DefaultValueResolver.php deleted file mode 100644 index 3fdf7b7..0000000 --- a/system/vendor/php-di/invoker/src/ParameterResolver/DefaultValueResolver.php +++ /dev/null @@ -1,43 +0,0 @@ -getParameters(); - - // Skip parameters already resolved - if (! empty($resolvedParameters)) { - $parameters = array_diff_key($parameters, $resolvedParameters); - } - - foreach ($parameters as $index => $parameter) { - \assert($parameter instanceof \ReflectionParameter); - if ($parameter->isDefaultValueAvailable()) { - try { - $resolvedParameters[$index] = $parameter->getDefaultValue(); - } catch (ReflectionException $e) { - // Can't get default values from PHP internal classes and functions - } - } else { - $parameterType = $parameter->getType(); - if ($parameterType && $parameterType->allowsNull()) { - $resolvedParameters[$index] = null; - } - } - } - - return $resolvedParameters; - } -} diff --git a/system/vendor/php-di/invoker/src/ParameterResolver/NumericArrayResolver.php b/system/vendor/php-di/invoker/src/ParameterResolver/NumericArrayResolver.php deleted file mode 100644 index 07d8ece..0000000 --- a/system/vendor/php-di/invoker/src/ParameterResolver/NumericArrayResolver.php +++ /dev/null @@ -1,37 +0,0 @@ -call($callable, ['foo', 'bar'])` will simply resolve the parameters - * to `['foo', 'bar']`. - * - * Parameters that are not indexed by a number (i.e. parameter position) - * will be ignored. - */ -class NumericArrayResolver implements ParameterResolver -{ - public function getParameters( - ReflectionFunctionAbstract $reflection, - array $providedParameters, - array $resolvedParameters - ): array { - // Skip parameters already resolved - if (! empty($resolvedParameters)) { - $providedParameters = array_diff_key($providedParameters, $resolvedParameters); - } - - foreach ($providedParameters as $key => $value) { - if (is_int($key)) { - $resolvedParameters[$key] = $value; - } - } - - return $resolvedParameters; - } -} diff --git a/system/vendor/php-di/invoker/src/ParameterResolver/ParameterResolver.php b/system/vendor/php-di/invoker/src/ParameterResolver/ParameterResolver.php deleted file mode 100644 index 85046c3..0000000 --- a/system/vendor/php-di/invoker/src/ParameterResolver/ParameterResolver.php +++ /dev/null @@ -1,30 +0,0 @@ -resolvers = $resolvers; - } - - public function getParameters( - ReflectionFunctionAbstract $reflection, - array $providedParameters, - array $resolvedParameters - ): array { - $reflectionParameters = $reflection->getParameters(); - - foreach ($this->resolvers as $resolver) { - $resolvedParameters = $resolver->getParameters( - $reflection, - $providedParameters, - $resolvedParameters - ); - - $diff = array_diff_key($reflectionParameters, $resolvedParameters); - if (empty($diff)) { - // Stop traversing: all parameters are resolved - return $resolvedParameters; - } - } - - return $resolvedParameters; - } - - /** - * Push a parameter resolver after the ones already registered. - */ - public function appendResolver(ParameterResolver $resolver): void - { - $this->resolvers[] = $resolver; - } - - /** - * Insert a parameter resolver before the ones already registered. - */ - public function prependResolver(ParameterResolver $resolver): void - { - array_unshift($this->resolvers, $resolver); - } -} diff --git a/system/vendor/php-di/invoker/src/ParameterResolver/TypeHintResolver.php b/system/vendor/php-di/invoker/src/ParameterResolver/TypeHintResolver.php deleted file mode 100644 index 3ccc2e0..0000000 --- a/system/vendor/php-di/invoker/src/ParameterResolver/TypeHintResolver.php +++ /dev/null @@ -1,54 +0,0 @@ -getParameters(); - - // Skip parameters already resolved - if (! empty($resolvedParameters)) { - $parameters = array_diff_key($parameters, $resolvedParameters); - } - - foreach ($parameters as $index => $parameter) { - $parameterType = $parameter->getType(); - if (! $parameterType) { - // No type - continue; - } - if (! $parameterType instanceof ReflectionNamedType) { - // Union types are not supported - continue; - } - if ($parameterType->isBuiltin()) { - // Primitive types are not supported - continue; - } - - $parameterClass = $parameterType->getName(); - if ($parameterClass === 'self') { - $parameterClass = $parameter->getDeclaringClass()->getName(); - } - - if (array_key_exists($parameterClass, $providedParameters)) { - $resolvedParameters[$index] = $providedParameters[$parameterClass]; - } - } - - return $resolvedParameters; - } -} diff --git a/system/vendor/php-di/invoker/src/Reflection/CallableReflection.php b/system/vendor/php-di/invoker/src/Reflection/CallableReflection.php deleted file mode 100644 index 3f19f33..0000000 --- a/system/vendor/php-di/invoker/src/Reflection/CallableReflection.php +++ /dev/null @@ -1,56 +0,0 @@ - DI\factory(function ($host) {...}) - ->parameter('host', DI\get('db.host')), - ]; - ``` - Read the [factories documentation](https://php-di.org/doc/php-definitions.html#factories) to learn more. Feature implemented by [@predakanga](https://github.com/predakanga). - -Improvements: - -- [#429](https://github.com/PHP-DI/PHP-DI/pull/429): performance improvements in definition resolution (by [@mnapoli](https://github.com/mnapoli)) -- [#421](https://github.com/PHP-DI/PHP-DI/issues/421): once a `ContainerBuilder` has built a container, it is locked to prevent confusion when adding new definitions to it (by [@mnapoli](https://github.com/mnapoli)) -- [#423](https://github.com/PHP-DI/PHP-DI/pull/423): improved exception messages (by [@mnapoli](https://github.com/mnapoli)) - -## 5.3 - -Read the [news entry](news/19-php-di-5-3-released.md). - -- release of the [2.0 version](https://github.com/PHP-DI/Symfony-Bridge/releases/tag/2.0.0) of the Symfony bridge (by [@mnapoli](https://github.com/mnapoli)) -- PHP 5.5 or above is now required -- a lot of documentation improvements by 9 different contributors -- [#389](https://github.com/PHP-DI/PHP-DI/pull/389): exception message improvement by [@mopahle](https://github.com/mopahle) -- [#359](https://github.com/PHP-DI/PHP-DI/issues/359), [#411](https://github.com/PHP-DI/PHP-DI/issues/411), [#414](https://github.com/PHP-DI/PHP-DI/pull/414), [#412](https://github.com/PHP-DI/PHP-DI/pull/412): compatibility with ProxyManager 1.* and 2.* (by [@holtkamp](https://github.com/holtkamp) and [@mnapoli](https://github.com/mnapoli)) -- [#416](https://github.com/PHP-DI/PHP-DI/pull/416): dumping definitions was refactored into a more lightweight and simple solution; definition "dumpers" have been removed (internal classes), definitions can now be cast to string directly (by [@mnapoli](https://github.com/mnapoli)) - -## 5.2 - -Read the [news entry](news/17-php-di-5-2-released.md). - -Improvements: - -- [#347](https://github.com/PHP-DI/PHP-DI/pull/347) (includes [#333](https://github.com/PHP-DI/PHP-DI/pull/333) and [#345](https://github.com/PHP-DI/PHP-DI/pull/345)): by [@jdreesen](https://github.com/jdreesen), [@quimcalpe](https://github.com/quimcalpe) and [@mnapoli](https://github.com/mnapoli) - - Allow injection of any container object as factory parameter via type hinting - - Allow injection of a `DI\Factory\RequestedEntry` object to get the requested entry name -- [#272](https://github.com/PHP-DI/PHP-DI/issues/272): Support `"Class::method""` syntax for callables (by [@jdreesen](https://github.com/jdreesen)) -- [#332](https://github.com/PHP-DI/PHP-DI/issues/332): IDE support (plugin and documentation) (by [@pulyaevskiy](https://github.com/pulyaevskiy), [@avant1](https://github.com/avant1) and [@mnapoli](https://github.com/mnapoli)) -- [#326](https://github.com/PHP-DI/PHP-DI/pull/326): Exception messages are simpler and more consistent (by [@mnapoli](https://github.com/mnapoli)) -- [#325](https://github.com/PHP-DI/PHP-DI/pull/325): Add a "Edit this page" button in the website to encourage users to improve the documentation (by [@jdreesen](https://github.com/jdreesen)) - -Bugfixes: - -- [#321](https://github.com/PHP-DI/PHP-DI/pull/321): Allow factory definitions to reference arbitrary container entries as callables (by [@jdreesen](https://github.com/jdreesen)) -- [#335](https://github.com/PHP-DI/PHP-DI/issues/335): Class imports in traits are now considered when parsing annotations (by [@thebigb](https://github.com/thebigb)) - -## 5.1 - -Read the [news entry](news/16-php-di-5-1-released.md). - -Improvements: - -- [Zend Framework 2 integration](https://github.com/PHP-DI/ZF2-Bridge) (by @Rastusik) -- [#308](https://github.com/PHP-DI/PHP-DI/pull/308): Instantiate factories using the container (`DI\factory(['FooFactory', 'create'])`) -- Many performances improvements - some benchmarks show up to 35% performance improvements, real results may vary of course -- Many documentation improvements (@jdreesen, @mindplay-dk, @mnapoli, @holtkamp, @Rastusik) -- [#296](https://github.com/PHP-DI/PHP-DI/issues/296): Provide a faster `ArrayCache` implementation, mostly useful in micro-benchmarks - -Bugfixes: - -- [#257](https://github.com/PHP-DI/PHP-DI/issues/257) & [#274](https://github.com/PHP-DI/PHP-DI/issues/274): Private properties of parent classes are not injected when using annotations -- [#300](https://github.com/PHP-DI/PHP-DI/pull/300): Exception if object definition extends an incompatible definition -- [#306](https://github.com/PHP-DI/PHP-DI/issues/306): Errors when using parameters passed by reference (fixed by @bradynpoulsen) -- [#318](https://github.com/PHP-DI/PHP-DI/issues/318): `Container::call()` ignores parameter's default value - -Internal changes: - -- [#276](https://github.com/PHP-DI/PHP-DI/pull/276): Tests now pass on Windows (@bgaillard) - -## 5.0 - -This is the complete change log. You can also read the [migration guide](doc/migration/5.0.md) for upgrading, or [the news article](news/15-php-di-5-0-released.md) for a nicer introduction to this new version. - -Improvements: - -- Moved to an organization on GitHub: [github.com/PHP-DI/PHP-DI](https://github.com/PHP-DI/PHP-DI) -- The package has been renamed to: from `mnapoli/php-di` to [`php-di/php-di`](https://packagist.org/packages/php-di/php-di) -- New [Silex integration](doc/frameworks/silex.md) -- Lighter package: from 10 to 3 Composer dependencies! -- [#235](https://github.com/PHP-DI/PHP-DI/issues/235): `DI\link()` is now deprecated in favor of `DI\get()`. There is no BC break as `DI\link()` still works. -- [#207](https://github.com/PHP-DI/PHP-DI/issues/207): Support for `DI\link()` in arrays -- [#203](https://github.com/PHP-DI/PHP-DI/issues/203): New `DI\string()` helper ([documentation](doc/php-definitions.md)) -- [#208](https://github.com/PHP-DI/PHP-DI/issues/208): Support for nested definitions -- [#226](https://github.com/PHP-DI/PHP-DI/pull/226): `DI\factory()` can now be omitted with closures: - - ```php - // before - 'My\Class' => DI\factory(function () { ... }) - // now (optional shortcut) - 'My\Class' => function () { ... } - ``` -- [#193](https://github.com/PHP-DI/PHP-DI/issues/193): `DI\object()->method()` now supports calling the same method twice (or more). -- [#248](https://github.com/PHP-DI/PHP-DI/issues/248): New `DI\decorate()` helper to decorate a previously defined entry ([documentation](doc/definition-overriding.md)) -- [#215](https://github.com/PHP-DI/PHP-DI/pull/215): New `DI\add()` helper to add entries to an existing array ([documentation](doc/definition-overriding.md)) -- [#218](https://github.com/PHP-DI/PHP-DI/issues/218): `ContainerBuilder::addDefinitions()` can now take an array of definitions -- [#211](https://github.com/PHP-DI/PHP-DI/pull/211): `ContainerBuilder::addDefinitions()` is now fluent (return `$this`) -- [#250](https://github.com/PHP-DI/PHP-DI/issues/250): `Container::call()` now also accepts parameters not indexed by name as well as embedded definitions ([documentation](doc/container.md)) -- Various performance improvements, e.g. lower the number of files loaded, simpler architecture, … - -BC breaks: - -- PHP-DI now requires a version of PHP >= 5.4.0 -- The package is lighter by default: - - [#251](https://github.com/PHP-DI/PHP-DI/issues/251): Annotations are disabled by default, if you use annotations enable them with `$containerBuilder->useAnnotations(true)`. Additionally the `doctrine/annotations` package isn't required by default anymore, so you also need to run `composer require doctrine/annotations`. - - `doctrine/cache` is not installed by default anymore, you need to require it in `composer.json` (`~1.0`) if you want to configure a cache for PHP-DI - - [#198](https://github.com/PHP-DI/PHP-DI/issues/198): `ocramius/proxy-manager` is not installed by default anymore, you need to require it in `composer.json` (`~1.0`) if you want to use **lazy injection** -- Closures are now converted into factory definitions automatically. If you ever defined a closure as a value (e.g. to have the closure injected in a class), you need to wrap the closure with the new `DI\value()` helper. -- [#223](https://github.com/PHP-DI/PHP-DI/issues/223): `DI\ContainerInterface` was deprecated since v4.1 and has been removed - -Internal changes in case you were replacing/extending some parts: - -- the definition sources architecture has been refactored, if you defined custom definition sources you will need to update your code (it should be much easier now) -- [#252](https://github.com/PHP-DI/PHP-DI/pull/252): `DI\Scope` internal implementation has changed. You are encouraged to use the constants (`DI\Scope::SINGLETON` and `DI\Scope::PROTOTYPE`) instead of the static methods, but backward compatibility is kept (static methods still work). -- [#241](https://github.com/PHP-DI/PHP-DI/issues/241): `Container::call()` now uses the *Invoker* external library - -## 4.4 - -Read the [news entry](news/13-php-di-4-4-released.md). - -- [#185](https://github.com/PHP-DI/PHP-DI/issues/185) Support for invokable objects in `Container::call()` -- [#192](https://github.com/PHP-DI/PHP-DI/pull/192) Support for invokable classes in `Container::call()` (will instantiate the class) -- [#184](https://github.com/PHP-DI/PHP-DI/pull/184) Option to ignore phpdoc errors - -## 4.3 - -Read the [news entry](news/11-php-di-4-3-released.md). - -- [#176](https://github.com/PHP-DI/PHP-DI/pull/176) New definition type for reading environment variables: `DI\env()` -- [#181](https://github.com/PHP-DI/PHP-DI/pull/181) `DI\FactoryInterface` and `DI\InvokerInterface` are now auto-registered inside the container so that you can inject them without any configuration needed -- [#173](https://github.com/PHP-DI/PHP-DI/pull/173) `$container->call(['MyClass', 'method]);` will get `MyClass` from the container if `method()` is not a static method - -## 4.2.2 - -- Fixed [#180](https://github.com/PHP-DI/PHP-DI/pull/180): `Container::call()` with object methods (`[$object, 'method']`) is now supported - -## 4.2.1 - -- Support for PHP 5.3.3, which was previously incomplete because of a bug in the reflection (there is now a workaround for this bug) - -But if you can, seriously avoid this (really old) PHP version and upgrade. - -## 4.2 - -Read the [news entry](news/10-php-di-4-2-released.md). - -**Minor BC-break**: Optional parameters (that were not configured) were injected, they are now ignored, which is what naturally makes sense since they are optional. -Example: - -```php - public function __construct(Bar $bar = null) - { - $this->bar = $bar ?: $this->createDefaultBar(); - } -``` - -Before 4.2, PHP-DI would try to inject a `Bar` instance. From 4.2 and onwards, it will inject `null`. - -Of course, you can still explicitly define an injection for the optional parameters and that will work. - -All changes: - -* [#162](https://github.com/PHP-DI/PHP-DI/pull/162) Added `Container::call()` to call functions with dependency injection -* [#156](https://github.com/PHP-DI/PHP-DI/issues/156) Wildcards (`*`) in definitions -* [#164](https://github.com/PHP-DI/PHP-DI/issues/164) Prototype scope is now available for `factory()` definitions too -* FIXED [#168](https://github.com/PHP-DI/PHP-DI/pull/168) `Container::has()` now returns false for interfaces and abstract classes that are not mapped in the definitions -* FIXED [#171](https://github.com/PHP-DI/PHP-DI/issues/171) Optional parameters are now ignored (not injected) if not set in the definitions (see the BC-break warning above) - -## 4.1 - -Read the [news entry](news/09-php-di-4-1-released.md). - -BC-breaks: None. - -* [#138](https://github.com/PHP-DI/PHP-DI/issues/138) [Container-interop](https://github.com/container-interop/container-interop) compliance -* [#143](https://github.com/PHP-DI/PHP-DI/issues/143) Much more explicit exception messages -* [#157](https://github.com/PHP-DI/PHP-DI/issues/157) HHVM support -* [#158](https://github.com/PHP-DI/PHP-DI/issues/158) Improved the documentation for [Symfony 2 integration](https://php-di.org/doc/frameworks/symfony2.html) - -## 4.0 - -Major changes: - -* The configuration format has changed ([read more here to understand why](news/06-php-di-4-0-new-definitions.md)) - -Read the migration guide if you are using 3.x: [Migration guide from 3.x to 4.0](doc/migration/4.0.md). - -BC-breaks: - -* YAML, XML and JSON definitions have been removed, and the PHP definition format has changed (see above) -* `ContainerSingleton` has been removed -* You cannot configure an injection as lazy anymore, you can only configure a container entry as lazy -* The Container constructor now takes mandatory parameters. Use the ContainerBuilder to create a Container. -* Removed `ContainerBuilder::setDefinitionsValidation()` (no definition validation anymore) -* `ContainerBuilder::useReflection()` is now named: `ContainerBuilder::useAutowiring()` -* `ContainerBuilder::addDefinitionsFromFile()` is now named: `ContainerBuilder::addDefinitions()` -* The `$proxy` parameter in `Container::get($name, $proxy = true)` hase been removed. To get a proxy, you now need to define an entry as "lazy". - -Other changes: - -* Added `ContainerInterface` and `FactoryInterface`, both implemented by the container. -* [#115](https://github.com/PHP-DI/PHP-DI/issues/115) Added `Container::has()` -* [#142](https://github.com/PHP-DI/PHP-DI/issues/142) Added `Container::make()` to resolve an entry -* [#127](https://github.com/PHP-DI/PHP-DI/issues/127) Added support for cases where PHP-DI is wrapped by another container (like Acclimate): PHP-DI can now use the wrapping container to perform injections -* [#128](https://github.com/PHP-DI/PHP-DI/issues/128) Configure entry aliases -* [#110](https://github.com/PHP-DI/PHP-DI/issues/110) XML definitions are not supported anymore -* [#122](https://github.com/PHP-DI/PHP-DI/issues/122) JSON definitions are not supported anymore -* `ContainerSingleton` has finally been removed -* Added `ContainerBuilder::buildDevContainer()` to get started with a default container very easily. -* [#99](https://github.com/PHP-DI/PHP-DI/issues/99) Fixed "`@param` with PHP internal type throws exception" - -## 3.5.1 - -* FIXED [#126](https://github.com/PHP-DI/PHP-DI/issues/126): `Container::set` without effect if a value has already been set and retrieved - -## 3.5 - -Read the [news entry](news/05-php-di-3-5.md). - -* Importing `@Inject` and `@Injectable` annotations is now optional! It means that you don't have to write `use DI\Annotation\Inject` anymore -* FIXED [#124](https://github.com/PHP-DI/PHP-DI/issues/124): `@Injects` annotation conflicts with other annotations - -## 3.4 - -Read the [news entry](news/04-php-di-3-4.md). - -* [#106](https://github.com/PHP-DI/PHP-DI/pull/106) You can now define arrays of values (in YAML, PHP, …) thanks to [@unkind](https://github.com/unkind) -* [#98](https://github.com/PHP-DI/PHP-DI/issues/98) `ContainerBuilder` is now fluent thanks to [@drdamour](https://github.com/drdamour) -* [#101](https://github.com/PHP-DI/PHP-DI/pull/101) Optional parameters are now supported: if you don't define a value to inject, their default value will be used -* XML definitions have been deprecated, there weren't even documented and were not maintained. They will be removed in 4.0. -* FIXED [#100](https://github.com/PHP-DI/PHP-DI/issues/100): bug for lazy injection in constructors - -## 3.3 - -Read the [news entry](news/03-php-di-3-3.md). - -* Inject dependencies on an existing instance with `Container::injectOn` (work from [Jeff Flitton](https://github.com/jflitton): [#89](https://github.com/PHP-DI/PHP-DI/pull/89)). -* [#86](https://github.com/PHP-DI/PHP-DI/issues/86): Optimized definition lookup (faster) -* FIXED [#87](https://github.com/PHP-DI/PHP-DI/issues/87): Rare bug in the `PhpDocParser`, fixed by [drdamour](https://github.com/drdamour) - -## 3.2 - -Read the [news entry](news/02-php-di-3-2.md). - -Small BC-break: PHP-DI 3.0 and 3.1 injected properties before calling the constructor. This was confusing and [not supported for internal classes](https://github.com/PHP-DI/PHP-DI/issues/74). -From 3.2 and on, properties are injected after calling the constructor. - -* **[Lazy injection](doc/lazy-injection.md)**: it is now possible to use lazy injection on properties and methods (setters and constructors). -* Lazy dependencies are now proxies that extend the class they proxy, so type-hinting works. -* Addition of the **`ContainerBuilder`** object, that helps to [create and configure a `Container`](doc/container-configuration.md). -* Some methods for configuring the Container have gone **deprecated** in favor of the `ContainerBuilder`. Fear not, these deprecated methods will remain until next major version (4.0). - * `Container::useReflection`, use ContainerBuilder::useReflection instead - * `Container::useAnnotations`, use ContainerBuilder::useAnnotations instead - * `Container::setDefinitionCache`, use ContainerBuilder::setDefinitionCache instead - * `Container::setDefinitionsValidation`, use ContainerBuilder::setDefinitionsValidation instead -* The container is now auto-registered (as 'DI\Container'). You can now inject the container without registering it. - -## 3.1.1 - -* Value definitions (`$container->set('foo', 80)`) are not cached anymore -* FIXED [#82](https://github.com/PHP-DI/PHP-DI/issues/82): Serialization error when using a cache - -## 3.1 - -Read the [news entry](news/01-php-di-3-1.md). - -* Zend Framework 1 integration through the [PHP-DI-ZF1 project](https://github.com/PHP-DI/PHP-DI-ZF1) -* Fixed the order of priorities when you mix different definition sources (reflection, annotations, files, …). See [Definition overriding](doc/definition-overriding.md) -* Now possible to define null values with `$container->set('foo', null)` (see [#79](https://github.com/PHP-DI/PHP-DI/issues/79)). -* Deprecated usage of `ContainerSingleton`, will be removed in next major version (4.0) - -## 3.0.6 - -* FIXED [#76](https://github.com/PHP-DI/PHP-DI/issues/76): Definition conflict when setting a closure for a class name - -## 3.0.5 - -* FIXED [#70](https://github.com/PHP-DI/PHP-DI/issues/70): Definition conflict when setting a value for a class name - -## 3.0.4 - -* FIXED [#69](https://github.com/PHP-DI/PHP-DI/issues/69): YamlDefinitionFileLoader crashes if YAML file is empty - -## 3.0.3 - -* Fixed over-restrictive dependencies in composer.json - -## 3.0.2 - -* [#64](https://github.com/PHP-DI/PHP-DI/issues/64): Non PHP-DI exceptions are not captured-rethrown anymore when injecting dependencies (cleaner stack trace) - -## 3.0.1 - -* [#62](https://github.com/PHP-DI/PHP-DI/issues/62): When using aliases, definitions are now merged - -## 3.0 - -Major compatibility breaks with 2.x. - -* The container is no longer a Singleton (but `ContainerSingleton::getInstance()` is available for fools who like it) -* Setter injection -* Constructor injection -* Scopes: singleton (share the same instance of the class) or prototype (create a new instance each time it is fetched). Defined at class level. -* Configuration is reworked from scratch. Now every configuration backend can do 100% of the job. -* Provided configuration backends: - * Reflection - * Annotations: @Inject, @Injectable - * PHP code (`Container::set()`) - * PHP array - * YAML file -* As a consequence, annotations are not mandatory anymore, all functionalities can be used with or without annotations. -* Renamed `DI\Annotations\` to `DI\Annotation\` -* `Container` no longer implements ArrayAccess, use only `$container->get($key)` now -* ZF1 integration broken and removed (work in progress for next releases) -* Code now follows PSR1 and PSR2 coding styles -* FIXED: [#58](https://github.com/PHP-DI/PHP-DI/issues/58) Getting a proxy of an alias didn't work - -## 2.1 - -* `use` statements to import classes from other namespaces are now taken into account with the `@var` annotation -* Updated and lightened the dependencies : `doctrine/common` has been replaced with more specific `doctrine/annotations` and `doctrine/cache` - -## 2.0 - -Major compatibility breaks with 1.x. - -* `Container::resolveDependencies()` has been renamed to `Container::injectAll()` -* Dependencies are now injected **before** the constructor is called, and thus are available in the constructor -* Merged `@Value` annotation with `@Inject`: no difference between value and bean injection anymore -* Container implements ArrayAccess for get() and set() (`$container['db.host'] = 'localhost';`) -* Ini configuration files removed: configuration is done in PHP -* Allow to define beans within closures for lazy-loading -* Switched to MIT License - -Warning: - -* If you use PHP 5.3 and __wakeup() methods, they will be called when PHP-DI creates new instances of those classes. - -## 1.1 - -* Caching of annotations based on Doctrine caches - -## 1.0 - -* DependencyManager renamed to Container -* Refactored basic Container usage with `get` and `set` -* Allow named injection `@Inject(name="")` -* Zend Framework integration diff --git a/system/vendor/php-di/php-di/composer.json b/system/vendor/php-di/php-di/composer.json deleted file mode 100644 index 16b5f26..0000000 --- a/system/vendor/php-di/php-di/composer.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "name": "php-di/php-di", - "type": "library", - "description": "The dependency injection container for humans", - "keywords": ["di", "dependency injection", "container", "ioc", "psr-11", "psr11", "container-interop"], - "homepage": "https://php-di.org/", - "license": "MIT", - "autoload": { - "psr-4": { - "DI\\": "src/" - }, - "files": [ - "src/functions.php" - ] - }, - "autoload-dev": { - "psr-4": { - "DI\\Test\\IntegrationTest\\": "tests/IntegrationTest/", - "DI\\Test\\UnitTest\\": "tests/UnitTest/" - } - }, - "scripts": { - "test": "phpunit", - "format-code": "php-cs-fixer fix --allow-risky=yes", - "phpstan": "phpstan analyse -l 5 -c phpstan.neon src" - }, - "require": { - "php": ">=7.4.0", - "psr/container": "^1.0", - "php-di/invoker": "^2.0", - "php-di/phpdoc-reader": "^2.0.1", - "laravel/serializable-closure": "^1.0" - }, - "require-dev": { - "phpunit/phpunit": "^9.5", - "mnapoli/phpunit-easymock": "^1.2", - "doctrine/annotations": "~1.10", - "ocramius/proxy-manager": "^2.11.2", - "friendsofphp/php-cs-fixer": "^2.4", - "phpstan/phpstan": "^0.12" - }, - "provide": { - "psr/container-implementation": "^1.0" - }, - "suggest": { - "doctrine/annotations": "Install it if you want to use annotations (version ~1.2)", - "ocramius/proxy-manager": "Install it if you want to use lazy injection (version ~2.0)" - } -} diff --git a/system/vendor/php-di/php-di/src/Annotation/Inject.php b/system/vendor/php-di/php-di/src/Annotation/Inject.php deleted file mode 100644 index c0eef19..0000000 --- a/system/vendor/php-di/php-di/src/Annotation/Inject.php +++ /dev/null @@ -1,93 +0,0 @@ - - */ -final class Inject -{ - /** - * Entry name. - * @var string - */ - private $name; - - /** - * Parameters, indexed by the parameter number (index) or name. - * - * Used if the annotation is set on a method - * @var array - */ - private $parameters = []; - - /** - * @throws InvalidAnnotation - */ - public function __construct(array $values) - { - // Process the parameters as a list AND as a parameter array (we don't know on what the annotation is) - - // @Inject(name="foo") - if (isset($values['name']) && is_string($values['name'])) { - $this->name = $values['name']; - - return; - } - - // @Inject - if (! isset($values['value'])) { - return; - } - - $values = $values['value']; - - // @Inject("foo") - if (is_string($values)) { - $this->name = $values; - } - - // @Inject({...}) on a method - if (is_array($values)) { - foreach ($values as $key => $value) { - if (! is_string($value)) { - throw new InvalidAnnotation(sprintf( - '@Inject({"param" = "value"}) expects "value" to be a string, %s given.', - json_encode($value) - )); - } - - $this->parameters[$key] = $value; - } - } - } - - /** - * @return string|null Name of the entry to inject - */ - public function getName() - { - return $this->name; - } - - /** - * @return array Parameters, indexed by the parameter number (index) or name - */ - public function getParameters() : array - { - return $this->parameters; - } -} diff --git a/system/vendor/php-di/php-di/src/Annotation/Injectable.php b/system/vendor/php-di/php-di/src/Annotation/Injectable.php deleted file mode 100644 index ea15944..0000000 --- a/system/vendor/php-di/php-di/src/Annotation/Injectable.php +++ /dev/null @@ -1,42 +0,0 @@ - - * @author Matthieu Napoli - */ -final class Injectable -{ - /** - * Should the object be lazy-loaded. - * @var bool|null - */ - private $lazy; - - public function __construct(array $values) - { - if (isset($values['lazy'])) { - $this->lazy = (bool) $values['lazy']; - } - } - - /** - * @return bool|null - */ - public function isLazy() - { - return $this->lazy; - } -} diff --git a/system/vendor/php-di/php-di/src/CompiledContainer.php b/system/vendor/php-di/php-di/src/CompiledContainer.php deleted file mode 100644 index 31fc017..0000000 --- a/system/vendor/php-di/php-di/src/CompiledContainer.php +++ /dev/null @@ -1,129 +0,0 @@ - - */ -abstract class CompiledContainer extends Container -{ - /** - * This const is overridden in child classes (compiled containers). - * @var array - */ - protected const METHOD_MAPPING = []; - - /** - * @var InvokerInterface - */ - private $factoryInvoker; - - /** - * {@inheritdoc} - */ - public function get($name) - { - // Try to find the entry in the singleton map - if (isset($this->resolvedEntries[$name]) || array_key_exists($name, $this->resolvedEntries)) { - return $this->resolvedEntries[$name]; - } - - $method = static::METHOD_MAPPING[$name] ?? null; - - // If it's a compiled entry, then there is a method in this class - if ($method !== null) { - // Check if we are already getting this entry -> circular dependency - if (isset($this->entriesBeingResolved[$name])) { - throw new DependencyException("Circular dependency detected while trying to resolve entry '$name'"); - } - $this->entriesBeingResolved[$name] = true; - - try { - $value = $this->$method(); - } finally { - unset($this->entriesBeingResolved[$name]); - } - - // Store the entry to always return it without recomputing it - $this->resolvedEntries[$name] = $value; - - return $value; - } - - return parent::get($name); - } - - /** - * {@inheritdoc} - */ - public function has($name) - { - if (! is_string($name)) { - throw new \InvalidArgumentException(sprintf( - 'The name parameter must be of type string, %s given', - is_object($name) ? get_class($name) : gettype($name) - )); - } - - // The parent method is overridden to check in our array, it avoids resolving definitions - if (isset(static::METHOD_MAPPING[$name])) { - return true; - } - - return parent::has($name); - } - - protected function setDefinition(string $name, Definition $definition) - { - // It needs to be forbidden because that would mean get() must go through the definitions - // every time, which kinds of defeats the performance gains of the compiled container - throw new \LogicException('You cannot set a definition at runtime on a compiled container. You can either put your definitions in a file, disable compilation or ->set() a raw value directly (PHP object, string, int, ...) instead of a PHP-DI definition.'); - } - - /** - * Invoke the given callable. - */ - protected function resolveFactory($callable, $entryName, array $extraParameters = []) - { - // Initialize the factory resolver - if (! $this->factoryInvoker) { - $parameterResolver = new ResolverChain([ - new AssociativeArrayResolver, - new FactoryParameterResolver($this->delegateContainer), - new NumericArrayResolver, - new DefaultValueResolver, - ]); - - $this->factoryInvoker = new Invoker($parameterResolver, $this->delegateContainer); - } - - $parameters = [$this->delegateContainer, new RequestedEntryHolder($entryName)]; - - $parameters = array_merge($parameters, $extraParameters); - - try { - return $this->factoryInvoker->call($callable, $parameters); - } catch (NotCallableException $e) { - throw new InvalidDefinition("Entry \"$entryName\" cannot be resolved: factory " . $e->getMessage()); - } catch (NotEnoughParametersException $e) { - throw new InvalidDefinition("Entry \"$entryName\" cannot be resolved: " . $e->getMessage()); - } - } -} diff --git a/system/vendor/php-di/php-di/src/Compiler/Compiler.php b/system/vendor/php-di/php-di/src/Compiler/Compiler.php deleted file mode 100644 index ca5d494..0000000 --- a/system/vendor/php-di/php-di/src/Compiler/Compiler.php +++ /dev/null @@ -1,422 +0,0 @@ - - */ -class Compiler -{ - /** - * @var string - */ - private $containerClass; - - /** - * @var string - */ - private $containerParentClass; - - /** - * Definitions indexed by the entry name. The value can be null if the definition needs to be fetched. - * - * Keys are strings, values are `Definition` objects or null. - * - * @var \ArrayIterator - */ - private $entriesToCompile; - - /** - * Progressive counter for definitions. - * - * Each key in $entriesToCompile is defined as 'SubEntry' + counter - * and each definition has always the same key in the CompiledContainer - * if PHP-DI configuration does not change. - * - * @var int - */ - private $subEntryCounter; - - /** - * Progressive counter for CompiledContainer get methods. - * - * Each CompiledContainer method name is defined as 'get' + counter - * and remains the same after each recompilation - * if PHP-DI configuration does not change. - * - * @var int - */ - private $methodMappingCounter; - - /** - * Map of entry names to method names. - * - * @var string[] - */ - private $entryToMethodMapping = []; - - /** - * @var string[] - */ - private $methods = []; - - /** - * @var bool - */ - private $autowiringEnabled; - - /** - * @var ProxyFactory - */ - private $proxyFactory; - - public function __construct(ProxyFactory $proxyFactory) - { - $this->proxyFactory = $proxyFactory; - } - - public function getProxyFactory() : ProxyFactory - { - return $this->proxyFactory; - } - - /** - * Compile the container. - * - * @return string The compiled container file name. - */ - public function compile( - DefinitionSource $definitionSource, - string $directory, - string $className, - string $parentClassName, - bool $autowiringEnabled - ) : string { - $fileName = rtrim($directory, '/') . '/' . $className . '.php'; - - if (file_exists($fileName)) { - // The container is already compiled - return $fileName; - } - - $this->autowiringEnabled = $autowiringEnabled; - - // Validate that a valid class name was provided - $validClassName = preg_match('/^[a-zA-Z_][a-zA-Z0-9_]*$/', $className); - if (!$validClassName) { - throw new InvalidArgumentException("The container cannot be compiled: `$className` is not a valid PHP class name"); - } - - $this->entriesToCompile = new \ArrayIterator($definitionSource->getDefinitions()); - - // We use an ArrayIterator so that we can keep adding new items to the list while we compile entries - foreach ($this->entriesToCompile as $entryName => $definition) { - $silenceErrors = false; - // This is an entry found by reference during autowiring - if (!$definition) { - $definition = $definitionSource->getDefinition($entryName); - // We silence errors for those entries because type-hints may reference interfaces/abstract classes - // which could later be defined, or even not used (we don't want to block the compilation for those) - $silenceErrors = true; - } - if (!$definition) { - // We do not throw a `NotFound` exception here because the dependency - // could be defined at runtime - continue; - } - // Check that the definition can be compiled - $errorMessage = $this->isCompilable($definition); - if ($errorMessage !== true) { - continue; - } - try { - $this->compileDefinition($entryName, $definition); - } catch (InvalidDefinition $e) { - if ($silenceErrors) { - // forget the entry - unset($this->entryToMethodMapping[$entryName]); - } else { - throw $e; - } - } - } - - $this->containerClass = $className; - $this->containerParentClass = $parentClassName; - - ob_start(); - require __DIR__ . '/Template.php'; - $fileContent = ob_get_clean(); - - $fileContent = "createCompilationDirectory(dirname($fileName)); - $this->writeFileAtomic($fileName, $fileContent); - - return $fileName; - } - - private function writeFileAtomic(string $fileName, string $content) : int - { - $tmpFile = @tempnam(dirname($fileName), 'swap-compile'); - if ($tmpFile === false) { - throw new InvalidArgumentException( - sprintf('Error while creating temporary file in %s', dirname($fileName)) - ); - } - @chmod($tmpFile, 0666); - - $written = file_put_contents($tmpFile, $content); - if ($written === false) { - @unlink($tmpFile); - - throw new InvalidArgumentException(sprintf('Error while writing to %s', $tmpFile)); - } - - @chmod($tmpFile, 0666); - $renamed = @rename($tmpFile, $fileName); - if (!$renamed) { - @unlink($tmpFile); - throw new InvalidArgumentException(sprintf('Error while renaming %s to %s', $tmpFile, $fileName)); - } - - return $written; - } - - /** - * @throws DependencyException - * @throws InvalidDefinition - * @return string The method name - */ - private function compileDefinition(string $entryName, Definition $definition) : string - { - // Generate a unique method name - $methodName = 'get' . (++$this->methodMappingCounter); - $this->entryToMethodMapping[$entryName] = $methodName; - - switch (true) { - case $definition instanceof ValueDefinition: - $value = $definition->getValue(); - $code = 'return ' . $this->compileValue($value) . ';'; - break; - case $definition instanceof Reference: - $targetEntryName = $definition->getTargetEntryName(); - $code = 'return $this->delegateContainer->get(' . $this->compileValue($targetEntryName) . ');'; - // If this method is not yet compiled we store it for compilation - if (!isset($this->entriesToCompile[$targetEntryName])) { - $this->entriesToCompile[$targetEntryName] = null; - } - break; - case $definition instanceof StringDefinition: - $entryName = $this->compileValue($definition->getName()); - $expression = $this->compileValue($definition->getExpression()); - $code = 'return \DI\Definition\StringDefinition::resolveExpression(' . $entryName . ', ' . $expression . ', $this->delegateContainer);'; - break; - case $definition instanceof EnvironmentVariableDefinition: - $variableName = $this->compileValue($definition->getVariableName()); - $isOptional = $this->compileValue($definition->isOptional()); - $defaultValue = $this->compileValue($definition->getDefaultValue()); - $code = <<getVariableName()}' has not been defined"); - } - return $defaultValue; -PHP; - break; - case $definition instanceof ArrayDefinition: - try { - $code = 'return ' . $this->compileValue($definition->getValues()) . ';'; - } catch (\Exception $e) { - throw new DependencyException(sprintf( - 'Error while compiling %s. %s', - $definition->getName(), - $e->getMessage() - ), 0, $e); - } - break; - case $definition instanceof ObjectDefinition: - $compiler = new ObjectCreationCompiler($this); - $code = $compiler->compile($definition); - $code .= "\n return \$object;"; - break; - case $definition instanceof DecoratorDefinition: - $decoratedDefinition = $definition->getDecoratedDefinition(); - if (! $decoratedDefinition instanceof Definition) { - if (! $definition->getName()) { - throw new InvalidDefinition('Decorators cannot be nested in another definition'); - } - throw new InvalidDefinition(sprintf( - 'Entry "%s" decorates nothing: no previous definition with the same name was found', - $definition->getName() - )); - } - $code = sprintf( - 'return call_user_func(%s, %s, $this->delegateContainer);', - $this->compileValue($definition->getCallable()), - $this->compileValue($decoratedDefinition) - ); - break; - case $definition instanceof FactoryDefinition: - $value = $definition->getCallable(); - - // Custom error message to help debugging - $isInvokableClass = is_string($value) && class_exists($value) && method_exists($value, '__invoke'); - if ($isInvokableClass && !$this->autowiringEnabled) { - throw new InvalidDefinition(sprintf( - 'Entry "%s" cannot be compiled. Invokable classes cannot be automatically resolved if autowiring is disabled on the container, you need to enable autowiring or define the entry manually.', - $entryName - )); - } - - $definitionParameters = ''; - if (!empty($definition->getParameters())) { - $definitionParameters = ', ' . $this->compileValue($definition->getParameters()); - } - - $code = sprintf( - 'return $this->resolveFactory(%s, %s%s);', - $this->compileValue($value), - var_export($entryName, true), - $definitionParameters - ); - - break; - default: - // This case should not happen (so it cannot be tested) - throw new \Exception('Cannot compile definition of type ' . get_class($definition)); - } - - $this->methods[$methodName] = $code; - - return $methodName; - } - - public function compileValue($value) : string - { - // Check that the value can be compiled - $errorMessage = $this->isCompilable($value); - if ($errorMessage !== true) { - throw new InvalidDefinition($errorMessage); - } - - if ($value instanceof Definition) { - // Give it an arbitrary unique name - $subEntryName = 'subEntry' . (++$this->subEntryCounter); - // Compile the sub-definition in another method - $methodName = $this->compileDefinition($subEntryName, $value); - // The value is now a method call to that method (which returns the value) - return "\$this->$methodName()"; - } - - if (is_array($value)) { - $value = array_map(function ($value, $key) { - $compiledValue = $this->compileValue($value); - $key = var_export($key, true); - - return " $key => $compiledValue,\n"; - }, $value, array_keys($value)); - $value = implode('', $value); - - return "[\n$value ]"; - } - - if ($value instanceof \Closure) { - return $this->compileClosure($value); - } - - return var_export($value, true); - } - - private function createCompilationDirectory(string $directory) - { - if (!is_dir($directory) && !@mkdir($directory, 0777, true) && !is_dir($directory)) { - throw new InvalidArgumentException(sprintf('Compilation directory does not exist and cannot be created: %s.', $directory)); - } - if (!is_writable($directory)) { - throw new InvalidArgumentException(sprintf('Compilation directory is not writable: %s.', $directory)); - } - } - - /** - * @return string|true If true is returned that means that the value is compilable. - */ - private function isCompilable($value) - { - if ($value instanceof ValueDefinition) { - return $this->isCompilable($value->getValue()); - } - if ($value instanceof DecoratorDefinition) { - if (empty($value->getName())) { - return 'Decorators cannot be nested in another definition'; - } - } - // All other definitions are compilable - if ($value instanceof Definition) { - return true; - } - if ($value instanceof \Closure) { - return true; - } - if (is_object($value)) { - return 'An object was found but objects cannot be compiled'; - } - if (is_resource($value)) { - return 'A resource was found but resources cannot be compiled'; - } - - return true; - } - - /** - * @throws \DI\Definition\Exception\InvalidDefinition - */ - private function compileClosure(\Closure $closure) : string - { - $reflector = new ReflectionClosure($closure); - - if ($reflector->getUseVariables()) { - throw new InvalidDefinition('Cannot compile closures which import variables using the `use` keyword'); - } - - if ($reflector->isBindingRequired() || $reflector->isScopeRequired()) { - throw new InvalidDefinition('Cannot compile closures which use $this or self/static/parent references'); - } - - // Force all closures to be static (add the `static` keyword), i.e. they can't use - // $this, which makes sense since their code is copied into another class. - $code = ($reflector->isStatic() ? '' : 'static ') . $reflector->getCode(); - - $code = trim($code, "\t\n\r;"); - - return $code; - } -} diff --git a/system/vendor/php-di/php-di/src/Compiler/ObjectCreationCompiler.php b/system/vendor/php-di/php-di/src/Compiler/ObjectCreationCompiler.php deleted file mode 100644 index 9f19d4c..0000000 --- a/system/vendor/php-di/php-di/src/Compiler/ObjectCreationCompiler.php +++ /dev/null @@ -1,201 +0,0 @@ - - */ -class ObjectCreationCompiler -{ - /** - * @var Compiler - */ - private $compiler; - - public function __construct(Compiler $compiler) - { - $this->compiler = $compiler; - } - - public function compile(ObjectDefinition $definition) : string - { - $this->assertClassIsNotAnonymous($definition); - $this->assertClassIsInstantiable($definition); - - // Lazy? - if ($definition->isLazy()) { - return $this->compileLazyDefinition($definition); - } - - try { - $classReflection = new ReflectionClass($definition->getClassName()); - $constructorArguments = $this->resolveParameters($definition->getConstructorInjection(), $classReflection->getConstructor()); - $dumpedConstructorArguments = array_map(function ($value) { - return $this->compiler->compileValue($value); - }, $constructorArguments); - - $code = []; - $code[] = sprintf( - '$object = new %s(%s);', - $definition->getClassName(), - implode(', ', $dumpedConstructorArguments) - ); - - // Property injections - foreach ($definition->getPropertyInjections() as $propertyInjection) { - $value = $propertyInjection->getValue(); - $value = $this->compiler->compileValue($value); - - $className = $propertyInjection->getClassName() ?: $definition->getClassName(); - $property = new ReflectionProperty($className, $propertyInjection->getPropertyName()); - if ($property->isPublic()) { - $code[] = sprintf('$object->%s = %s;', $propertyInjection->getPropertyName(), $value); - } else { - // Private/protected property - $code[] = sprintf( - '\DI\Definition\Resolver\ObjectCreator::setPrivatePropertyValue(%s, $object, \'%s\', %s);', - var_export($propertyInjection->getClassName(), true), - $propertyInjection->getPropertyName(), - $value - ); - } - } - - // Method injections - foreach ($definition->getMethodInjections() as $methodInjection) { - $methodReflection = new \ReflectionMethod($definition->getClassName(), $methodInjection->getMethodName()); - $parameters = $this->resolveParameters($methodInjection, $methodReflection); - - $dumpedParameters = array_map(function ($value) { - return $this->compiler->compileValue($value); - }, $parameters); - - $code[] = sprintf( - '$object->%s(%s);', - $methodInjection->getMethodName(), - implode(', ', $dumpedParameters) - ); - } - } catch (InvalidDefinition $e) { - throw InvalidDefinition::create($definition, sprintf( - 'Entry "%s" cannot be compiled: %s', - $definition->getName(), - $e->getMessage() - )); - } - - return implode("\n ", $code); - } - - public function resolveParameters(MethodInjection $definition = null, ReflectionMethod $method = null) : array - { - $args = []; - - if (! $method) { - return $args; - } - - $definitionParameters = $definition ? $definition->getParameters() : []; - - foreach ($method->getParameters() as $index => $parameter) { - if (array_key_exists($index, $definitionParameters)) { - // Look in the definition - $value = &$definitionParameters[$index]; - } elseif ($parameter->isOptional()) { - // If the parameter is optional and wasn't specified, we take its default value - $args[] = $this->getParameterDefaultValue($parameter, $method); - continue; - } else { - throw new InvalidDefinition(sprintf( - 'Parameter $%s of %s has no value defined or guessable', - $parameter->getName(), - $this->getFunctionName($method) - )); - } - - $args[] = &$value; - } - - return $args; - } - - private function compileLazyDefinition(ObjectDefinition $definition) : string - { - $subDefinition = clone $definition; - $subDefinition->setLazy(false); - $subDefinition = $this->compiler->compileValue($subDefinition); - - $this->compiler->getProxyFactory()->generateProxyClass($definition->getClassName()); - - return <<proxyFactory->createProxy( - '{$definition->getClassName()}', - function (&\$wrappedObject, \$proxy, \$method, \$params, &\$initializer) { - \$wrappedObject = $subDefinition; - \$initializer = null; // turning off further lazy initialization - return true; - } - ); -PHP; - } - - /** - * Returns the default value of a function parameter. - * - * @throws InvalidDefinition Can't get default values from PHP internal classes and functions - * @return mixed - */ - private function getParameterDefaultValue(ReflectionParameter $parameter, ReflectionMethod $function) - { - try { - return $parameter->getDefaultValue(); - } catch (\ReflectionException $e) { - throw new InvalidDefinition(sprintf( - 'The parameter "%s" of %s has no type defined or guessable. It has a default value, ' - . 'but the default value can\'t be read through Reflection because it is a PHP internal class.', - $parameter->getName(), - $this->getFunctionName($function) - )); - } - } - - private function getFunctionName(ReflectionMethod $method) : string - { - return $method->getName() . '()'; - } - - private function assertClassIsNotAnonymous(ObjectDefinition $definition) - { - if (strpos($definition->getClassName(), '@') !== false) { - throw InvalidDefinition::create($definition, sprintf( - 'Entry "%s" cannot be compiled: anonymous classes cannot be compiled', - $definition->getName() - )); - } - } - - private function assertClassIsInstantiable(ObjectDefinition $definition) - { - if ($definition->isInstantiable()) { - return; - } - - $message = ! $definition->classExists() - ? 'Entry "%s" cannot be compiled: the class doesn\'t exist' - : 'Entry "%s" cannot be compiled: the class is not instantiable'; - - throw InvalidDefinition::create($definition, sprintf($message, $definition->getName())); - } -} diff --git a/system/vendor/php-di/php-di/src/Compiler/RequestedEntryHolder.php b/system/vendor/php-di/php-di/src/Compiler/RequestedEntryHolder.php deleted file mode 100644 index 68b5bc2..0000000 --- a/system/vendor/php-di/php-di/src/Compiler/RequestedEntryHolder.php +++ /dev/null @@ -1,28 +0,0 @@ - - */ -class RequestedEntryHolder implements RequestedEntry -{ - /** - * @var string - */ - private $name; - - public function __construct(string $name) - { - $this->name = $name; - } - - public function getName() : string - { - return $this->name; - } -} diff --git a/system/vendor/php-di/php-di/src/Compiler/Template.php b/system/vendor/php-di/php-di/src/Compiler/Template.php deleted file mode 100644 index e053639..0000000 --- a/system/vendor/php-di/php-di/src/Compiler/Template.php +++ /dev/null @@ -1,16 +0,0 @@ -/** - * This class has been auto-generated by PHP-DI. - */ -class containerClass; ?> extends containerParentClass; ?> -{ - const METHOD_MAPPING = entryToMethodMapping); ?>; - -methods as $methodName => $methodContent) : ?> - protected function () - { - - - } - - -} diff --git a/system/vendor/php-di/php-di/src/Container.php b/system/vendor/php-di/php-di/src/Container.php deleted file mode 100644 index a9c95de..0000000 --- a/system/vendor/php-di/php-di/src/Container.php +++ /dev/null @@ -1,433 +0,0 @@ - - */ -class Container implements ContainerInterface, FactoryInterface, InvokerInterface -{ - /** - * Map of entries that are already resolved. - * @var array - */ - protected $resolvedEntries = []; - - /** - * @var MutableDefinitionSource - */ - private $definitionSource; - - /** - * @var DefinitionResolver - */ - private $definitionResolver; - - /** - * Map of definitions that are already fetched (local cache). - * - * @var (Definition|null)[] - */ - private $fetchedDefinitions = []; - - /** - * Array of entries being resolved. Used to avoid circular dependencies and infinite loops. - * @var array - */ - protected $entriesBeingResolved = []; - - /** - * @var InvokerInterface|null - */ - private $invoker; - - /** - * Container that wraps this container. If none, points to $this. - * - * @var ContainerInterface - */ - protected $delegateContainer; - - /** - * @var ProxyFactory - */ - protected $proxyFactory; - - /** - * Use `$container = new Container()` if you want a container with the default configuration. - * - * If you want to customize the container's behavior, you are discouraged to create and pass the - * dependencies yourself, the ContainerBuilder class is here to help you instead. - * - * @see ContainerBuilder - * - * @param ContainerInterface $wrapperContainer If the container is wrapped by another container. - */ - public function __construct( - MutableDefinitionSource $definitionSource = null, - ProxyFactory $proxyFactory = null, - ContainerInterface $wrapperContainer = null - ) { - $this->delegateContainer = $wrapperContainer ?: $this; - - $this->definitionSource = $definitionSource ?: $this->createDefaultDefinitionSource(); - $this->proxyFactory = $proxyFactory ?: new ProxyFactory(false); - $this->definitionResolver = new ResolverDispatcher($this->delegateContainer, $this->proxyFactory); - - // Auto-register the container - $this->resolvedEntries = [ - self::class => $this, - ContainerInterface::class => $this->delegateContainer, - FactoryInterface::class => $this, - InvokerInterface::class => $this, - ]; - } - - /** - * Returns an entry of the container by its name. - * - * @template T - * @param string|class-string $name Entry name or a class name. - * - * @throws DependencyException Error while resolving the entry. - * @throws NotFoundException No entry found for the given name. - * @return mixed|T - */ - public function get($name) - { - // If the entry is already resolved we return it - if (isset($this->resolvedEntries[$name]) || array_key_exists($name, $this->resolvedEntries)) { - return $this->resolvedEntries[$name]; - } - - $definition = $this->getDefinition($name); - if (! $definition) { - throw new NotFoundException("No entry or class found for '$name'"); - } - - $value = $this->resolveDefinition($definition); - - $this->resolvedEntries[$name] = $value; - - return $value; - } - - /** - * @param string $name - * - * @return Definition|null - */ - private function getDefinition($name) - { - // Local cache that avoids fetching the same definition twice - if (!array_key_exists($name, $this->fetchedDefinitions)) { - $this->fetchedDefinitions[$name] = $this->definitionSource->getDefinition($name); - } - - return $this->fetchedDefinitions[$name]; - } - - /** - * Build an entry of the container by its name. - * - * This method behave like get() except resolves the entry again every time. - * For example if the entry is a class then a new instance will be created each time. - * - * This method makes the container behave like a factory. - * - * @template T - * @param string|class-string $name Entry name or a class name. - * @param array $parameters Optional parameters to use to build the entry. Use this to force - * specific parameters to specific values. Parameters not defined in this - * array will be resolved using the container. - * - * @throws InvalidArgumentException The name parameter must be of type string. - * @throws DependencyException Error while resolving the entry. - * @throws NotFoundException No entry found for the given name. - * @return mixed|T - */ - public function make($name, array $parameters = []) - { - if (! is_string($name)) { - throw new InvalidArgumentException(sprintf( - 'The name parameter must be of type string, %s given', - is_object($name) ? get_class($name) : gettype($name) - )); - } - - $definition = $this->getDefinition($name); - if (! $definition) { - // If the entry is already resolved we return it - if (array_key_exists($name, $this->resolvedEntries)) { - return $this->resolvedEntries[$name]; - } - - throw new NotFoundException("No entry or class found for '$name'"); - } - - return $this->resolveDefinition($definition, $parameters); - } - - /** - * Test if the container can provide something for the given name. - * - * @param string $name Entry name or a class name. - * - * @throws InvalidArgumentException The name parameter must be of type string. - * @return bool - */ - public function has($name) - { - if (! is_string($name)) { - throw new InvalidArgumentException(sprintf( - 'The name parameter must be of type string, %s given', - is_object($name) ? get_class($name) : gettype($name) - )); - } - - if (array_key_exists($name, $this->resolvedEntries)) { - return true; - } - - $definition = $this->getDefinition($name); - if ($definition === null) { - return false; - } - - return $this->definitionResolver->isResolvable($definition); - } - - /** - * Inject all dependencies on an existing instance. - * - * @template T - * @param object|T $instance Object to perform injection upon - * @throws InvalidArgumentException - * @throws DependencyException Error while injecting dependencies - * @return object|T $instance Returns the same instance - */ - public function injectOn($instance) - { - if (!$instance) { - return $instance; - } - - $className = get_class($instance); - - // If the class is anonymous, don't cache its definition - // Checking for anonymous classes is cleaner via Reflection, but also slower - $objectDefinition = false !== strpos($className, '@anonymous') - ? $this->definitionSource->getDefinition($className) - : $this->getDefinition($className); - - if (! $objectDefinition instanceof ObjectDefinition) { - return $instance; - } - - $definition = new InstanceDefinition($instance, $objectDefinition); - - $this->definitionResolver->resolve($definition); - - return $instance; - } - - /** - * Call the given function using the given parameters. - * - * Missing parameters will be resolved from the container. - * - * @param callable $callable Function to call. - * @param array $parameters Parameters to use. Can be indexed by the parameter names - * or not indexed (same order as the parameters). - * The array can also contain DI definitions, e.g. DI\get(). - * - * @return mixed Result of the function. - */ - public function call($callable, array $parameters = []) - { - return $this->getInvoker()->call($callable, $parameters); - } - - /** - * Define an object or a value in the container. - * - * @param string $name Entry name - * @param mixed|DefinitionHelper $value Value, use definition helpers to define objects - */ - public function set(string $name, $value) - { - if ($value instanceof DefinitionHelper) { - $value = $value->getDefinition($name); - } elseif ($value instanceof \Closure) { - $value = new FactoryDefinition($name, $value); - } - - if ($value instanceof ValueDefinition) { - $this->resolvedEntries[$name] = $value->getValue(); - } elseif ($value instanceof Definition) { - $value->setName($name); - $this->setDefinition($name, $value); - } else { - $this->resolvedEntries[$name] = $value; - } - } - - /** - * Get defined container entries. - * - * @return string[] - */ - public function getKnownEntryNames() : array - { - $entries = array_unique(array_merge( - array_keys($this->definitionSource->getDefinitions()), - array_keys($this->resolvedEntries) - )); - sort($entries); - - return $entries; - } - - /** - * Get entry debug information. - * - * @param string $name Entry name - * - * @throws InvalidDefinition - * @throws NotFoundException - */ - public function debugEntry(string $name) : string - { - $definition = $this->definitionSource->getDefinition($name); - if ($definition instanceof Definition) { - return (string) $definition; - } - - if (array_key_exists($name, $this->resolvedEntries)) { - return $this->getEntryType($this->resolvedEntries[$name]); - } - - throw new NotFoundException("No entry or class found for '$name'"); - } - - /** - * Get formatted entry type. - * - * @param mixed $entry - */ - private function getEntryType($entry) : string - { - if (is_object($entry)) { - return sprintf("Object (\n class = %s\n)", get_class($entry)); - } - - if (is_array($entry)) { - return preg_replace(['/^array \(/', '/\)$/'], ['[', ']'], var_export($entry, true)); - } - - if (is_string($entry)) { - return sprintf('Value (\'%s\')', $entry); - } - - if (is_bool($entry)) { - return sprintf('Value (%s)', $entry === true ? 'true' : 'false'); - } - - return sprintf('Value (%s)', is_scalar($entry) ? $entry : ucfirst(gettype($entry))); - } - - /** - * Resolves a definition. - * - * Checks for circular dependencies while resolving the definition. - * - * @throws DependencyException Error while resolving the entry. - * @return mixed - */ - private function resolveDefinition(Definition $definition, array $parameters = []) - { - $entryName = $definition->getName(); - - // Check if we are already getting this entry -> circular dependency - if (isset($this->entriesBeingResolved[$entryName])) { - throw new DependencyException("Circular dependency detected while trying to resolve entry '$entryName'"); - } - $this->entriesBeingResolved[$entryName] = true; - - // Resolve the definition - try { - $value = $this->definitionResolver->resolve($definition, $parameters); - } finally { - unset($this->entriesBeingResolved[$entryName]); - } - - return $value; - } - - protected function setDefinition(string $name, Definition $definition) - { - // Clear existing entry if it exists - if (array_key_exists($name, $this->resolvedEntries)) { - unset($this->resolvedEntries[$name]); - } - $this->fetchedDefinitions = []; // Completely clear this local cache - - $this->definitionSource->addDefinition($definition); - } - - private function getInvoker() : InvokerInterface - { - if (! $this->invoker) { - $parameterResolver = new ResolverChain([ - new DefinitionParameterResolver($this->definitionResolver), - new NumericArrayResolver, - new AssociativeArrayResolver, - new DefaultValueResolver, - new TypeHintContainerResolver($this->delegateContainer), - ]); - - $this->invoker = new Invoker($parameterResolver, $this); - } - - return $this->invoker; - } - - private function createDefaultDefinitionSource() : SourceChain - { - $source = new SourceChain([new ReflectionBasedAutowiring]); - $source->setMutableDefinitionSource(new DefinitionArray([], new ReflectionBasedAutowiring)); - - return $source; - } -} diff --git a/system/vendor/php-di/php-di/src/ContainerBuilder.php b/system/vendor/php-di/php-di/src/ContainerBuilder.php deleted file mode 100644 index 3ee747f..0000000 --- a/system/vendor/php-di/php-di/src/ContainerBuilder.php +++ /dev/null @@ -1,385 +0,0 @@ -build(); - * - * @api - * - * @since 3.2 - * @author Matthieu Napoli - */ -class ContainerBuilder -{ - /** - * Name of the container class, used to create the container. - * @var string - */ - private $containerClass; - - /** - * Name of the container parent class, used on compiled container. - * @var string - */ - private $containerParentClass; - - /** - * @var bool - */ - private $useAutowiring = true; - - /** - * @var bool - */ - private $useAnnotations = false; - - /** - * @var bool - */ - private $ignorePhpDocErrors = false; - - /** - * If true, write the proxies to disk to improve performances. - * @var bool - */ - private $writeProxiesToFile = false; - - /** - * Directory where to write the proxies (if $writeProxiesToFile is enabled). - * @var string|null - */ - private $proxyDirectory; - - /** - * If PHP-DI is wrapped in another container, this references the wrapper. - * @var ContainerInterface - */ - private $wrapperContainer; - - /** - * @var DefinitionSource[]|string[]|array[] - */ - private $definitionSources = []; - - /** - * Whether the container has already been built. - * @var bool - */ - private $locked = false; - - /** - * @var string|null - */ - private $compileToDirectory; - - /** - * @var bool - */ - private $sourceCache = false; - - /** - * @var string - */ - protected $sourceCacheNamespace; - - /** - * Build a container configured for the dev environment. - */ - public static function buildDevContainer() : Container - { - return new Container; - } - - /** - * @param string $containerClass Name of the container class, used to create the container. - */ - public function __construct(string $containerClass = Container::class) - { - $this->containerClass = $containerClass; - } - - /** - * Build and return a container. - * - * @return Container - */ - public function build() - { - $sources = array_reverse($this->definitionSources); - - if ($this->useAnnotations) { - $autowiring = new AnnotationBasedAutowiring($this->ignorePhpDocErrors); - $sources[] = $autowiring; - } elseif ($this->useAutowiring) { - $autowiring = new ReflectionBasedAutowiring; - $sources[] = $autowiring; - } else { - $autowiring = new NoAutowiring; - } - - $sources = array_map(function ($definitions) use ($autowiring) { - if (is_string($definitions)) { - // File - return new DefinitionFile($definitions, $autowiring); - } elseif (is_array($definitions)) { - return new DefinitionArray($definitions, $autowiring); - } - - return $definitions; - }, $sources); - $source = new SourceChain($sources); - - // Mutable definition source - $source->setMutableDefinitionSource(new DefinitionArray([], $autowiring)); - - if ($this->sourceCache) { - if (!SourceCache::isSupported()) { - throw new \Exception('APCu is not enabled, PHP-DI cannot use it as a cache'); - } - // Wrap the source with the cache decorator - $source = new SourceCache($source, $this->sourceCacheNamespace); - } - - $proxyFactory = new ProxyFactory( - $this->writeProxiesToFile, - $this->proxyDirectory - ); - - $this->locked = true; - - $containerClass = $this->containerClass; - - if ($this->compileToDirectory) { - $compiler = new Compiler($proxyFactory); - $compiledContainerFile = $compiler->compile( - $source, - $this->compileToDirectory, - $containerClass, - $this->containerParentClass, - $this->useAutowiring || $this->useAnnotations - ); - // Only load the file if it hasn't been already loaded - // (the container can be created multiple times in the same process) - if (!class_exists($containerClass, false)) { - require $compiledContainerFile; - } - } - - return new $containerClass($source, $proxyFactory, $this->wrapperContainer); - } - - /** - * Compile the container for optimum performances. - * - * Be aware that the container is compiled once and never updated! - * - * Therefore: - * - * - in production you should clear that directory every time you deploy - * - in development you should not compile the container - * - * @see https://php-di.org/doc/performances.html - * - * @param string $directory Directory in which to put the compiled container. - * @param string $containerClass Name of the compiled class. Customize only if necessary. - * @param string $containerParentClass Name of the compiled container parent class. Customize only if necessary. - */ - public function enableCompilation( - string $directory, - string $containerClass = 'CompiledContainer', - string $containerParentClass = CompiledContainer::class - ) : self { - $this->ensureNotLocked(); - - $this->compileToDirectory = $directory; - $this->containerClass = $containerClass; - $this->containerParentClass = $containerParentClass; - - return $this; - } - - /** - * Enable or disable the use of autowiring to guess injections. - * - * Enabled by default. - * - * @return $this - */ - public function useAutowiring(bool $bool) : self - { - $this->ensureNotLocked(); - - $this->useAutowiring = $bool; - - return $this; - } - - /** - * Enable or disable the use of annotations to guess injections. - * - * Disabled by default. - * - * @return $this - */ - public function useAnnotations(bool $bool) : self - { - $this->ensureNotLocked(); - - $this->useAnnotations = $bool; - - return $this; - } - - /** - * Enable or disable ignoring phpdoc errors (non-existent classes in `@param` or `@var`). - * - * @return $this - */ - public function ignorePhpDocErrors(bool $bool) : self - { - $this->ensureNotLocked(); - - $this->ignorePhpDocErrors = $bool; - - return $this; - } - - /** - * Configure the proxy generation. - * - * For dev environment, use `writeProxiesToFile(false)` (default configuration) - * For production environment, use `writeProxiesToFile(true, 'tmp/proxies')` - * - * @see https://php-di.org/doc/lazy-injection.html - * - * @param bool $writeToFile If true, write the proxies to disk to improve performances - * @param string|null $proxyDirectory Directory where to write the proxies - * @throws InvalidArgumentException when writeToFile is set to true and the proxy directory is null - * @return $this - */ - public function writeProxiesToFile(bool $writeToFile, string $proxyDirectory = null) : self - { - $this->ensureNotLocked(); - - $this->writeProxiesToFile = $writeToFile; - - if ($writeToFile && $proxyDirectory === null) { - throw new InvalidArgumentException( - 'The proxy directory must be specified if you want to write proxies on disk' - ); - } - $this->proxyDirectory = $proxyDirectory; - - return $this; - } - - /** - * If PHP-DI's container is wrapped by another container, we can - * set this so that PHP-DI will use the wrapper rather than itself for building objects. - * - * @return $this - */ - public function wrapContainer(ContainerInterface $otherContainer) : self - { - $this->ensureNotLocked(); - - $this->wrapperContainer = $otherContainer; - - return $this; - } - - /** - * Add definitions to the container. - * - * @param string|array|DefinitionSource ...$definitions Can be an array of definitions, the - * name of a file containing definitions - * or a DefinitionSource object. - * @return $this - */ - public function addDefinitions(...$definitions) : self - { - $this->ensureNotLocked(); - - foreach ($definitions as $definition) { - if (!is_string($definition) && !is_array($definition) && !($definition instanceof DefinitionSource)) { - throw new InvalidArgumentException(sprintf( - '%s parameter must be a string, an array or a DefinitionSource object, %s given', - 'ContainerBuilder::addDefinitions()', - is_object($definition) ? get_class($definition) : gettype($definition) - )); - } - - $this->definitionSources[] = $definition; - } - - return $this; - } - - /** - * Enables the use of APCu to cache definitions. - * - * You must have APCu enabled to use it. - * - * Before using this feature, you should try these steps first: - * - enable compilation if not already done (see `enableCompilation()`) - * - if you use autowiring or annotations, add all the classes you are using into your configuration so that - * PHP-DI knows about them and compiles them - * Once this is done, you can try to optimize performances further with APCu. It can also be useful if you use - * `Container::make()` instead of `get()` (`make()` calls cannot be compiled so they are not optimized). - * - * Remember to clear APCu on each deploy else your application will have a stale cache. Do not enable the cache - * in development environment: any change you will make to the code will be ignored because of the cache. - * - * @see https://php-di.org/doc/performances.html - * - * @param string $cacheNamespace use unique namespace per container when sharing a single APC memory pool to prevent cache collisions - * @return $this - */ - public function enableDefinitionCache(string $cacheNamespace = '') : self - { - $this->ensureNotLocked(); - - $this->sourceCache = true; - $this->sourceCacheNamespace = $cacheNamespace; - - return $this; - } - - /** - * Are we building a compiled container? - */ - public function isCompilationEnabled() : bool - { - return (bool) $this->compileToDirectory; - } - - private function ensureNotLocked() - { - if ($this->locked) { - throw new \LogicException('The ContainerBuilder cannot be modified after the container has been built'); - } - } -} diff --git a/system/vendor/php-di/php-di/src/Definition/ArrayDefinition.php b/system/vendor/php-di/php-di/src/Definition/ArrayDefinition.php deleted file mode 100644 index ef77100..0000000 --- a/system/vendor/php-di/php-di/src/Definition/ArrayDefinition.php +++ /dev/null @@ -1,73 +0,0 @@ - - */ -class ArrayDefinition implements Definition -{ - /** - * Entry name. - * @var string - */ - private $name = ''; - - /** - * @var array - */ - private $values; - - public function __construct(array $values) - { - $this->values = $values; - } - - public function getName() : string - { - return $this->name; - } - - public function setName(string $name) - { - $this->name = $name; - } - - public function getValues() : array - { - return $this->values; - } - - public function replaceNestedDefinitions(callable $replacer) - { - $this->values = array_map($replacer, $this->values); - } - - public function __toString() - { - $str = '[' . \PHP_EOL; - - foreach ($this->values as $key => $value) { - if (is_string($key)) { - $key = "'" . $key . "'"; - } - - $str .= ' ' . $key . ' => '; - - if ($value instanceof Definition) { - $str .= str_replace(\PHP_EOL, \PHP_EOL . ' ', (string) $value); - } else { - $str .= var_export($value, true); - } - - $str .= ',' . \PHP_EOL; - } - - return $str . ']'; - } -} diff --git a/system/vendor/php-di/php-di/src/Definition/ArrayDefinitionExtension.php b/system/vendor/php-di/php-di/src/Definition/ArrayDefinitionExtension.php deleted file mode 100644 index b494873..0000000 --- a/system/vendor/php-di/php-di/src/Definition/ArrayDefinitionExtension.php +++ /dev/null @@ -1,42 +0,0 @@ - - */ -class ArrayDefinitionExtension extends ArrayDefinition implements ExtendsPreviousDefinition -{ - /** - * @var ArrayDefinition - */ - private $subDefinition; - - public function getValues() : array - { - if (! $this->subDefinition) { - return parent::getValues(); - } - - return array_merge($this->subDefinition->getValues(), parent::getValues()); - } - - public function setExtendedDefinition(Definition $definition) - { - if (! $definition instanceof ArrayDefinition) { - throw new InvalidDefinition(sprintf( - 'Definition %s tries to add array entries but the previous definition is not an array', - $this->getName() - )); - } - - $this->subDefinition = $definition; - } -} diff --git a/system/vendor/php-di/php-di/src/Definition/AutowireDefinition.php b/system/vendor/php-di/php-di/src/Definition/AutowireDefinition.php deleted file mode 100644 index 25dc3ec..0000000 --- a/system/vendor/php-di/php-di/src/Definition/AutowireDefinition.php +++ /dev/null @@ -1,12 +0,0 @@ - - */ -class AutowireDefinition extends ObjectDefinition -{ -} diff --git a/system/vendor/php-di/php-di/src/Definition/DecoratorDefinition.php b/system/vendor/php-di/php-di/src/Definition/DecoratorDefinition.php deleted file mode 100644 index 4489485..0000000 --- a/system/vendor/php-di/php-di/src/Definition/DecoratorDefinition.php +++ /dev/null @@ -1,42 +0,0 @@ - - */ -class DecoratorDefinition extends FactoryDefinition implements Definition, ExtendsPreviousDefinition -{ - /** - * @var Definition|null - */ - private $decorated; - - public function setExtendedDefinition(Definition $definition) - { - $this->decorated = $definition; - } - - /** - * @return Definition|null - */ - public function getDecoratedDefinition() - { - return $this->decorated; - } - - public function replaceNestedDefinitions(callable $replacer) - { - // no nested definitions - } - - public function __toString() - { - return 'Decorate(' . $this->getName() . ')'; - } -} diff --git a/system/vendor/php-di/php-di/src/Definition/Definition.php b/system/vendor/php-di/php-di/src/Definition/Definition.php deleted file mode 100644 index 696838d..0000000 --- a/system/vendor/php-di/php-di/src/Definition/Definition.php +++ /dev/null @@ -1,37 +0,0 @@ - - */ -interface Definition extends RequestedEntry -{ - /** - * Returns the name of the entry in the container. - */ - public function getName() : string; - - /** - * Set the name of the entry in the container. - */ - public function setName(string $name); - - /** - * Apply a callable that replaces the definitions nested in this definition. - */ - public function replaceNestedDefinitions(callable $replacer); - - /** - * Definitions can be cast to string for debugging information. - */ - public function __toString(); -} diff --git a/system/vendor/php-di/php-di/src/Definition/Dumper/ObjectDefinitionDumper.php b/system/vendor/php-di/php-di/src/Definition/Dumper/ObjectDefinitionDumper.php deleted file mode 100644 index b99695f..0000000 --- a/system/vendor/php-di/php-di/src/Definition/Dumper/ObjectDefinitionDumper.php +++ /dev/null @@ -1,135 +0,0 @@ - - */ -class ObjectDefinitionDumper -{ - /** - * Returns the definition as string representation. - */ - public function dump(ObjectDefinition $definition) : string - { - $className = $definition->getClassName(); - $classExist = class_exists($className) || interface_exists($className); - - // Class - if (! $classExist) { - $warning = '#UNKNOWN# '; - } else { - $class = new \ReflectionClass($className); - $warning = $class->isInstantiable() ? '' : '#NOT INSTANTIABLE# '; - } - $str = sprintf(' class = %s%s', $warning, $className); - - // Lazy - $str .= \PHP_EOL . ' lazy = ' . var_export($definition->isLazy(), true); - - if ($classExist) { - // Constructor - $str .= $this->dumpConstructor($className, $definition); - - // Properties - $str .= $this->dumpProperties($definition); - - // Methods - $str .= $this->dumpMethods($className, $definition); - } - - return sprintf('Object (' . \PHP_EOL . '%s' . \PHP_EOL . ')', $str); - } - - private function dumpConstructor(string $className, ObjectDefinition $definition) : string - { - $str = ''; - - $constructorInjection = $definition->getConstructorInjection(); - - if ($constructorInjection !== null) { - $parameters = $this->dumpMethodParameters($className, $constructorInjection); - - $str .= sprintf(\PHP_EOL . ' __construct(' . \PHP_EOL . ' %s' . \PHP_EOL . ' )', $parameters); - } - - return $str; - } - - private function dumpProperties(ObjectDefinition $definition) : string - { - $str = ''; - - foreach ($definition->getPropertyInjections() as $propertyInjection) { - $value = $propertyInjection->getValue(); - $valueStr = $value instanceof Definition ? (string) $value : var_export($value, true); - - $str .= sprintf(\PHP_EOL . ' $%s = %s', $propertyInjection->getPropertyName(), $valueStr); - } - - return $str; - } - - private function dumpMethods(string $className, ObjectDefinition $definition) : string - { - $str = ''; - - foreach ($definition->getMethodInjections() as $methodInjection) { - $parameters = $this->dumpMethodParameters($className, $methodInjection); - - $str .= sprintf(\PHP_EOL . ' %s(' . \PHP_EOL . ' %s' . \PHP_EOL . ' )', $methodInjection->getMethodName(), $parameters); - } - - return $str; - } - - private function dumpMethodParameters(string $className, MethodInjection $methodInjection) : string - { - $methodReflection = new \ReflectionMethod($className, $methodInjection->getMethodName()); - - $args = []; - - $definitionParameters = $methodInjection->getParameters(); - - foreach ($methodReflection->getParameters() as $index => $parameter) { - if (array_key_exists($index, $definitionParameters)) { - $value = $definitionParameters[$index]; - $valueStr = $value instanceof Definition ? (string) $value : var_export($value, true); - - $args[] = sprintf('$%s = %s', $parameter->getName(), $valueStr); - - continue; - } - - // If the parameter is optional and wasn't specified, we take its default value - if ($parameter->isOptional()) { - try { - $value = $parameter->getDefaultValue(); - - $args[] = sprintf( - '$%s = (default value) %s', - $parameter->getName(), - var_export($value, true) - ); - continue; - } catch (ReflectionException $e) { - // The default value can't be read through Reflection because it is a PHP internal class - } - } - - $args[] = sprintf('$%s = #UNDEFINED#', $parameter->getName()); - } - - return implode(\PHP_EOL . ' ', $args); - } -} diff --git a/system/vendor/php-di/php-di/src/Definition/EnvironmentVariableDefinition.php b/system/vendor/php-di/php-di/src/Definition/EnvironmentVariableDefinition.php deleted file mode 100644 index b2a80c3..0000000 --- a/system/vendor/php-di/php-di/src/Definition/EnvironmentVariableDefinition.php +++ /dev/null @@ -1,112 +0,0 @@ - - */ -class EnvironmentVariableDefinition implements Definition -{ - /** - * Entry name. - * @var string - */ - private $name = ''; - - /** - * The name of the environment variable. - * @var string - */ - private $variableName; - - /** - * Whether or not the environment variable definition is optional. - * - * If true and the environment variable given by $variableName has not been - * defined, $defaultValue is used. - * - * @var bool - */ - private $isOptional; - - /** - * The default value to use if the environment variable is optional and not provided. - * @var mixed - */ - private $defaultValue; - - /** - * @param string $variableName The name of the environment variable - * @param bool $isOptional Whether or not the environment variable definition is optional - * @param mixed $defaultValue The default value to use if the environment variable is optional and not provided - */ - public function __construct(string $variableName, bool $isOptional = false, $defaultValue = null) - { - $this->variableName = $variableName; - $this->isOptional = $isOptional; - $this->defaultValue = $defaultValue; - } - - public function getName() : string - { - return $this->name; - } - - public function setName(string $name) - { - $this->name = $name; - } - - /** - * @return string The name of the environment variable - */ - public function getVariableName() : string - { - return $this->variableName; - } - - /** - * @return bool Whether or not the environment variable definition is optional - */ - public function isOptional() : bool - { - return $this->isOptional; - } - - /** - * @return mixed The default value to use if the environment variable is optional and not provided - */ - public function getDefaultValue() - { - return $this->defaultValue; - } - - public function replaceNestedDefinitions(callable $replacer) - { - $this->defaultValue = $replacer($this->defaultValue); - } - - public function __toString() - { - $str = ' variable = ' . $this->variableName . \PHP_EOL - . ' optional = ' . ($this->isOptional ? 'yes' : 'no'); - - if ($this->isOptional) { - if ($this->defaultValue instanceof Definition) { - $nestedDefinition = (string) $this->defaultValue; - $defaultValueStr = str_replace(\PHP_EOL, \PHP_EOL . ' ', $nestedDefinition); - } else { - $defaultValueStr = var_export($this->defaultValue, true); - } - - $str .= \PHP_EOL . ' default = ' . $defaultValueStr; - } - - return sprintf('Environment variable (' . \PHP_EOL . '%s' . \PHP_EOL . ')', $str); - } -} diff --git a/system/vendor/php-di/php-di/src/Definition/Exception/InvalidAnnotation.php b/system/vendor/php-di/php-di/src/Definition/Exception/InvalidAnnotation.php deleted file mode 100644 index 630c34a..0000000 --- a/system/vendor/php-di/php-di/src/Definition/Exception/InvalidAnnotation.php +++ /dev/null @@ -1,14 +0,0 @@ - - */ -class InvalidAnnotation extends InvalidDefinition -{ -} diff --git a/system/vendor/php-di/php-di/src/Definition/Exception/InvalidDefinition.php b/system/vendor/php-di/php-di/src/Definition/Exception/InvalidDefinition.php deleted file mode 100644 index f00d93e..0000000 --- a/system/vendor/php-di/php-di/src/Definition/Exception/InvalidDefinition.php +++ /dev/null @@ -1,25 +0,0 @@ - - */ -class InvalidDefinition extends \Exception implements ContainerExceptionInterface -{ - public static function create(Definition $definition, string $message, \Exception $previous = null) : self - { - return new self(sprintf( - '%s' . \PHP_EOL . 'Full definition:' . \PHP_EOL . '%s', - $message, - (string) $definition - ), 0, $previous); - } -} diff --git a/system/vendor/php-di/php-di/src/Definition/ExtendsPreviousDefinition.php b/system/vendor/php-di/php-di/src/Definition/ExtendsPreviousDefinition.php deleted file mode 100644 index 0b26933..0000000 --- a/system/vendor/php-di/php-di/src/Definition/ExtendsPreviousDefinition.php +++ /dev/null @@ -1,15 +0,0 @@ - - */ -interface ExtendsPreviousDefinition extends Definition -{ - public function setExtendedDefinition(Definition $definition); -} diff --git a/system/vendor/php-di/php-di/src/Definition/FactoryDefinition.php b/system/vendor/php-di/php-di/src/Definition/FactoryDefinition.php deleted file mode 100644 index ed0936f..0000000 --- a/system/vendor/php-di/php-di/src/Definition/FactoryDefinition.php +++ /dev/null @@ -1,79 +0,0 @@ - - */ -class FactoryDefinition implements Definition -{ - /** - * Entry name. - * @var string - */ - private $name; - - /** - * Callable that returns the value. - * @var callable - */ - private $factory; - - /** - * Factory parameters. - * @var mixed[] - */ - private $parameters = []; - - /** - * @param string $name Entry name - * @param callable $factory Callable that returns the value associated to the entry name. - * @param array $parameters Parameters to be passed to the callable - */ - public function __construct(string $name, $factory, array $parameters = []) - { - $this->name = $name; - $this->factory = $factory; - $this->parameters = $parameters; - } - - public function getName() : string - { - return $this->name; - } - - public function setName(string $name) - { - $this->name = $name; - } - - /** - * @return callable Callable that returns the value associated to the entry name. - */ - public function getCallable() - { - return $this->factory; - } - - /** - * @return array Array containing the parameters to be passed to the callable, indexed by name. - */ - public function getParameters() : array - { - return $this->parameters; - } - - public function replaceNestedDefinitions(callable $replacer) - { - $this->parameters = array_map($replacer, $this->parameters); - } - - public function __toString() - { - return 'Factory'; - } -} diff --git a/system/vendor/php-di/php-di/src/Definition/Helper/AutowireDefinitionHelper.php b/system/vendor/php-di/php-di/src/Definition/Helper/AutowireDefinitionHelper.php deleted file mode 100644 index 8dfa4e2..0000000 --- a/system/vendor/php-di/php-di/src/Definition/Helper/AutowireDefinitionHelper.php +++ /dev/null @@ -1,72 +0,0 @@ - - */ -class AutowireDefinitionHelper extends CreateDefinitionHelper -{ - const DEFINITION_CLASS = AutowireDefinition::class; - - /** - * Defines a value for a specific argument of the constructor. - * - * This method is usually used together with annotations or autowiring, when a parameter - * is not (or cannot be) type-hinted. Using this method instead of constructor() allows to - * avoid defining all the parameters (letting them being resolved using annotations or autowiring) - * and only define one. - * - * @param string|int $parameter Parameter name of position for which the value will be given. - * @param mixed $value Value to give to this parameter. - * - * @return $this - */ - public function constructorParameter($parameter, $value) - { - $this->constructor[$parameter] = $value; - - return $this; - } - - /** - * Defines a method to call and a value for a specific argument. - * - * This method is usually used together with annotations or autowiring, when a parameter - * is not (or cannot be) type-hinted. Using this method instead of method() allows to - * avoid defining all the parameters (letting them being resolved using annotations or - * autowiring) and only define one. - * - * If multiple calls to the method have been configured already (e.g. in a previous definition) - * then this method only overrides the parameter for the *first* call. - * - * @param string $method Name of the method to call. - * @param string|int $parameter Parameter name of position for which the value will be given. - * @param mixed $value Value to give to this parameter. - * - * @return $this - */ - public function methodParameter(string $method, $parameter, $value) - { - // Special case for the constructor - if ($method === '__construct') { - $this->constructor[$parameter] = $value; - - return $this; - } - - if (! isset($this->methods[$method])) { - $this->methods[$method] = [0 => []]; - } - - $this->methods[$method][0][$parameter] = $value; - - return $this; - } -} diff --git a/system/vendor/php-di/php-di/src/Definition/Helper/CreateDefinitionHelper.php b/system/vendor/php-di/php-di/src/Definition/Helper/CreateDefinitionHelper.php deleted file mode 100644 index aeae071..0000000 --- a/system/vendor/php-di/php-di/src/Definition/Helper/CreateDefinitionHelper.php +++ /dev/null @@ -1,202 +0,0 @@ - - */ -class CreateDefinitionHelper implements DefinitionHelper -{ - const DEFINITION_CLASS = ObjectDefinition::class; - - /** - * @var string|null - */ - private $className; - - /** - * @var bool|null - */ - private $lazy; - - /** - * Array of constructor parameters. - * @var array - */ - protected $constructor = []; - - /** - * Array of properties and their value. - * @var array - */ - private $properties = []; - - /** - * Array of methods and their parameters. - * @var array - */ - protected $methods = []; - - /** - * Helper for defining an object. - * - * @param string|null $className Class name of the object. - * If null, the name of the entry (in the container) will be used as class name. - */ - public function __construct(string $className = null) - { - $this->className = $className; - } - - /** - * Define the entry as lazy. - * - * A lazy entry is created only when it is used, a proxy is injected instead. - * - * @return $this - */ - public function lazy() - { - $this->lazy = true; - - return $this; - } - - /** - * Defines the arguments to use to call the constructor. - * - * This method takes a variable number of arguments, example: - * ->constructor($param1, $param2, $param3) - * - * @param mixed... $parameters Parameters to use for calling the constructor of the class. - * - * @return $this - */ - public function constructor(...$parameters) - { - $this->constructor = $parameters; - - return $this; - } - - /** - * Defines a value to inject in a property of the object. - * - * @param string $property Entry in which to inject the value. - * @param mixed $value Value to inject in the property. - * - * @return $this - */ - public function property(string $property, $value) - { - $this->properties[$property] = $value; - - return $this; - } - - /** - * Defines a method to call and the arguments to use. - * - * This method takes a variable number of arguments after the method name, example: - * - * ->method('myMethod', $param1, $param2) - * - * Can be used multiple times to declare multiple calls. - * - * @param string $method Name of the method to call. - * @param mixed... $parameters Parameters to use for calling the method. - * - * @return $this - */ - public function method(string $method, ...$parameters) - { - if (! isset($this->methods[$method])) { - $this->methods[$method] = []; - } - - $this->methods[$method][] = $parameters; - - return $this; - } - - /** - * @return ObjectDefinition - */ - public function getDefinition(string $entryName) : Definition - { - $class = $this::DEFINITION_CLASS; - /** @var ObjectDefinition $definition */ - $definition = new $class($entryName, $this->className); - - if ($this->lazy !== null) { - $definition->setLazy($this->lazy); - } - - if (! empty($this->constructor)) { - $parameters = $this->fixParameters($definition, '__construct', $this->constructor); - $constructorInjection = MethodInjection::constructor($parameters); - $definition->setConstructorInjection($constructorInjection); - } - - if (! empty($this->properties)) { - foreach ($this->properties as $property => $value) { - $definition->addPropertyInjection( - new PropertyInjection($property, $value) - ); - } - } - - if (! empty($this->methods)) { - foreach ($this->methods as $method => $calls) { - foreach ($calls as $parameters) { - $parameters = $this->fixParameters($definition, $method, $parameters); - $methodInjection = new MethodInjection($method, $parameters); - $definition->addMethodInjection($methodInjection); - } - } - } - - return $definition; - } - - /** - * Fixes parameters indexed by the parameter name -> reindex by position. - * - * This is necessary so that merging definitions between sources is possible. - * - * @throws InvalidDefinition - */ - private function fixParameters(ObjectDefinition $definition, string $method, array $parameters) : array - { - $fixedParameters = []; - - foreach ($parameters as $index => $parameter) { - // Parameter indexed by the parameter name, we reindex it with its position - if (is_string($index)) { - $callable = [$definition->getClassName(), $method]; - - try { - $reflectionParameter = new \ReflectionParameter($callable, $index); - } catch (\ReflectionException $e) { - throw InvalidDefinition::create($definition, sprintf("Parameter with name '%s' could not be found. %s.", $index, $e->getMessage())); - } - - $index = $reflectionParameter->getPosition(); - } - - $fixedParameters[$index] = $parameter; - } - - return $fixedParameters; - } -} diff --git a/system/vendor/php-di/php-di/src/Definition/Helper/DefinitionHelper.php b/system/vendor/php-di/php-di/src/Definition/Helper/DefinitionHelper.php deleted file mode 100644 index 327167e..0000000 --- a/system/vendor/php-di/php-di/src/Definition/Helper/DefinitionHelper.php +++ /dev/null @@ -1,20 +0,0 @@ - - */ -interface DefinitionHelper -{ - /** - * @param string $entryName Container entry name - */ - public function getDefinition(string $entryName) : Definition; -} diff --git a/system/vendor/php-di/php-di/src/Definition/Helper/FactoryDefinitionHelper.php b/system/vendor/php-di/php-di/src/Definition/Helper/FactoryDefinitionHelper.php deleted file mode 100644 index 0a22319..0000000 --- a/system/vendor/php-di/php-di/src/Definition/Helper/FactoryDefinitionHelper.php +++ /dev/null @@ -1,75 +0,0 @@ - - */ -class FactoryDefinitionHelper implements DefinitionHelper -{ - /** - * @var callable - */ - private $factory; - - /** - * @var bool - */ - private $decorate; - - /** - * @var array - */ - private $parameters = []; - - /** - * @param callable $factory - * @param bool $decorate Is the factory decorating a previous definition? - */ - public function __construct($factory, bool $decorate = false) - { - $this->factory = $factory; - $this->decorate = $decorate; - } - - /** - * @param string $entryName Container entry name - * @return FactoryDefinition - */ - public function getDefinition(string $entryName) : Definition - { - if ($this->decorate) { - return new DecoratorDefinition($entryName, $this->factory, $this->parameters); - } - - return new FactoryDefinition($entryName, $this->factory, $this->parameters); - } - - /** - * Defines arguments to pass to the factory. - * - * Because factory methods do not yet support annotations or autowiring, this method - * should be used to define all parameters except the ContainerInterface and RequestedEntry. - * - * Multiple calls can be made to the method to override individual values. - * - * @param string $parameter Name or index of the parameter for which the value will be given. - * @param mixed $value Value to give to this parameter. - * - * @return $this - */ - public function parameter(string $parameter, $value) - { - $this->parameters[$parameter] = $value; - - return $this; - } -} diff --git a/system/vendor/php-di/php-di/src/Definition/InstanceDefinition.php b/system/vendor/php-di/php-di/src/Definition/InstanceDefinition.php deleted file mode 100644 index 4c281c6..0000000 --- a/system/vendor/php-di/php-di/src/Definition/InstanceDefinition.php +++ /dev/null @@ -1,69 +0,0 @@ - - */ -class InstanceDefinition implements Definition -{ - /** - * Instance on which to inject dependencies. - * - * @var object - */ - private $instance; - - /** - * @var ObjectDefinition - */ - private $objectDefinition; - - /** - * @param object $instance - */ - public function __construct($instance, ObjectDefinition $objectDefinition) - { - $this->instance = $instance; - $this->objectDefinition = $objectDefinition; - } - - public function getName() : string - { - // Name are superfluous for instance definitions - return ''; - } - - public function setName(string $name) - { - // Name are superfluous for instance definitions - } - - /** - * @return object - */ - public function getInstance() - { - return $this->instance; - } - - public function getObjectDefinition() : ObjectDefinition - { - return $this->objectDefinition; - } - - public function replaceNestedDefinitions(callable $replacer) - { - $this->objectDefinition->replaceNestedDefinitions($replacer); - } - - public function __toString() - { - return 'Instance'; - } -} diff --git a/system/vendor/php-di/php-di/src/Definition/ObjectDefinition.php b/system/vendor/php-di/php-di/src/Definition/ObjectDefinition.php deleted file mode 100644 index 8d8d5b6..0000000 --- a/system/vendor/php-di/php-di/src/Definition/ObjectDefinition.php +++ /dev/null @@ -1,266 +0,0 @@ - - */ -class ObjectDefinition implements Definition -{ - /** - * Entry name (most of the time, same as $classname). - * @var string - */ - private $name; - - /** - * Class name (if null, then the class name is $name). - * @var string|null - */ - protected $className; - - /** - * Constructor parameter injection. - * @var MethodInjection|null - */ - protected $constructorInjection; - - /** - * Property injections. - * @var PropertyInjection[] - */ - protected $propertyInjections = []; - - /** - * Method calls. - * @var MethodInjection[][] - */ - protected $methodInjections = []; - - /** - * @var bool|null - */ - protected $lazy; - - /** - * Store if the class exists. Storing it (in cache) avoids recomputing this. - * - * @var bool - */ - private $classExists; - - /** - * Store if the class is instantiable. Storing it (in cache) avoids recomputing this. - * - * @var bool - */ - private $isInstantiable; - - /** - * @param string $name Entry name - */ - public function __construct(string $name, string $className = null) - { - $this->name = $name; - $this->setClassName($className); - } - - public function getName() : string - { - return $this->name; - } - - public function setName(string $name) - { - $this->name = $name; - } - - public function setClassName(string $className = null) - { - $this->className = $className; - - $this->updateCache(); - } - - public function getClassName() : string - { - if ($this->className !== null) { - return $this->className; - } - - return $this->name; - } - - /** - * @return MethodInjection|null - */ - public function getConstructorInjection() - { - return $this->constructorInjection; - } - - public function setConstructorInjection(MethodInjection $constructorInjection) - { - $this->constructorInjection = $constructorInjection; - } - - public function completeConstructorInjection(MethodInjection $injection) - { - if ($this->constructorInjection !== null) { - // Merge - $this->constructorInjection->merge($injection); - } else { - // Set - $this->constructorInjection = $injection; - } - } - - /** - * @return PropertyInjection[] Property injections - */ - public function getPropertyInjections() : array - { - return $this->propertyInjections; - } - - public function addPropertyInjection(PropertyInjection $propertyInjection) - { - $className = $propertyInjection->getClassName(); - if ($className) { - // Index with the class name to avoid collisions between parent and - // child private properties with the same name - $key = $className . '::' . $propertyInjection->getPropertyName(); - } else { - $key = $propertyInjection->getPropertyName(); - } - - $this->propertyInjections[$key] = $propertyInjection; - } - - /** - * @return MethodInjection[] Method injections - */ - public function getMethodInjections() : array - { - // Return array leafs - $injections = []; - array_walk_recursive($this->methodInjections, function ($injection) use (&$injections) { - $injections[] = $injection; - }); - - return $injections; - } - - public function addMethodInjection(MethodInjection $methodInjection) - { - $method = $methodInjection->getMethodName(); - if (! isset($this->methodInjections[$method])) { - $this->methodInjections[$method] = []; - } - $this->methodInjections[$method][] = $methodInjection; - } - - public function completeFirstMethodInjection(MethodInjection $injection) - { - $method = $injection->getMethodName(); - - if (isset($this->methodInjections[$method][0])) { - // Merge - $this->methodInjections[$method][0]->merge($injection); - } else { - // Set - $this->addMethodInjection($injection); - } - } - - public function setLazy(bool $lazy = null) - { - $this->lazy = $lazy; - } - - public function isLazy() : bool - { - if ($this->lazy !== null) { - return $this->lazy; - } - // Default value - return false; - } - - public function classExists() : bool - { - return $this->classExists; - } - - public function isInstantiable() : bool - { - return $this->isInstantiable; - } - - public function replaceNestedDefinitions(callable $replacer) - { - array_walk($this->propertyInjections, function (PropertyInjection $propertyInjection) use ($replacer) { - $propertyInjection->replaceNestedDefinition($replacer); - }); - - if ($this->constructorInjection) { - $this->constructorInjection->replaceNestedDefinitions($replacer); - } - - array_walk($this->methodInjections, function ($injectionArray) use ($replacer) { - array_walk($injectionArray, function (MethodInjection $methodInjection) use ($replacer) { - $methodInjection->replaceNestedDefinitions($replacer); - }); - }); - } - - /** - * Replaces all the wildcards in the string with the given replacements. - * - * @param string[] $replacements - */ - public function replaceWildcards(array $replacements) - { - $className = $this->getClassName(); - - foreach ($replacements as $replacement) { - $pos = strpos($className, DefinitionArray::WILDCARD); - if ($pos !== false) { - $className = substr_replace($className, $replacement, $pos, 1); - } - } - - $this->setClassName($className); - } - - public function __toString() - { - return (new ObjectDefinitionDumper)->dump($this); - } - - private function updateCache() - { - $className = $this->getClassName(); - - $this->classExists = class_exists($className) || interface_exists($className); - - if (! $this->classExists) { - $this->isInstantiable = false; - - return; - } - - $class = new ReflectionClass($className); - $this->isInstantiable = $class->isInstantiable(); - } -} diff --git a/system/vendor/php-di/php-di/src/Definition/ObjectDefinition/MethodInjection.php b/system/vendor/php-di/php-di/src/Definition/ObjectDefinition/MethodInjection.php deleted file mode 100644 index 5fb67ce..0000000 --- a/system/vendor/php-di/php-di/src/Definition/ObjectDefinition/MethodInjection.php +++ /dev/null @@ -1,86 +0,0 @@ - - */ -class MethodInjection implements Definition -{ - /** - * @var string - */ - private $methodName; - - /** - * @var mixed[] - */ - private $parameters = []; - - public function __construct(string $methodName, array $parameters = []) - { - $this->methodName = $methodName; - $this->parameters = $parameters; - } - - public static function constructor(array $parameters = []) : self - { - return new self('__construct', $parameters); - } - - public function getMethodName() : string - { - return $this->methodName; - } - - /** - * @return mixed[] - */ - public function getParameters() : array - { - return $this->parameters; - } - - /** - * Replace the parameters of the definition by a new array of parameters. - */ - public function replaceParameters(array $parameters) - { - $this->parameters = $parameters; - } - - public function merge(self $definition) - { - // In case of conflicts, the current definition prevails. - $this->parameters = $this->parameters + $definition->parameters; - } - - public function getName() : string - { - return ''; - } - - public function setName(string $name) - { - // The name does not matter for method injections - } - - public function replaceNestedDefinitions(callable $replacer) - { - $this->parameters = array_map($replacer, $this->parameters); - } - - /** - * {@inheritdoc} - */ - public function __toString() - { - return sprintf('method(%s)', $this->methodName); - } -} diff --git a/system/vendor/php-di/php-di/src/Definition/ObjectDefinition/PropertyInjection.php b/system/vendor/php-di/php-di/src/Definition/ObjectDefinition/PropertyInjection.php deleted file mode 100644 index 307ba64..0000000 --- a/system/vendor/php-di/php-di/src/Definition/ObjectDefinition/PropertyInjection.php +++ /dev/null @@ -1,70 +0,0 @@ - - */ -class PropertyInjection -{ - /** - * Property name. - * @var string - */ - private $propertyName; - - /** - * Value that should be injected in the property. - * @var mixed - */ - private $value; - - /** - * Use for injecting in properties of parent classes: the class name - * must be the name of the parent class because private properties - * can be attached to the parent classes, not the one we are resolving. - * @var string|null - */ - private $className; - - /** - * @param string $propertyName Property name - * @param mixed $value Value that should be injected in the property - */ - public function __construct(string $propertyName, $value, string $className = null) - { - $this->propertyName = $propertyName; - $this->value = $value; - $this->className = $className; - } - - public function getPropertyName() : string - { - return $this->propertyName; - } - - /** - * @return mixed Value that should be injected in the property - */ - public function getValue() - { - return $this->value; - } - - /** - * @return string|null - */ - public function getClassName() - { - return $this->className; - } - - public function replaceNestedDefinition(callable $replacer) - { - $this->value = $replacer($this->value); - } -} diff --git a/system/vendor/php-di/php-di/src/Definition/Reference.php b/system/vendor/php-di/php-di/src/Definition/Reference.php deleted file mode 100644 index 5b4597a..0000000 --- a/system/vendor/php-di/php-di/src/Definition/Reference.php +++ /dev/null @@ -1,73 +0,0 @@ - - */ -class Reference implements Definition, SelfResolvingDefinition -{ - /** - * Entry name. - * @var string - */ - private $name = ''; - - /** - * Name of the target entry. - * @var string - */ - private $targetEntryName; - - /** - * @param string $targetEntryName Name of the target entry - */ - public function __construct(string $targetEntryName) - { - $this->targetEntryName = $targetEntryName; - } - - public function getName() : string - { - return $this->name; - } - - public function setName(string $name) - { - $this->name = $name; - } - - public function getTargetEntryName() : string - { - return $this->targetEntryName; - } - - public function resolve(ContainerInterface $container) - { - return $container->get($this->getTargetEntryName()); - } - - public function isResolvable(ContainerInterface $container) : bool - { - return $container->has($this->getTargetEntryName()); - } - - public function replaceNestedDefinitions(callable $replacer) - { - // no nested definitions - } - - public function __toString() - { - return sprintf( - 'get(%s)', - $this->targetEntryName - ); - } -} diff --git a/system/vendor/php-di/php-di/src/Definition/Resolver/ArrayResolver.php b/system/vendor/php-di/php-di/src/Definition/Resolver/ArrayResolver.php deleted file mode 100644 index 30a715b..0000000 --- a/system/vendor/php-di/php-di/src/Definition/Resolver/ArrayResolver.php +++ /dev/null @@ -1,74 +0,0 @@ - - */ -class ArrayResolver implements DefinitionResolver -{ - /** - * @var DefinitionResolver - */ - private $definitionResolver; - - /** - * @param DefinitionResolver $definitionResolver Used to resolve nested definitions. - */ - public function __construct(DefinitionResolver $definitionResolver) - { - $this->definitionResolver = $definitionResolver; - } - - /** - * Resolve an array definition to a value. - * - * An array definition can contain simple values or references to other entries. - * - * @param ArrayDefinition $definition - */ - public function resolve(Definition $definition, array $parameters = []) : array - { - $values = $definition->getValues(); - - // Resolve nested definitions - array_walk_recursive($values, function (& $value, $key) use ($definition) { - if ($value instanceof Definition) { - $value = $this->resolveDefinition($value, $definition, $key); - } - }); - - return $values; - } - - public function isResolvable(Definition $definition, array $parameters = []) : bool - { - return true; - } - - private function resolveDefinition(Definition $value, ArrayDefinition $definition, $key) - { - try { - return $this->definitionResolver->resolve($value); - } catch (DependencyException $e) { - throw $e; - } catch (Exception $e) { - throw new DependencyException(sprintf( - 'Error while resolving %s[%s]. %s', - $definition->getName(), - $key, - $e->getMessage() - ), 0, $e); - } - } -} diff --git a/system/vendor/php-di/php-di/src/Definition/Resolver/DecoratorResolver.php b/system/vendor/php-di/php-di/src/Definition/Resolver/DecoratorResolver.php deleted file mode 100644 index 03585ea..0000000 --- a/system/vendor/php-di/php-di/src/Definition/Resolver/DecoratorResolver.php +++ /dev/null @@ -1,82 +0,0 @@ - - */ -class DecoratorResolver implements DefinitionResolver -{ - /** - * @var ContainerInterface - */ - private $container; - - /** - * @var DefinitionResolver - */ - private $definitionResolver; - - /** - * The resolver needs a container. This container will be passed to the factory as a parameter - * so that the factory can access other entries of the container. - * - * @param DefinitionResolver $definitionResolver Used to resolve nested definitions. - */ - public function __construct(ContainerInterface $container, DefinitionResolver $definitionResolver) - { - $this->container = $container; - $this->definitionResolver = $definitionResolver; - } - - /** - * Resolve a decorator definition to a value. - * - * This will call the callable of the definition and pass it the decorated entry. - * - * @param DecoratorDefinition $definition - */ - public function resolve(Definition $definition, array $parameters = []) - { - $callable = $definition->getCallable(); - - if (! is_callable($callable)) { - throw new InvalidDefinition(sprintf( - 'The decorator "%s" is not callable', - $definition->getName() - )); - } - - $decoratedDefinition = $definition->getDecoratedDefinition(); - - if (! $decoratedDefinition instanceof Definition) { - if (! $definition->getName()) { - throw new InvalidDefinition('Decorators cannot be nested in another definition'); - } - - throw new InvalidDefinition(sprintf( - 'Entry "%s" decorates nothing: no previous definition with the same name was found', - $definition->getName() - )); - } - - $decorated = $this->definitionResolver->resolve($decoratedDefinition, $parameters); - - return call_user_func($callable, $decorated, $this->container); - } - - public function isResolvable(Definition $definition, array $parameters = []) : bool - { - return true; - } -} diff --git a/system/vendor/php-di/php-di/src/Definition/Resolver/DefinitionResolver.php b/system/vendor/php-di/php-di/src/Definition/Resolver/DefinitionResolver.php deleted file mode 100644 index 56b5383..0000000 --- a/system/vendor/php-di/php-di/src/Definition/Resolver/DefinitionResolver.php +++ /dev/null @@ -1,37 +0,0 @@ - - */ -interface DefinitionResolver -{ - /** - * Resolve a definition to a value. - * - * @param Definition $definition Object that defines how the value should be obtained. - * @param array $parameters Optional parameters to use to build the entry. - * - * @throws InvalidDefinition If the definition cannot be resolved. - * - * @return mixed Value obtained from the definition. - */ - public function resolve(Definition $definition, array $parameters = []); - - /** - * Check if a definition can be resolved. - * - * @param Definition $definition Object that defines how the value should be obtained. - * @param array $parameters Optional parameters to use to build the entry. - */ - public function isResolvable(Definition $definition, array $parameters = []) : bool; -} diff --git a/system/vendor/php-di/php-di/src/Definition/Resolver/EnvironmentVariableResolver.php b/system/vendor/php-di/php-di/src/Definition/Resolver/EnvironmentVariableResolver.php deleted file mode 100644 index 77f5b92..0000000 --- a/system/vendor/php-di/php-di/src/Definition/Resolver/EnvironmentVariableResolver.php +++ /dev/null @@ -1,79 +0,0 @@ - - */ -class EnvironmentVariableResolver implements DefinitionResolver -{ - /** - * @var DefinitionResolver - */ - private $definitionResolver; - - /** - * @var callable - */ - private $variableReader; - - public function __construct(DefinitionResolver $definitionResolver, $variableReader = null) - { - $this->definitionResolver = $definitionResolver; - $this->variableReader = $variableReader ?? [$this, 'getEnvVariable']; - } - - /** - * Resolve an environment variable definition to a value. - * - * @param EnvironmentVariableDefinition $definition - */ - public function resolve(Definition $definition, array $parameters = []) - { - $value = call_user_func($this->variableReader, $definition->getVariableName()); - - if (false !== $value) { - return $value; - } - - if (!$definition->isOptional()) { - throw new InvalidDefinition(sprintf( - "The environment variable '%s' has not been defined", - $definition->getVariableName() - )); - } - - $value = $definition->getDefaultValue(); - - // Nested definition - if ($value instanceof Definition) { - return $this->definitionResolver->resolve($value); - } - - return $value; - } - - public function isResolvable(Definition $definition, array $parameters = []) : bool - { - return true; - } - - protected function getEnvVariable(string $variableName) - { - if (isset($_ENV[$variableName])) { - return $_ENV[$variableName]; - } elseif (isset($_SERVER[$variableName])) { - return $_SERVER[$variableName]; - } - - return getenv($variableName); - } -} diff --git a/system/vendor/php-di/php-di/src/Definition/Resolver/FactoryResolver.php b/system/vendor/php-di/php-di/src/Definition/Resolver/FactoryResolver.php deleted file mode 100644 index c36a1aa..0000000 --- a/system/vendor/php-di/php-di/src/Definition/Resolver/FactoryResolver.php +++ /dev/null @@ -1,123 +0,0 @@ - - */ -class FactoryResolver implements DefinitionResolver -{ - /** - * @var ContainerInterface - */ - private $container; - - /** - * @var Invoker|null - */ - private $invoker; - - /** - * @var DefinitionResolver - */ - private $resolver; - - /** - * The resolver needs a container. This container will be passed to the factory as a parameter - * so that the factory can access other entries of the container. - */ - public function __construct(ContainerInterface $container, DefinitionResolver $resolver) - { - $this->container = $container; - $this->resolver = $resolver; - } - - /** - * Resolve a factory definition to a value. - * - * This will call the callable of the definition. - * - * @param FactoryDefinition $definition - */ - public function resolve(Definition $definition, array $parameters = []) - { - if (! $this->invoker) { - $parameterResolver = new ResolverChain([ - new AssociativeArrayResolver, - new FactoryParameterResolver($this->container), - new NumericArrayResolver, - new DefaultValueResolver, - ]); - - $this->invoker = new Invoker($parameterResolver, $this->container); - } - - $callable = $definition->getCallable(); - - try { - $providedParams = [$this->container, $definition]; - $extraParams = $this->resolveExtraParams($definition->getParameters()); - $providedParams = array_merge($providedParams, $extraParams, $parameters); - - return $this->invoker->call($callable, $providedParams); - } catch (NotCallableException $e) { - // Custom error message to help debugging - if (is_string($callable) && class_exists($callable) && method_exists($callable, '__invoke')) { - throw new InvalidDefinition(sprintf( - 'Entry "%s" cannot be resolved: factory %s. Invokable classes cannot be automatically resolved if autowiring is disabled on the container, you need to enable autowiring or define the entry manually.', - $definition->getName(), - $e->getMessage() - )); - } - - throw new InvalidDefinition(sprintf( - 'Entry "%s" cannot be resolved: factory %s', - $definition->getName(), - $e->getMessage() - )); - } catch (NotEnoughParametersException $e) { - throw new InvalidDefinition(sprintf( - 'Entry "%s" cannot be resolved: %s', - $definition->getName(), - $e->getMessage() - )); - } - } - - public function isResolvable(Definition $definition, array $parameters = []) : bool - { - return true; - } - - private function resolveExtraParams(array $params) : array - { - $resolved = []; - foreach ($params as $key => $value) { - // Nested definitions - if ($value instanceof Definition) { - $value = $this->resolver->resolve($value); - } - $resolved[$key] = $value; - } - - return $resolved; - } -} diff --git a/system/vendor/php-di/php-di/src/Definition/Resolver/InstanceInjector.php b/system/vendor/php-di/php-di/src/Definition/Resolver/InstanceInjector.php deleted file mode 100644 index 60ea24a..0000000 --- a/system/vendor/php-di/php-di/src/Definition/Resolver/InstanceInjector.php +++ /dev/null @@ -1,46 +0,0 @@ - - */ -class InstanceInjector extends ObjectCreator -{ - /** - * Injects dependencies on an existing instance. - * - * @param InstanceDefinition $definition - */ - public function resolve(Definition $definition, array $parameters = []) - { - try { - $this->injectMethodsAndProperties($definition->getInstance(), $definition->getObjectDefinition()); - } catch (NotFoundExceptionInterface $e) { - $message = sprintf( - 'Error while injecting dependencies into %s: %s', - get_class($definition->getInstance()), - $e->getMessage() - ); - - throw new DependencyException($message, 0, $e); - } - - return $definition; - } - - public function isResolvable(Definition $definition, array $parameters = []) : bool - { - return true; - } -} diff --git a/system/vendor/php-di/php-di/src/Definition/Resolver/ObjectCreator.php b/system/vendor/php-di/php-di/src/Definition/Resolver/ObjectCreator.php deleted file mode 100644 index 3f1f1e6..0000000 --- a/system/vendor/php-di/php-di/src/Definition/Resolver/ObjectCreator.php +++ /dev/null @@ -1,222 +0,0 @@ - - */ -class ObjectCreator implements DefinitionResolver -{ - /** - * @var ProxyFactory - */ - private $proxyFactory; - - /** - * @var ParameterResolver - */ - private $parameterResolver; - - /** - * @var DefinitionResolver - */ - private $definitionResolver; - - /** - * @param DefinitionResolver $definitionResolver Used to resolve nested definitions. - * @param ProxyFactory $proxyFactory Used to create proxies for lazy injections. - */ - public function __construct( - DefinitionResolver $definitionResolver, - ProxyFactory $proxyFactory - ) { - $this->definitionResolver = $definitionResolver; - $this->proxyFactory = $proxyFactory; - $this->parameterResolver = new ParameterResolver($definitionResolver); - } - - /** - * Resolve a class definition to a value. - * - * This will create a new instance of the class using the injections points defined. - * - * @param ObjectDefinition $definition - * - * @return object|null - */ - public function resolve(Definition $definition, array $parameters = []) - { - // Lazy? - if ($definition->isLazy()) { - return $this->createProxy($definition, $parameters); - } - - return $this->createInstance($definition, $parameters); - } - - /** - * The definition is not resolvable if the class is not instantiable (interface or abstract) - * or if the class doesn't exist. - * - * @param ObjectDefinition $definition - */ - public function isResolvable(Definition $definition, array $parameters = []) : bool - { - return $definition->isInstantiable(); - } - - /** - * Returns a proxy instance. - */ - private function createProxy(ObjectDefinition $definition, array $parameters) : LazyLoadingInterface - { - /** @noinspection PhpUnusedParameterInspection */ - $proxy = $this->proxyFactory->createProxy( - $definition->getClassName(), - function (& $wrappedObject, $proxy, $method, $params, & $initializer) use ($definition, $parameters) { - $wrappedObject = $this->createInstance($definition, $parameters); - $initializer = null; // turning off further lazy initialization - - return true; - } - ); - - return $proxy; - } - - /** - * Creates an instance of the class and injects dependencies.. - * - * @param array $parameters Optional parameters to use to create the instance. - * - * @throws InvalidDefinition - * @throws DependencyException - * @return object - */ - private function createInstance(ObjectDefinition $definition, array $parameters) - { - // Check that the class is instantiable - if (! $definition->isInstantiable()) { - // Check that the class exists - if (! $definition->classExists()) { - throw InvalidDefinition::create($definition, sprintf( - 'Entry "%s" cannot be resolved: the class doesn\'t exist', - $definition->getName() - )); - } - - throw InvalidDefinition::create($definition, sprintf( - 'Entry "%s" cannot be resolved: the class is not instantiable', - $definition->getName() - )); - } - - $classname = $definition->getClassName(); - $classReflection = new ReflectionClass($classname); - - $constructorInjection = $definition->getConstructorInjection(); - - try { - $args = $this->parameterResolver->resolveParameters( - $constructorInjection, - $classReflection->getConstructor(), - $parameters - ); - - $object = new $classname(...$args); - - $this->injectMethodsAndProperties($object, $definition); - } catch (NotFoundExceptionInterface $e) { - throw new DependencyException(sprintf( - 'Error while injecting dependencies into %s: %s', - $classReflection->getName(), - $e->getMessage() - ), 0, $e); - } catch (InvalidDefinition $e) { - throw InvalidDefinition::create($definition, sprintf( - 'Entry "%s" cannot be resolved: %s', - $definition->getName(), - $e->getMessage() - )); - } - - return $object; - } - - protected function injectMethodsAndProperties($object, ObjectDefinition $objectDefinition) - { - // Property injections - foreach ($objectDefinition->getPropertyInjections() as $propertyInjection) { - $this->injectProperty($object, $propertyInjection); - } - - // Method injections - foreach ($objectDefinition->getMethodInjections() as $methodInjection) { - $methodReflection = new \ReflectionMethod($object, $methodInjection->getMethodName()); - $args = $this->parameterResolver->resolveParameters($methodInjection, $methodReflection); - - $methodReflection->invokeArgs($object, $args); - } - } - - /** - * Inject dependencies into properties. - * - * @param object $object Object to inject dependencies into - * @param PropertyInjection $propertyInjection Property injection definition - * - * @throws DependencyException - * @throws InvalidDefinition - */ - private function injectProperty($object, PropertyInjection $propertyInjection) - { - $propertyName = $propertyInjection->getPropertyName(); - - $value = $propertyInjection->getValue(); - - if ($value instanceof Definition) { - try { - $value = $this->definitionResolver->resolve($value); - } catch (DependencyException $e) { - throw $e; - } catch (Exception $e) { - throw new DependencyException(sprintf( - 'Error while injecting in %s::%s. %s', - get_class($object), - $propertyName, - $e->getMessage() - ), 0, $e); - } - } - - self::setPrivatePropertyValue($propertyInjection->getClassName(), $object, $propertyName, $value); - } - - public static function setPrivatePropertyValue(string $className = null, $object, string $propertyName, $propertyValue) - { - $className = $className ?: get_class($object); - - $property = new ReflectionProperty($className, $propertyName); - if (! $property->isPublic()) { - $property->setAccessible(true); - } - $property->setValue($object, $propertyValue); - } -} diff --git a/system/vendor/php-di/php-di/src/Definition/Resolver/ParameterResolver.php b/system/vendor/php-di/php-di/src/Definition/Resolver/ParameterResolver.php deleted file mode 100644 index c9a4640..0000000 --- a/system/vendor/php-di/php-di/src/Definition/Resolver/ParameterResolver.php +++ /dev/null @@ -1,112 +0,0 @@ - - */ -class ParameterResolver -{ - /** - * @var DefinitionResolver - */ - private $definitionResolver; - - /** - * @param DefinitionResolver $definitionResolver Will be used to resolve nested definitions. - */ - public function __construct(DefinitionResolver $definitionResolver) - { - $this->definitionResolver = $definitionResolver; - } - - /** - * @throws InvalidDefinition A parameter has no value defined or guessable. - * @return array Parameters to use to call the function. - */ - public function resolveParameters( - MethodInjection $definition = null, - ReflectionMethod $method = null, - array $parameters = [] - ) { - $args = []; - - if (! $method) { - return $args; - } - - $definitionParameters = $definition ? $definition->getParameters() : []; - - foreach ($method->getParameters() as $index => $parameter) { - if (array_key_exists($parameter->getName(), $parameters)) { - // Look in the $parameters array - $value = &$parameters[$parameter->getName()]; - } elseif (array_key_exists($index, $definitionParameters)) { - // Look in the definition - $value = &$definitionParameters[$index]; - } else { - // If the parameter is optional and wasn't specified, we take its default value - if ($parameter->isDefaultValueAvailable() || $parameter->isOptional()) { - $args[] = $this->getParameterDefaultValue($parameter, $method); - continue; - } - - throw new InvalidDefinition(sprintf( - 'Parameter $%s of %s has no value defined or guessable', - $parameter->getName(), - $this->getFunctionName($method) - )); - } - - // Nested definitions - if ($value instanceof Definition) { - // If the container cannot produce the entry, we can use the default parameter value - if ($parameter->isOptional() && ! $this->definitionResolver->isResolvable($value)) { - $value = $this->getParameterDefaultValue($parameter, $method); - } else { - $value = $this->definitionResolver->resolve($value); - } - } - - $args[] = &$value; - } - - return $args; - } - - /** - * Returns the default value of a function parameter. - * - * @throws InvalidDefinition Can't get default values from PHP internal classes and functions - * @return mixed - */ - private function getParameterDefaultValue(ReflectionParameter $parameter, ReflectionMethod $function) - { - try { - return $parameter->getDefaultValue(); - } catch (\ReflectionException $e) { - throw new InvalidDefinition(sprintf( - 'The parameter "%s" of %s has no type defined or guessable. It has a default value, ' - . 'but the default value can\'t be read through Reflection because it is a PHP internal class.', - $parameter->getName(), - $this->getFunctionName($function) - )); - } - } - - private function getFunctionName(ReflectionMethod $method) : string - { - return $method->getName() . '()'; - } -} diff --git a/system/vendor/php-di/php-di/src/Definition/Resolver/ResolverDispatcher.php b/system/vendor/php-di/php-di/src/Definition/Resolver/ResolverDispatcher.php deleted file mode 100644 index 7c0edcc..0000000 --- a/system/vendor/php-di/php-di/src/Definition/Resolver/ResolverDispatcher.php +++ /dev/null @@ -1,134 +0,0 @@ - - */ -class ResolverDispatcher implements DefinitionResolver -{ - /** - * @var ContainerInterface - */ - private $container; - - /** - * @var ProxyFactory - */ - private $proxyFactory; - - private $arrayResolver; - private $factoryResolver; - private $decoratorResolver; - private $objectResolver; - private $instanceResolver; - private $envVariableResolver; - - public function __construct(ContainerInterface $container, ProxyFactory $proxyFactory) - { - $this->container = $container; - $this->proxyFactory = $proxyFactory; - } - - /** - * Resolve a definition to a value. - * - * @param Definition $definition Object that defines how the value should be obtained. - * @param array $parameters Optional parameters to use to build the entry. - * - * @throws InvalidDefinition If the definition cannot be resolved. - * - * @return mixed Value obtained from the definition. - */ - public function resolve(Definition $definition, array $parameters = []) - { - // Special case, tested early for speed - if ($definition instanceof SelfResolvingDefinition) { - return $definition->resolve($this->container); - } - - $definitionResolver = $this->getDefinitionResolver($definition); - - return $definitionResolver->resolve($definition, $parameters); - } - - public function isResolvable(Definition $definition, array $parameters = []) : bool - { - // Special case, tested early for speed - if ($definition instanceof SelfResolvingDefinition) { - return $definition->isResolvable($this->container); - } - - $definitionResolver = $this->getDefinitionResolver($definition); - - return $definitionResolver->isResolvable($definition, $parameters); - } - - /** - * Returns a resolver capable of handling the given definition. - * - * @throws \RuntimeException No definition resolver was found for this type of definition. - */ - private function getDefinitionResolver(Definition $definition) : DefinitionResolver - { - switch (true) { - case $definition instanceof ObjectDefinition: - if (! $this->objectResolver) { - $this->objectResolver = new ObjectCreator($this, $this->proxyFactory); - } - - return $this->objectResolver; - case $definition instanceof DecoratorDefinition: - if (! $this->decoratorResolver) { - $this->decoratorResolver = new DecoratorResolver($this->container, $this); - } - - return $this->decoratorResolver; - case $definition instanceof FactoryDefinition: - if (! $this->factoryResolver) { - $this->factoryResolver = new FactoryResolver($this->container, $this); - } - - return $this->factoryResolver; - case $definition instanceof ArrayDefinition: - if (! $this->arrayResolver) { - $this->arrayResolver = new ArrayResolver($this); - } - - return $this->arrayResolver; - case $definition instanceof EnvironmentVariableDefinition: - if (! $this->envVariableResolver) { - $this->envVariableResolver = new EnvironmentVariableResolver($this); - } - - return $this->envVariableResolver; - case $definition instanceof InstanceDefinition: - if (! $this->instanceResolver) { - $this->instanceResolver = new InstanceInjector($this, $this->proxyFactory); - } - - return $this->instanceResolver; - default: - throw new \RuntimeException('No definition resolver was configured for definition of type ' . get_class($definition)); - } - } -} diff --git a/system/vendor/php-di/php-di/src/Definition/SelfResolvingDefinition.php b/system/vendor/php-di/php-di/src/Definition/SelfResolvingDefinition.php deleted file mode 100644 index 7452403..0000000 --- a/system/vendor/php-di/php-di/src/Definition/SelfResolvingDefinition.php +++ /dev/null @@ -1,27 +0,0 @@ - - */ -interface SelfResolvingDefinition -{ - /** - * Resolve the definition and return the resulting value. - * - * @return mixed - */ - public function resolve(ContainerInterface $container); - - /** - * Check if a definition can be resolved. - */ - public function isResolvable(ContainerInterface $container) : bool; -} diff --git a/system/vendor/php-di/php-di/src/Definition/Source/AnnotationBasedAutowiring.php b/system/vendor/php-di/php-di/src/Definition/Source/AnnotationBasedAutowiring.php deleted file mode 100644 index ee3273a..0000000 --- a/system/vendor/php-di/php-di/src/Definition/Source/AnnotationBasedAutowiring.php +++ /dev/null @@ -1,297 +0,0 @@ - - */ -class AnnotationBasedAutowiring implements DefinitionSource, Autowiring -{ - /** - * @var Reader - */ - private $annotationReader; - - /** - * @var PhpDocReader - */ - private $phpDocReader; - - /** - * @var bool - */ - private $ignorePhpDocErrors; - - public function __construct($ignorePhpDocErrors = false) - { - $this->ignorePhpDocErrors = (bool) $ignorePhpDocErrors; - } - - public function autowire(string $name, ObjectDefinition $definition = null) - { - $className = $definition ? $definition->getClassName() : $name; - - if (!class_exists($className) && !interface_exists($className)) { - return $definition; - } - - $definition = $definition ?: new ObjectDefinition($name); - - $class = new ReflectionClass($className); - - $this->readInjectableAnnotation($class, $definition); - - // Browse the class properties looking for annotated properties - $this->readProperties($class, $definition); - - // Browse the object's methods looking for annotated methods - $this->readMethods($class, $definition); - - return $definition; - } - - /** - * {@inheritdoc} - * @throws InvalidAnnotation - * @throws InvalidArgumentException The class doesn't exist - */ - public function getDefinition(string $name) - { - return $this->autowire($name); - } - - /** - * Autowiring cannot guess all existing definitions. - */ - public function getDefinitions() : array - { - return []; - } - - /** - * Browse the class properties looking for annotated properties. - */ - private function readProperties(ReflectionClass $class, ObjectDefinition $definition) - { - foreach ($class->getProperties() as $property) { - if ($property->isStatic()) { - continue; - } - $this->readProperty($property, $definition); - } - - // Read also the *private* properties of the parent classes - /** @noinspection PhpAssignmentInConditionInspection */ - while ($class = $class->getParentClass()) { - foreach ($class->getProperties(ReflectionProperty::IS_PRIVATE) as $property) { - if ($property->isStatic()) { - continue; - } - $this->readProperty($property, $definition, $class->getName()); - } - } - } - - private function readProperty(ReflectionProperty $property, ObjectDefinition $definition, $classname = null) - { - // Look for @Inject annotation - $annotation = $this->getAnnotationReader()->getPropertyAnnotation($property, 'DI\Annotation\Inject'); - if (!$annotation instanceof Inject) { - return; - } - - // Try to @Inject("name") or look for @var content - $entryName = $annotation->getName() ?: $this->getPhpDocReader()->getPropertyClass($property); - - // Try using PHP7.4 typed properties - if (\PHP_VERSION_ID > 70400 - && $entryName === null - && $property->getType() instanceof ReflectionNamedType - && (class_exists($property->getType()->getName()) || interface_exists($property->getType()->getName())) - ) { - $entryName = $property->getType()->getName(); - } - - if ($entryName === null) { - throw new InvalidAnnotation(sprintf( - '@Inject found on property %s::%s but unable to guess what to inject, use a @var annotation', - $property->getDeclaringClass()->getName(), - $property->getName() - )); - } - - $definition->addPropertyInjection( - new PropertyInjection($property->getName(), new Reference($entryName), $classname) - ); - } - - /** - * Browse the object's methods looking for annotated methods. - */ - private function readMethods(ReflectionClass $class, ObjectDefinition $objectDefinition) - { - // This will look in all the methods, including those of the parent classes - foreach ($class->getMethods(ReflectionMethod::IS_PUBLIC) as $method) { - if ($method->isStatic()) { - continue; - } - - $methodInjection = $this->getMethodInjection($method); - - if (! $methodInjection) { - continue; - } - - if ($method->isConstructor()) { - $objectDefinition->completeConstructorInjection($methodInjection); - } else { - $objectDefinition->completeFirstMethodInjection($methodInjection); - } - } - } - - /** - * @return MethodInjection|null - */ - private function getMethodInjection(ReflectionMethod $method) - { - // Look for @Inject annotation - try { - $annotation = $this->getAnnotationReader()->getMethodAnnotation($method, 'DI\Annotation\Inject'); - } catch (InvalidAnnotation $e) { - throw new InvalidAnnotation(sprintf( - '@Inject annotation on %s::%s is malformed. %s', - $method->getDeclaringClass()->getName(), - $method->getName(), - $e->getMessage() - ), 0, $e); - } - - // @Inject on constructor is implicit - if (! ($annotation || $method->isConstructor())) { - return null; - } - - $annotationParameters = $annotation instanceof Inject ? $annotation->getParameters() : []; - - $parameters = []; - foreach ($method->getParameters() as $index => $parameter) { - $entryName = $this->getMethodParameter($index, $parameter, $annotationParameters); - - if ($entryName !== null) { - $parameters[$index] = new Reference($entryName); - } - } - - if ($method->isConstructor()) { - return MethodInjection::constructor($parameters); - } - - return new MethodInjection($method->getName(), $parameters); - } - - /** - * @param int $parameterIndex - * - * @return string|null Entry name or null if not found. - */ - private function getMethodParameter($parameterIndex, ReflectionParameter $parameter, array $annotationParameters) - { - // @Inject has definition for this parameter (by index, or by name) - if (isset($annotationParameters[$parameterIndex])) { - return $annotationParameters[$parameterIndex]; - } - if (isset($annotationParameters[$parameter->getName()])) { - return $annotationParameters[$parameter->getName()]; - } - - // Skip optional parameters if not explicitly defined - if ($parameter->isOptional()) { - return null; - } - - // Try to use the type-hinting - $parameterType = $parameter->getType(); - if ($parameterType && $parameterType instanceof ReflectionNamedType && !$parameterType->isBuiltin()) { - return $parameterType->getName(); - } - - // Last resort, look for @param tag - return $this->getPhpDocReader()->getParameterClass($parameter); - } - - /** - * @return Reader The annotation reader - */ - public function getAnnotationReader() - { - if ($this->annotationReader === null) { - AnnotationRegistry::registerLoader('class_exists'); - $this->annotationReader = new SimpleAnnotationReader(); - $this->annotationReader->addNamespace('DI\Annotation'); - } - - return $this->annotationReader; - } - - /** - * @return PhpDocReader - */ - private function getPhpDocReader() - { - if ($this->phpDocReader === null) { - $this->phpDocReader = new PhpDocReader($this->ignorePhpDocErrors); - } - - return $this->phpDocReader; - } - - private function readInjectableAnnotation(ReflectionClass $class, ObjectDefinition $definition) - { - try { - /** @var Injectable|null $annotation */ - $annotation = $this->getAnnotationReader() - ->getClassAnnotation($class, 'DI\Annotation\Injectable'); - } catch (UnexpectedValueException $e) { - throw new InvalidAnnotation(sprintf( - 'Error while reading @Injectable on %s: %s', - $class->getName(), - $e->getMessage() - ), 0, $e); - } - - if (! $annotation) { - return; - } - - if ($annotation->isLazy() !== null) { - $definition->setLazy($annotation->isLazy()); - } - } -} diff --git a/system/vendor/php-di/php-di/src/Definition/Source/Autowiring.php b/system/vendor/php-di/php-di/src/Definition/Source/Autowiring.php deleted file mode 100644 index ae7682a..0000000 --- a/system/vendor/php-di/php-di/src/Definition/Source/Autowiring.php +++ /dev/null @@ -1,24 +0,0 @@ - - */ -interface Autowiring -{ - /** - * Autowire the given definition. - * - * @throws InvalidDefinition An invalid definition was found. - * @return ObjectDefinition|null - */ - public function autowire(string $name, ObjectDefinition $definition = null); -} diff --git a/system/vendor/php-di/php-di/src/Definition/Source/DefinitionArray.php b/system/vendor/php-di/php-di/src/Definition/Source/DefinitionArray.php deleted file mode 100644 index 88f2cac..0000000 --- a/system/vendor/php-di/php-di/src/Definition/Source/DefinitionArray.php +++ /dev/null @@ -1,127 +0,0 @@ - - */ -class DefinitionArray implements DefinitionSource, MutableDefinitionSource -{ - const WILDCARD = '*'; - /** - * Matches anything except "\". - */ - const WILDCARD_PATTERN = '([^\\\\]+)'; - - /** - * DI definitions in a PHP array. - * @var array - */ - private $definitions = []; - - /** - * Cache of wildcard definitions. - * @var array|null - */ - private $wildcardDefinitions; - - /** - * @var DefinitionNormalizer - */ - private $normalizer; - - public function __construct(array $definitions = [], Autowiring $autowiring = null) - { - if (isset($definitions[0])) { - throw new \Exception('The PHP-DI definition is not indexed by an entry name in the definition array'); - } - - $this->definitions = $definitions; - - $autowiring = $autowiring ?: new NoAutowiring; - $this->normalizer = new DefinitionNormalizer($autowiring); - } - - /** - * @param array $definitions DI definitions in a PHP array indexed by the definition name. - */ - public function addDefinitions(array $definitions) - { - if (isset($definitions[0])) { - throw new \Exception('The PHP-DI definition is not indexed by an entry name in the definition array'); - } - - // The newly added data prevails - // "for keys that exist in both arrays, the elements from the left-hand array will be used" - $this->definitions = $definitions + $this->definitions; - - // Clear cache - $this->wildcardDefinitions = null; - } - - /** - * {@inheritdoc} - */ - public function addDefinition(Definition $definition) - { - $this->definitions[$definition->getName()] = $definition; - - // Clear cache - $this->wildcardDefinitions = null; - } - - public function getDefinition(string $name) - { - // Look for the definition by name - if (array_key_exists($name, $this->definitions)) { - $definition = $this->definitions[$name]; - $definition = $this->normalizer->normalizeRootDefinition($definition, $name); - - return $definition; - } - - // Build the cache of wildcard definitions - if ($this->wildcardDefinitions === null) { - $this->wildcardDefinitions = []; - foreach ($this->definitions as $key => $definition) { - if (strpos($key, self::WILDCARD) !== false) { - $this->wildcardDefinitions[$key] = $definition; - } - } - } - - // Look in wildcards definitions - foreach ($this->wildcardDefinitions as $key => $definition) { - // Turn the pattern into a regex - $key = preg_quote($key); - $key = '#' . str_replace('\\' . self::WILDCARD, self::WILDCARD_PATTERN, $key) . '#'; - if (preg_match($key, $name, $matches) === 1) { - array_shift($matches); - $definition = $this->normalizer->normalizeRootDefinition($definition, $name, $matches); - - return $definition; - } - } - - return null; - } - - public function getDefinitions() : array - { - // Return all definitions except wildcard definitions - $definitions = []; - foreach ($this->definitions as $key => $definition) { - if (strpos($key, self::WILDCARD) === false) { - $definitions[$key] = $definition; - } - } - - return $definitions; - } -} diff --git a/system/vendor/php-di/php-di/src/Definition/Source/DefinitionFile.php b/system/vendor/php-di/php-di/src/Definition/Source/DefinitionFile.php deleted file mode 100644 index 0c6caff..0000000 --- a/system/vendor/php-di/php-di/src/Definition/Source/DefinitionFile.php +++ /dev/null @@ -1,69 +0,0 @@ - - */ -class DefinitionFile extends DefinitionArray -{ - /** - * @var bool - */ - private $initialized = false; - - /** - * File containing definitions, or null if the definitions are given as a PHP array. - * @var string|null - */ - private $file; - - /** - * @param string $file File in which the definitions are returned as an array. - */ - public function __construct($file, Autowiring $autowiring = null) - { - // Lazy-loading to improve performances - $this->file = $file; - - parent::__construct([], $autowiring); - } - - public function getDefinition(string $name) - { - $this->initialize(); - - return parent::getDefinition($name); - } - - public function getDefinitions() : array - { - $this->initialize(); - - return parent::getDefinitions(); - } - - /** - * Lazy-loading of the definitions. - */ - private function initialize() - { - if ($this->initialized === true) { - return; - } - - $definitions = require $this->file; - - if (! is_array($definitions)) { - throw new \Exception("File {$this->file} should return an array of definitions"); - } - - $this->addDefinitions($definitions); - - $this->initialized = true; - } -} diff --git a/system/vendor/php-di/php-di/src/Definition/Source/DefinitionNormalizer.php b/system/vendor/php-di/php-di/src/Definition/Source/DefinitionNormalizer.php deleted file mode 100644 index 99ea36b..0000000 --- a/system/vendor/php-di/php-di/src/Definition/Source/DefinitionNormalizer.php +++ /dev/null @@ -1,120 +0,0 @@ - - */ -class DefinitionNormalizer -{ - /** - * @var Autowiring - */ - private $autowiring; - - public function __construct(Autowiring $autowiring) - { - $this->autowiring = $autowiring; - } - - /** - * Normalize a definition that is *not* nested in another one. - * - * This is usually a definition declared at the root of a definition array. - * - * @param mixed $definition - * @param string $name The definition name. - * @param string[] $wildcardsReplacements Replacements for wildcard definitions. - * - * @throws InvalidDefinition - */ - public function normalizeRootDefinition($definition, string $name, array $wildcardsReplacements = null) : Definition - { - if ($definition instanceof DefinitionHelper) { - $definition = $definition->getDefinition($name); - } elseif (is_array($definition)) { - $definition = new ArrayDefinition($definition); - } elseif ($definition instanceof \Closure) { - $definition = new FactoryDefinition($name, $definition); - } elseif (! $definition instanceof Definition) { - $definition = new ValueDefinition($definition); - } - - // For a class definition, we replace * in the class name with the matches - // *Interface -> *Impl => FooInterface -> FooImpl - if ($wildcardsReplacements && $definition instanceof ObjectDefinition) { - $definition->replaceWildcards($wildcardsReplacements); - } - - if ($definition instanceof AutowireDefinition) { - $definition = $this->autowiring->autowire($name, $definition); - } - - $definition->setName($name); - - try { - $definition->replaceNestedDefinitions([$this, 'normalizeNestedDefinition']); - } catch (InvalidDefinition $e) { - throw InvalidDefinition::create($definition, sprintf( - 'Definition "%s" contains an error: %s', - $definition->getName(), - $e->getMessage() - ), $e); - } - - return $definition; - } - - /** - * Normalize a definition that is nested in another one. - * - * @param mixed $definition - * @return mixed - * - * @throws InvalidDefinition - */ - public function normalizeNestedDefinition($definition) - { - $name = ''; - - if ($definition instanceof DefinitionHelper) { - $definition = $definition->getDefinition($name); - } elseif (is_array($definition)) { - $definition = new ArrayDefinition($definition); - } elseif ($definition instanceof \Closure) { - $definition = new FactoryDefinition($name, $definition); - } - - if ($definition instanceof DecoratorDefinition) { - throw new InvalidDefinition('Decorators cannot be nested in another definition'); - } - - if ($definition instanceof AutowireDefinition) { - $definition = $this->autowiring->autowire($name, $definition); - } - - if ($definition instanceof Definition) { - $definition->setName($name); - - // Recursively traverse nested definitions - $definition->replaceNestedDefinitions([$this, 'normalizeNestedDefinition']); - } - - return $definition; - } -} diff --git a/system/vendor/php-di/php-di/src/Definition/Source/DefinitionSource.php b/system/vendor/php-di/php-di/src/Definition/Source/DefinitionSource.php deleted file mode 100644 index 5aa95dd..0000000 --- a/system/vendor/php-di/php-di/src/Definition/Source/DefinitionSource.php +++ /dev/null @@ -1,29 +0,0 @@ - - */ -interface DefinitionSource -{ - /** - * Returns the DI definition for the entry name. - * - * @throws InvalidDefinition An invalid definition was found. - * @return Definition|null - */ - public function getDefinition(string $name); - - /** - * @return Definition[] Definitions indexed by their name. - */ - public function getDefinitions() : array; -} diff --git a/system/vendor/php-di/php-di/src/Definition/Source/MutableDefinitionSource.php b/system/vendor/php-di/php-di/src/Definition/Source/MutableDefinitionSource.php deleted file mode 100644 index 0422174..0000000 --- a/system/vendor/php-di/php-di/src/Definition/Source/MutableDefinitionSource.php +++ /dev/null @@ -1,17 +0,0 @@ - - */ -interface MutableDefinitionSource extends DefinitionSource -{ - public function addDefinition(Definition $definition); -} diff --git a/system/vendor/php-di/php-di/src/Definition/Source/NoAutowiring.php b/system/vendor/php-di/php-di/src/Definition/Source/NoAutowiring.php deleted file mode 100644 index dda3e30..0000000 --- a/system/vendor/php-di/php-di/src/Definition/Source/NoAutowiring.php +++ /dev/null @@ -1,24 +0,0 @@ - - */ -class NoAutowiring implements Autowiring -{ - public function autowire(string $name, ObjectDefinition $definition = null) - { - throw new InvalidDefinition(sprintf( - 'Cannot autowire entry "%s" because autowiring is disabled', - $name - )); - } -} diff --git a/system/vendor/php-di/php-di/src/Definition/Source/ReflectionBasedAutowiring.php b/system/vendor/php-di/php-di/src/Definition/Source/ReflectionBasedAutowiring.php deleted file mode 100644 index fdc3748..0000000 --- a/system/vendor/php-di/php-di/src/Definition/Source/ReflectionBasedAutowiring.php +++ /dev/null @@ -1,85 +0,0 @@ - - */ -class ReflectionBasedAutowiring implements DefinitionSource, Autowiring -{ - public function autowire(string $name, ObjectDefinition $definition = null) - { - $className = $definition ? $definition->getClassName() : $name; - - if (!class_exists($className) && !interface_exists($className)) { - return $definition; - } - - $definition = $definition ?: new ObjectDefinition($name); - - // Constructor - $class = new \ReflectionClass($className); - $constructor = $class->getConstructor(); - if ($constructor && $constructor->isPublic()) { - $constructorInjection = MethodInjection::constructor($this->getParametersDefinition($constructor)); - $definition->completeConstructorInjection($constructorInjection); - } - - return $definition; - } - - public function getDefinition(string $name) - { - return $this->autowire($name); - } - - /** - * Autowiring cannot guess all existing definitions. - */ - public function getDefinitions() : array - { - return []; - } - - /** - * Read the type-hinting from the parameters of the function. - */ - private function getParametersDefinition(\ReflectionFunctionAbstract $constructor) : array - { - $parameters = []; - - foreach ($constructor->getParameters() as $index => $parameter) { - // Skip optional parameters - if ($parameter->isOptional()) { - continue; - } - - $parameterType = $parameter->getType(); - if (!$parameterType) { - // No type - continue; - } - if (!$parameterType instanceof ReflectionNamedType) { - // Union types are not supported - continue; - } - if ($parameterType->isBuiltin()) { - // Primitive types are not supported - continue; - } - - $parameters[$index] = new Reference($parameterType->getName()); - } - - return $parameters; - } -} diff --git a/system/vendor/php-di/php-di/src/Definition/Source/SourceCache.php b/system/vendor/php-di/php-di/src/Definition/Source/SourceCache.php deleted file mode 100644 index 6487c2c..0000000 --- a/system/vendor/php-di/php-di/src/Definition/Source/SourceCache.php +++ /dev/null @@ -1,88 +0,0 @@ - - */ -class SourceCache implements DefinitionSource, MutableDefinitionSource -{ - /** - * @var string - */ - const CACHE_KEY = 'php-di.definitions.'; - - /** - * @var DefinitionSource - */ - private $cachedSource; - - /** - * @var string - */ - private $cacheNamespace; - - public function __construct(DefinitionSource $cachedSource, string $cacheNamespace = '') - { - $this->cachedSource = $cachedSource; - $this->cacheNamespace = $cacheNamespace; - } - - public function getDefinition(string $name) - { - $definition = apcu_fetch($this->getCacheKey($name)); - - if ($definition === false) { - $definition = $this->cachedSource->getDefinition($name); - - // Update the cache - if ($this->shouldBeCached($definition)) { - apcu_store($this->getCacheKey($name), $definition); - } - } - - return $definition; - } - - /** - * Used only for the compilation so we can skip the cache safely. - */ - public function getDefinitions() : array - { - return $this->cachedSource->getDefinitions(); - } - - public static function isSupported() : bool - { - return function_exists('apcu_fetch') - && ini_get('apc.enabled') - && ! ('cli' === \PHP_SAPI && ! ini_get('apc.enable_cli')); - } - - public function getCacheKey(string $name) : string - { - return self::CACHE_KEY . $this->cacheNamespace . $name; - } - - public function addDefinition(Definition $definition) - { - throw new \LogicException('You cannot set a definition at runtime on a container that has caching enabled. Doing so would risk caching the definition for the next execution, where it might be different. You can either put your definitions in a file, remove the cache or ->set() a raw value directly (PHP object, string, int, ...) instead of a PHP-DI definition.'); - } - - private function shouldBeCached(Definition $definition = null) : bool - { - return - // Cache missing definitions - ($definition === null) - // Object definitions are used with `make()` - || ($definition instanceof ObjectDefinition) - // Autowired definitions cannot be all compiled and are used with `make()` - || ($definition instanceof AutowireDefinition); - } -} diff --git a/system/vendor/php-di/php-di/src/Definition/Source/SourceChain.php b/system/vendor/php-di/php-di/src/Definition/Source/SourceChain.php deleted file mode 100644 index b82d618..0000000 --- a/system/vendor/php-di/php-di/src/Definition/Source/SourceChain.php +++ /dev/null @@ -1,110 +0,0 @@ - - */ -class SourceChain implements DefinitionSource, MutableDefinitionSource -{ - /** - * @var DefinitionSource[] - */ - private $sources; - - /** - * @var DefinitionSource - */ - private $rootSource; - - /** - * @var MutableDefinitionSource|null - */ - private $mutableSource; - - /** - * @param DefinitionSource[] $sources - */ - public function __construct(array $sources) - { - // We want a numerically indexed array to ease the traversal later - $this->sources = array_values($sources); - $this->rootSource = $this; - } - - /** - * {@inheritdoc} - * - * @param int $startIndex Use this parameter to start looking from a specific - * point in the source chain. - */ - public function getDefinition(string $name, int $startIndex = 0) - { - $count = count($this->sources); - for ($i = $startIndex; $i < $count; ++$i) { - $source = $this->sources[$i]; - - $definition = $source->getDefinition($name); - - if ($definition) { - if ($definition instanceof ExtendsPreviousDefinition) { - $this->resolveExtendedDefinition($definition, $i); - } - - return $definition; - } - } - - return null; - } - - public function getDefinitions() : array - { - $names = []; - foreach ($this->sources as $source) { - $names = array_merge($names, $source->getDefinitions()); - } - $names = array_keys($names); - - $definitions = array_combine($names, array_map(function (string $name) { - return $this->getDefinition($name); - }, $names)); - - return $definitions; - } - - public function addDefinition(Definition $definition) - { - if (! $this->mutableSource) { - throw new \LogicException("The container's definition source has not been initialized correctly"); - } - - $this->mutableSource->addDefinition($definition); - } - - private function resolveExtendedDefinition(ExtendsPreviousDefinition $definition, int $currentIndex) - { - // Look in the next sources only (else infinite recursion, and we can only extend - // entries defined in the previous definition files - a previous == next here because - // the array was reversed ;) ) - $subDefinition = $this->getDefinition($definition->getName(), $currentIndex + 1); - - if ($subDefinition) { - $definition->setExtendedDefinition($subDefinition); - } - } - - public function setMutableDefinitionSource(MutableDefinitionSource $mutableSource) - { - $this->mutableSource = $mutableSource; - - array_unshift($this->sources, $mutableSource); - } -} diff --git a/system/vendor/php-di/php-di/src/Definition/StringDefinition.php b/system/vendor/php-di/php-di/src/Definition/StringDefinition.php deleted file mode 100644 index 52207e7..0000000 --- a/system/vendor/php-di/php-di/src/Definition/StringDefinition.php +++ /dev/null @@ -1,97 +0,0 @@ - - */ -class StringDefinition implements Definition, SelfResolvingDefinition -{ - /** - * Entry name. - * @var string - */ - private $name = ''; - - /** - * @var string - */ - private $expression; - - public function __construct(string $expression) - { - $this->expression = $expression; - } - - public function getName() : string - { - return $this->name; - } - - public function setName(string $name) - { - $this->name = $name; - } - - public function getExpression() : string - { - return $this->expression; - } - - public function resolve(ContainerInterface $container) : string - { - return self::resolveExpression($this->name, $this->expression, $container); - } - - public function isResolvable(ContainerInterface $container) : bool - { - return true; - } - - public function replaceNestedDefinitions(callable $replacer) - { - // no nested definitions - } - - public function __toString() - { - return $this->expression; - } - - /** - * Resolve a string expression. - */ - public static function resolveExpression( - string $entryName, - string $expression, - ContainerInterface $container - ) : string { - $callback = function (array $matches) use ($entryName, $container) { - try { - return $container->get($matches[1]); - } catch (NotFoundExceptionInterface $e) { - throw new DependencyException(sprintf( - "Error while parsing string expression for entry '%s': %s", - $entryName, - $e->getMessage() - ), 0, $e); - } - }; - - $result = preg_replace_callback('#\{([^\{\}]+)\}#', $callback, $expression); - if ($result === null) { - throw new \RuntimeException(sprintf('An unknown error occurred while parsing the string definition: \'%s\'', $expression)); - } - - return $result; - } -} diff --git a/system/vendor/php-di/php-di/src/Definition/ValueDefinition.php b/system/vendor/php-di/php-di/src/Definition/ValueDefinition.php deleted file mode 100644 index d647582..0000000 --- a/system/vendor/php-di/php-di/src/Definition/ValueDefinition.php +++ /dev/null @@ -1,72 +0,0 @@ - - */ -class ValueDefinition implements Definition, SelfResolvingDefinition -{ - /** - * Entry name. - * @var string - */ - private $name = ''; - - /** - * @var mixed - */ - private $value; - - /** - * @param mixed $value - */ - public function __construct($value) - { - $this->value = $value; - } - - public function getName() : string - { - return $this->name; - } - - public function setName(string $name) - { - $this->name = $name; - } - - /** - * @return mixed - */ - public function getValue() - { - return $this->value; - } - - public function resolve(ContainerInterface $container) - { - return $this->getValue(); - } - - public function isResolvable(ContainerInterface $container) : bool - { - return true; - } - - public function replaceNestedDefinitions(callable $replacer) - { - // no nested definitions - } - - public function __toString() - { - return sprintf('Value (%s)', var_export($this->value, true)); - } -} diff --git a/system/vendor/php-di/php-di/src/DependencyException.php b/system/vendor/php-di/php-di/src/DependencyException.php deleted file mode 100644 index 63b5fdd..0000000 --- a/system/vendor/php-di/php-di/src/DependencyException.php +++ /dev/null @@ -1,14 +0,0 @@ - - */ -interface RequestedEntry -{ - /** - * Returns the name of the entry that was requested by the container. - */ - public function getName() : string; -} diff --git a/system/vendor/php-di/php-di/src/FactoryInterface.php b/system/vendor/php-di/php-di/src/FactoryInterface.php deleted file mode 100644 index 59b410f..0000000 --- a/system/vendor/php-di/php-di/src/FactoryInterface.php +++ /dev/null @@ -1,31 +0,0 @@ - - */ -interface FactoryInterface -{ - /** - * Resolves an entry by its name. If given a class name, it will return a new instance of that class. - * - * @param string $name Entry name or a class name. - * @param array $parameters Optional parameters to use to build the entry. Use this to force specific - * parameters to specific values. Parameters not defined in this array will - * be automatically resolved. - * - * @throws \InvalidArgumentException The name parameter must be of type string. - * @throws DependencyException Error while resolving the entry. - * @throws NotFoundException No entry or class found for the given name. - * @return mixed - */ - public function make($name, array $parameters = []); -} diff --git a/system/vendor/php-di/php-di/src/Invoker/DefinitionParameterResolver.php b/system/vendor/php-di/php-di/src/Invoker/DefinitionParameterResolver.php deleted file mode 100644 index b17ebd9..0000000 --- a/system/vendor/php-di/php-di/src/Invoker/DefinitionParameterResolver.php +++ /dev/null @@ -1,69 +0,0 @@ - - */ -class DefinitionParameterResolver implements ParameterResolver -{ - /** - * @var DefinitionResolver - */ - private $definitionResolver; - - public function __construct(DefinitionResolver $definitionResolver) - { - $this->definitionResolver = $definitionResolver; - } - - public function getParameters( - ReflectionFunctionAbstract $reflection, - array $providedParameters, - array $resolvedParameters - ) : array { - // Skip parameters already resolved - if (! empty($resolvedParameters)) { - $providedParameters = array_diff_key($providedParameters, $resolvedParameters); - } - - foreach ($providedParameters as $key => $value) { - if ($value instanceof DefinitionHelper) { - $value = $value->getDefinition(''); - } - - if (! $value instanceof Definition) { - continue; - } - - $value = $this->definitionResolver->resolve($value); - - if (is_int($key)) { - // Indexed by position - $resolvedParameters[$key] = $value; - } else { - // Indexed by parameter name - // TODO optimize? - $reflectionParameters = $reflection->getParameters(); - foreach ($reflectionParameters as $reflectionParameter) { - if ($key === $reflectionParameter->name) { - $resolvedParameters[$reflectionParameter->getPosition()] = $value; - } - } - } - } - - return $resolvedParameters; - } -} diff --git a/system/vendor/php-di/php-di/src/Invoker/FactoryParameterResolver.php b/system/vendor/php-di/php-di/src/Invoker/FactoryParameterResolver.php deleted file mode 100644 index f5ace87..0000000 --- a/system/vendor/php-di/php-di/src/Invoker/FactoryParameterResolver.php +++ /dev/null @@ -1,74 +0,0 @@ - - * @author Matthieu Napoli - */ -class FactoryParameterResolver implements ParameterResolver -{ - /** - * @var ContainerInterface - */ - private $container; - - public function __construct(ContainerInterface $container) - { - $this->container = $container; - } - - public function getParameters( - ReflectionFunctionAbstract $reflection, - array $providedParameters, - array $resolvedParameters - ) : array { - $parameters = $reflection->getParameters(); - - // Skip parameters already resolved - if (! empty($resolvedParameters)) { - $parameters = array_diff_key($parameters, $resolvedParameters); - } - - foreach ($parameters as $index => $parameter) { - $parameterType = $parameter->getType(); - if (!$parameterType) { - // No type - continue; - } - if (!$parameterType instanceof ReflectionNamedType) { - // Union types are not supported - continue; - } - if ($parameterType->isBuiltin()) { - // Primitive types are not supported - continue; - } - - $parameterClass = $parameterType->getName(); - - if ($parameterClass === 'Psr\Container\ContainerInterface') { - $resolvedParameters[$index] = $this->container; - } elseif ($parameterClass === 'DI\Factory\RequestedEntry') { - // By convention the second parameter is the definition - $resolvedParameters[$index] = $providedParameters[1]; - } elseif ($this->container->has($parameterClass)) { - $resolvedParameters[$index] = $this->container->get($parameterClass); - } - } - - return $resolvedParameters; - } -} diff --git a/system/vendor/php-di/php-di/src/NotFoundException.php b/system/vendor/php-di/php-di/src/NotFoundException.php deleted file mode 100644 index 67dbacd..0000000 --- a/system/vendor/php-di/php-di/src/NotFoundException.php +++ /dev/null @@ -1,14 +0,0 @@ - - */ -class ProxyFactory -{ - /** - * If true, write the proxies to disk to improve performances. - * @var bool - */ - private $writeProxiesToFile; - - /** - * Directory where to write the proxies (if $writeProxiesToFile is enabled). - * @var string|null - */ - private $proxyDirectory; - - /** - * @var LazyLoadingValueHolderFactory|null - */ - private $proxyManager; - - public function __construct(bool $writeProxiesToFile = false, string $proxyDirectory = null) - { - $this->writeProxiesToFile = $writeProxiesToFile; - $this->proxyDirectory = $proxyDirectory; - } - - /** - * Creates a new lazy proxy instance of the given class with - * the given initializer. - * - * @param string $className name of the class to be proxied - * @param \Closure $initializer initializer to be passed to the proxy - */ - public function createProxy(string $className, \Closure $initializer) : LazyLoadingInterface - { - $this->createProxyManager(); - - return $this->proxyManager->createProxy($className, $initializer); - } - - /** - * Generates and writes the proxy class to file. - * - * @param string $className name of the class to be proxied - */ - public function generateProxyClass(string $className) - { - // If proxy classes a written to file then we pre-generate the class - // If they are not written to file then there is no point to do this - if ($this->writeProxiesToFile) { - $this->createProxyManager(); - $this->createProxy($className, function () {}); - } - } - - private function createProxyManager() - { - if ($this->proxyManager !== null) { - return; - } - - if (! class_exists(Configuration::class)) { - throw new \RuntimeException('The ocramius/proxy-manager library is not installed. Lazy injection requires that library to be installed with Composer in order to work. Run "composer require ocramius/proxy-manager:~2.0".'); - } - - $config = new Configuration(); - - if ($this->writeProxiesToFile) { - $config->setProxiesTargetDir($this->proxyDirectory); - $config->setGeneratorStrategy(new FileWriterGeneratorStrategy(new FileLocator($this->proxyDirectory))); - // @phpstan-ignore-next-line - spl_autoload_register($config->getProxyAutoloader()); - } else { - $config->setGeneratorStrategy(new EvaluatingGeneratorStrategy()); - } - - $this->proxyManager = new LazyLoadingValueHolderFactory($config); - } -} diff --git a/system/vendor/php-di/php-di/src/functions.php b/system/vendor/php-di/php-di/src/functions.php deleted file mode 100644 index 0504edb..0000000 --- a/system/vendor/php-di/php-di/src/functions.php +++ /dev/null @@ -1,156 +0,0 @@ - decorate(function ($foo, $container) { - * return new CachedFoo($foo, $container->get('cache')); - * }) - * - * @param callable $callable The callable takes the decorated object as first parameter and - * the container as second. - */ - function decorate($callable) : FactoryDefinitionHelper - { - return new FactoryDefinitionHelper($callable, true); - } -} - -if (! function_exists('DI\get')) { - /** - * Helper for referencing another container entry in an object definition. - */ - function get(string $entryName) : Reference - { - return new Reference($entryName); - } -} - -if (! function_exists('DI\env')) { - /** - * Helper for referencing environment variables. - * - * @param string $variableName The name of the environment variable. - * @param mixed $defaultValue The default value to be used if the environment variable is not defined. - */ - function env(string $variableName, $defaultValue = null) : EnvironmentVariableDefinition - { - // Only mark as optional if the default value was *explicitly* provided. - $isOptional = 2 === func_num_args(); - - return new EnvironmentVariableDefinition($variableName, $isOptional, $defaultValue); - } -} - -if (! function_exists('DI\add')) { - /** - * Helper for extending another definition. - * - * Example: - * - * 'log.backends' => DI\add(DI\get('My\Custom\LogBackend')) - * - * or: - * - * 'log.backends' => DI\add([ - * DI\get('My\Custom\LogBackend') - * ]) - * - * @param mixed|array $values A value or an array of values to add to the array. - * - * @since 5.0 - */ - function add($values) : ArrayDefinitionExtension - { - if (! is_array($values)) { - $values = [$values]; - } - - return new ArrayDefinitionExtension($values); - } -} - -if (! function_exists('DI\string')) { - /** - * Helper for concatenating strings. - * - * Example: - * - * 'log.filename' => DI\string('{app.path}/app.log') - * - * @param string $expression A string expression. Use the `{}` placeholders to reference other container entries. - * - * @since 5.0 - */ - function string(string $expression) : StringDefinition - { - return new StringDefinition($expression); - } -} diff --git a/system/vendor/php-di/php-di/support.md b/system/vendor/php-di/php-di/support.md deleted file mode 100644 index 22dd39a..0000000 --- a/system/vendor/php-di/php-di/support.md +++ /dev/null @@ -1,42 +0,0 @@ ---- -layout: documentation -current_menu: enterprise-support -title: Enterprise support for PHP-DI ---- - -# PHP-DI for Enterprise - -> *Available as part of the Tidelift Subscription* - -Tidelift is working with the maintainers of PHP-DI and thousands of other -open source projects to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. - -#### [Learn more](https://tidelift.com/subscription/pkg/packagist-php-di-php-di?utm_source=packagist-php-di-php-di&utm_medium=referral&utm_campaign=enterprise) | [**Request a demo**](https://tidelift.com/subscription/request-a-demo?utm_source=packagist-php-di-php-di&utm_medium=referral&utm_campaign=enterprise) - -## Enterprise-ready open source software—managed for you - -The Tidelift Subscription is a managed open source subscription for application dependencies covering millions of open source projects across JavaScript, Python, Java, PHP, Ruby, .NET, and more. - -Your subscription includes: - -- **Security updates** - Tidelift’s security response team coordinates patches for new breaking security vulnerabilities and alerts immediately through a private channel, so your software supply chain is always secure. - -- **Licensing verification and indemnification** - Tidelift verifies license information to enable easy policy enforcement and adds intellectual property indemnification to cover creators and users in case something goes wrong. You always have a 100% up-to-date bill of materials for your dependencies to share with your legal team, customers, or partners. - -- **Maintenance and code improvement** - Tidelift ensures the software you rely on keeps working as long as you need it to work. Your managed dependencies are actively maintained and we recruit additional maintainers where required. - -- **Package selection and version guidance** - We help you choose the best open source packages from the start—and then guide you through updates to stay on the best releases as new issues arise. - -- **Roadmap input** - Take a seat at the table with the creators behind the software you use. Tidelift’s participating maintainers earn more income as their software is used by more subscribers, so they’re interested in knowing what you need. - -- **Tooling and cloud integration** - Tidelift works with GitHub, GitLab, BitBucket, and more. We support every cloud platform (and other deployment targets, too). - -The end result? All of the capabilities you expect from commercial-grade software, for the full breadth of open source you use. That means less time grappling with esoteric open source trivia, and more time building your own applications—and your business. - -[Learn more](https://tidelift.com/subscription/pkg/packagist-php-di-php-di?utm_source=packagist-php-di-php-di&utm_medium=referral&utm_campaign=enterprise) | [**Request a demo**](https://tidelift.com/subscription/request-a-demo?utm_source=packagist-php-di-php-di&utm_medium=referral&utm_campaign=enterprise) diff --git a/system/vendor/php-di/phpdoc-reader/.gitattributes b/system/vendor/php-di/phpdoc-reader/.gitattributes deleted file mode 100644 index 912292c..0000000 --- a/system/vendor/php-di/phpdoc-reader/.gitattributes +++ /dev/null @@ -1,7 +0,0 @@ -# .gitattributes -tests/ export-ignore -phpunit.xml.dist export-ignore -.travis.yml export-ignore - -# Auto detect text files and perform LF normalization -* text=auto diff --git a/system/vendor/php-di/phpdoc-reader/.github/workflows/ci.yml b/system/vendor/php-di/phpdoc-reader/.github/workflows/ci.yml deleted file mode 100644 index 5b7421d..0000000 --- a/system/vendor/php-di/phpdoc-reader/.github/workflows/ci.yml +++ /dev/null @@ -1,65 +0,0 @@ -name: CI - -on: - push: - branches: ['master'] - pull_request: - branches: ['*'] - schedule: - - cron: '0 0 * * *' - -jobs: - - tests: - name: Tests - PHP ${{ matrix.php }} ${{ matrix.dependency-version }} - runs-on: ubuntu-latest - timeout-minutes: 15 - strategy: - matrix: - php: [ '7.2', '7.3', '7.4', '8.0' ] - dependency-version: [ '' ] - include: - - php: '7.2' - dependency-version: '--prefer-lowest' - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - tools: composer:v2 - coverage: none - - name: Cache Composer dependencies - uses: actions/cache@v2 - with: - path: ~/.composer/cache - key: php-${{ matrix.php }}-composer-locked-${{ hashFiles('composer.lock') }} - restore-keys: php-${{ matrix.php }}-composer-locked- - - name: Install PHP dependencies - run: composer update ${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-progress --no-suggest - - name: PHPUnit - run: vendor/bin/phpunit - - cs: - name: Coding standards - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: 7.4 - tools: composer:v2, cs2pr - coverage: none - - name: Cache Composer dependencies - uses: actions/cache@v2 - with: - path: ~/.composer/cache - key: php-74-composer-locked-${{ hashFiles('composer.lock') }} - restore-keys: php-74-composer-locked- - - name: Install PHP dependencies - run: composer install --no-interaction --no-progress --no-suggest - - name: PHP CodeSniffer - run: vendor/bin/phpcs -q --no-colors --report=checkstyle | cs2pr diff --git a/system/vendor/php-di/phpdoc-reader/.gitignore b/system/vendor/php-di/phpdoc-reader/.gitignore deleted file mode 100644 index 9abe135..0000000 --- a/system/vendor/php-di/phpdoc-reader/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -.DS_Store -.idea/* -vendor/* -composer.phar -composer.lock -.phpcs-cache -.phpunit.result.cache diff --git a/system/vendor/php-di/phpdoc-reader/.phpcs.xml.dist b/system/vendor/php-di/phpdoc-reader/.phpcs.xml.dist deleted file mode 100644 index 191db96..0000000 --- a/system/vendor/php-di/phpdoc-reader/.phpcs.xml.dist +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - src - src/PhpDocReader/PhpParser/TokenParser.php - tests - tests/Fixtures - - - - - - 0 - - - diff --git a/system/vendor/php-di/phpdoc-reader/LICENSE b/system/vendor/php-di/phpdoc-reader/LICENSE deleted file mode 100644 index f3d2a02..0000000 --- a/system/vendor/php-di/phpdoc-reader/LICENSE +++ /dev/null @@ -1,16 +0,0 @@ -Copyright (C) 2019 Matthieu Napoli - -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/system/vendor/php-di/phpdoc-reader/README.md b/system/vendor/php-di/phpdoc-reader/README.md deleted file mode 100644 index bfaa6c3..0000000 --- a/system/vendor/php-di/phpdoc-reader/README.md +++ /dev/null @@ -1,57 +0,0 @@ -# PhpDocReader - -![](https://img.shields.io/packagist/dt/PHP-DI/phpdoc-reader.svg) - -This project is used by: - -- [PHP-DI 6](http://php-di.org/) -- [phockito-unit-php-di](https://github.com/balihoo/phockito-unit-php-di) - -Fork the README to add your project here. - -## Features - -PhpDocReader parses `@var` and `@param` values in PHP docblocks: - -```php - -use My\Cache\Backend; - -class Cache -{ - /** - * @var Backend - */ - protected $backend; - - /** - * @param Backend $backend - */ - public function __construct($backend) - { - } -} -``` - -It supports namespaced class names with the same resolution rules as PHP: - -- fully qualified name (starting with `\`) -- imported class name (eg. `use My\Cache\Backend;`) -- relative class name (from the current namespace, like `SubNamespace\MyClass`) -- aliased class name (eg. `use My\Cache\Backend as FooBar;`) - -Primitive types (`@var string`) are ignored (returns null), only valid class names are returned. - -## Usage - -```php -$reader = new PhpDocReader(); - -// Read a property type (@var phpdoc) -$property = new ReflectionProperty($className, $propertyName); -$propertyClass = $reader->getPropertyClass($property); - -// Read a parameter type (@param phpdoc) -$parameter = new ReflectionParameter(array($className, $methodName), $parameterName); -$parameterClass = $reader->getParameterClass($parameter); -``` diff --git a/system/vendor/php-di/phpdoc-reader/composer.json b/system/vendor/php-di/phpdoc-reader/composer.json deleted file mode 100644 index 64d7262..0000000 --- a/system/vendor/php-di/phpdoc-reader/composer.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "php-di/phpdoc-reader", - "type": "library", - "description": "PhpDocReader parses @var and @param values in PHP docblocks (supports namespaced class names with the same resolution rules as PHP)", - "keywords": ["phpdoc", "reflection"], - "license": "MIT", - "autoload": { - "psr-4": { - "PhpDocReader\\": "src/PhpDocReader" - } - }, - "autoload-dev": { - "psr-4": { - "UnitTest\\PhpDocReader\\": "tests/" - } - }, - "require": { - "php": ">=7.2.0" - }, - "require-dev": { - "phpunit/phpunit": "^8.5|^9.0", - "mnapoli/hard-mode": "~0.3.0" - } -} diff --git a/system/vendor/php-di/phpdoc-reader/src/PhpDocReader/AnnotationException.php b/system/vendor/php-di/phpdoc-reader/src/PhpDocReader/AnnotationException.php deleted file mode 100644 index 1466a9b..0000000 --- a/system/vendor/php-di/phpdoc-reader/src/PhpDocReader/AnnotationException.php +++ /dev/null @@ -1,10 +0,0 @@ - 'bool', - 'boolean' => 'bool', - 'string' => 'string', - 'int' => 'int', - 'integer' => 'int', - 'float' => 'float', - 'double' => 'float', - 'array' => 'array', - 'object' => 'object', - 'callable' => 'callable', - 'resource' => 'resource', - 'mixed' => 'mixed', - 'iterable' => 'iterable', - ]; - - /** @var bool */ - private $ignorePhpDocErrors; - - /** - * @param bool $ignorePhpDocErrors Enable or disable throwing errors when PhpDoc errors occur (when parsing annotations). - */ - public function __construct(bool $ignorePhpDocErrors = false) - { - $this->parser = new UseStatementParser; - $this->ignorePhpDocErrors = $ignorePhpDocErrors; - } - - /** - * Parse the docblock of the property to get the type (class or primitive type) of the var annotation. - * - * @return string|null Type of the property (content of var annotation) - * @throws AnnotationException - */ - public function getPropertyType(ReflectionProperty $property): ?string - { - return $this->readPropertyType($property, true); - } - - /** - * Parse the docblock of the property to get the class of the var annotation. - * - * @return string|null Type of the property (content of var annotation) - * @throws AnnotationException - */ - public function getPropertyClass(ReflectionProperty $property): ?string - { - return $this->readPropertyType($property, false); - } - - private function readPropertyType(ReflectionProperty $property, bool $allowPrimitiveTypes): ?string - { - // Get the content of the @var annotation - $docComment = $property->getDocComment(); - if (! $docComment) { - return null; - } - if (preg_match('/@var\s+([^\s]+)/', $docComment, $matches)) { - [, $type] = $matches; - } else { - return null; - } - - // Ignore primitive types - if (isset(self::PRIMITIVE_TYPES[$type])) { - if ($allowPrimitiveTypes) { - return self::PRIMITIVE_TYPES[$type]; - } - return null; - } - - // Ignore types containing special characters ([], <> ...) - if (! preg_match('/^[a-zA-Z0-9\\\\_]+$/', $type)) { - return null; - } - - $class = $property->getDeclaringClass(); - - // If the class name is not fully qualified (i.e. doesn't start with a \) - if ($type[0] !== '\\') { - // Try to resolve the FQN using the class context - $resolvedType = $this->tryResolveFqn($type, $class, $property); - - if (! $resolvedType && ! $this->ignorePhpDocErrors) { - throw new AnnotationException(sprintf( - 'The @var annotation on %s::%s contains a non existent class "%s". ' - . 'Did you maybe forget to add a "use" statement for this annotation?', - $class->name, - $property->getName(), - $type - )); - } - - $type = $resolvedType; - } - - if (! $this->ignorePhpDocErrors && ! $this->classExists($type)) { - throw new AnnotationException(sprintf( - 'The @var annotation on %s::%s contains a non existent class "%s"', - $class->name, - $property->getName(), - $type - )); - } - - // Remove the leading \ (FQN shouldn't contain it) - $type = is_string($type) ? ltrim($type, '\\') : null; - - return $type; - } - - /** - * Parse the docblock of the property to get the type (class or primitive type) of the param annotation. - * - * @return string|null Type of the property (content of var annotation) - * @throws AnnotationException - */ - public function getParameterType(ReflectionParameter $parameter): ?string - { - return $this->readParameterClass($parameter, true); - } - - /** - * Parse the docblock of the property to get the class of the param annotation. - * - * @return string|null Type of the property (content of var annotation) - * @throws AnnotationException - */ - public function getParameterClass(ReflectionParameter $parameter): ?string - { - return $this->readParameterClass($parameter, false); - } - - private function readParameterClass(ReflectionParameter $parameter, bool $allowPrimitiveTypes): ?string - { - // Use reflection - $parameterType = $parameter->getType(); - if ($parameterType && $parameterType instanceof \ReflectionNamedType && ! $parameterType->isBuiltin()) { - return $parameterType->getName(); - } - - $parameterName = $parameter->name; - // Get the content of the @param annotation - $method = $parameter->getDeclaringFunction(); - $docComment = $method->getDocComment(); - if (! $docComment) { - return null; - } - if (preg_match('/@param\s+([^\s]+)\s+\$' . $parameterName . '/', $docComment, $matches)) { - [, $type] = $matches; - } else { - return null; - } - - // Ignore primitive types - if (isset(self::PRIMITIVE_TYPES[$type])) { - if ($allowPrimitiveTypes) { - return self::PRIMITIVE_TYPES[$type]; - } - return null; - } - - // Ignore types containing special characters ([], <> ...) - if (! preg_match('/^[a-zA-Z0-9\\\\_]+$/', $type)) { - return null; - } - - $class = $parameter->getDeclaringClass(); - - // If the class name is not fully qualified (i.e. doesn't start with a \) - if ($type[0] !== '\\') { - // Try to resolve the FQN using the class context - $resolvedType = $this->tryResolveFqn($type, $class, $parameter); - - if (! $resolvedType && ! $this->ignorePhpDocErrors) { - throw new AnnotationException(sprintf( - 'The @param annotation for parameter "%s" of %s::%s contains a non existent class "%s". ' - . 'Did you maybe forget to add a "use" statement for this annotation?', - $parameterName, - $class->name, - $method->name, - $type - )); - } - - $type = $resolvedType; - } - - if (! $this->ignorePhpDocErrors && ! $this->classExists($type)) { - throw new AnnotationException(sprintf( - 'The @param annotation for parameter "%s" of %s::%s contains a non existent class "%s"', - $parameterName, - $class->name, - $method->name, - $type - )); - } - - // Remove the leading \ (FQN shouldn't contain it) - $type = is_string($type) ? ltrim($type, '\\') : null; - - return $type; - } - - /** - * Attempts to resolve the FQN of the provided $type based on the $class and $member context. - * - * @return string|null Fully qualified name of the type, or null if it could not be resolved - */ - private function tryResolveFqn(string $type, ReflectionClass $class, Reflector $member): ?string - { - $alias = ($pos = strpos($type, '\\')) === false ? $type : substr($type, 0, $pos); - $loweredAlias = strtolower($alias); - - // Retrieve "use" statements - $uses = $this->parser->parseUseStatements($class); - - if (isset($uses[$loweredAlias])) { - // Imported classes - if ($pos !== false) { - return $uses[$loweredAlias] . substr($type, $pos); - } - return $uses[$loweredAlias]; - } - - if ($this->classExists($class->getNamespaceName() . '\\' . $type)) { - return $class->getNamespaceName() . '\\' . $type; - } - - if (isset($uses['__NAMESPACE__']) && $this->classExists($uses['__NAMESPACE__'] . '\\' . $type)) { - // Class namespace - return $uses['__NAMESPACE__'] . '\\' . $type; - } - - if ($this->classExists($type)) { - // No namespace - return $type; - } - - // If all fail, try resolving through related traits - return $this->tryResolveFqnInTraits($type, $class, $member); - } - - /** - * Attempts to resolve the FQN of the provided $type based on the $class and $member context, specifically searching - * through the traits that are used by the provided $class. - * - * @return string|null Fully qualified name of the type, or null if it could not be resolved - */ - private function tryResolveFqnInTraits(string $type, ReflectionClass $class, Reflector $member): ?string - { - /** @var ReflectionClass[] $traits */ - $traits = []; - - // Get traits for the class and its parents - while ($class) { - $traits = array_merge($traits, $class->getTraits()); - $class = $class->getParentClass(); - } - - foreach ($traits as $trait) { - // Eliminate traits that don't have the property/method/parameter - if ($member instanceof ReflectionProperty && ! $trait->hasProperty($member->name)) { - continue; - } - if ($member instanceof ReflectionMethod && ! $trait->hasMethod($member->name)) { - continue; - } - if ($member instanceof ReflectionParameter && ! $trait->hasMethod($member->getDeclaringFunction()->name)) { - continue; - } - - // Run the resolver again with the ReflectionClass instance for the trait - $resolvedType = $this->tryResolveFqn($type, $trait, $member); - - if ($resolvedType) { - return $resolvedType; - } - } - - return null; - } - - private function classExists(string $class): bool - { - return class_exists($class) || interface_exists($class); - } -} diff --git a/system/vendor/php-di/phpdoc-reader/src/PhpDocReader/PhpParser/TokenParser.php b/system/vendor/php-di/phpdoc-reader/src/PhpDocReader/PhpParser/TokenParser.php deleted file mode 100644 index 1f6ec70..0000000 --- a/system/vendor/php-di/phpdoc-reader/src/PhpDocReader/PhpParser/TokenParser.php +++ /dev/null @@ -1,182 +0,0 @@ - - * @author Christian Kaps - */ -class TokenParser -{ - /** - * The token list. - * - * @var list - */ - private $tokens; - - /** - * The number of tokens. - * - * @var int - */ - private $numTokens; - - /** - * The current array pointer. - * - * @var int - */ - private $pointer = 0; - - /** - * @param string $contents - */ - public function __construct($contents) - { - $this->tokens = token_get_all($contents); - - // The PHP parser sets internal compiler globals for certain things. Annoyingly, the last docblock comment it - // saw gets stored in doc_comment. When it comes to compile the next thing to be include()d this stored - // doc_comment becomes owned by the first thing the compiler sees in the file that it considers might have a - // docblock. If the first thing in the file is a class without a doc block this would cause calls to - // getDocBlock() on said class to return our long lost doc_comment. Argh. - // To workaround, cause the parser to parse an empty docblock. Sure getDocBlock() will return this, but at least - // it's harmless to us. - token_get_all("numTokens = count($this->tokens); - } - - /** - * Gets all use statements. - * - * @param string $namespaceName The namespace name of the reflected class. - * - * @return array A list with all found use statements. - */ - public function parseUseStatements($namespaceName) - { - $statements = []; - while (($token = $this->next())) { - if ($token[0] === T_USE) { - $statements = array_merge($statements, $this->parseUseStatement()); - continue; - } - - if ($token[0] !== T_NAMESPACE || $this->parseNamespace() !== $namespaceName) { - continue; - } - - // Get fresh array for new namespace. This is to prevent the parser to collect the use statements - // for a previous namespace with the same name. This is the case if a namespace is defined twice - // or if a namespace with the same name is commented out. - $statements = []; - } - - return $statements; - } - - /** - * Gets the next non whitespace and non comment token. - * - * @param bool $docCommentIsComment If TRUE then a doc comment is considered a comment and skipped. - * If FALSE then only whitespace and normal comments are skipped. - * - * @return mixed[]|string|null The token if exists, null otherwise. - */ - private function next($docCommentIsComment = true) - { - for ($i = $this->pointer; $i < $this->numTokens; $i++) { - $this->pointer++; - if ( - $this->tokens[$i][0] === T_WHITESPACE || - $this->tokens[$i][0] === T_COMMENT || - ($docCommentIsComment && $this->tokens[$i][0] === T_DOC_COMMENT) - ) { - continue; - } - - return $this->tokens[$i]; - } - - return null; - } - - /** - * Parses a single use statement. - * - * @return array A list with all found class names for a use statement. - */ - private function parseUseStatement() - { - $groupRoot = ''; - $class = ''; - $alias = ''; - $statements = []; - $explicitAlias = false; - while (($token = $this->next())) { - if (! $explicitAlias && $token[0] === T_STRING) { - $class .= $token[1]; - $alias = $token[1]; - } elseif ($explicitAlias && $token[0] === T_STRING) { - $alias = $token[1]; - } elseif ( - PHP_VERSION_ID >= 80000 && - ($token[0] === T_NAME_QUALIFIED || $token[0] === T_NAME_FULLY_QUALIFIED) - ) { - $class .= $token[1]; - - $classSplit = explode('\\', $token[1]); - $alias = $classSplit[count($classSplit) - 1]; - } elseif ($token[0] === T_NS_SEPARATOR) { - $class .= '\\'; - $alias = ''; - } elseif ($token[0] === T_AS) { - $explicitAlias = true; - $alias = ''; - } elseif ($token === ',') { - $statements[strtolower($alias)] = $groupRoot . $class; - $class = ''; - $alias = ''; - $explicitAlias = false; - } elseif ($token === ';') { - $statements[strtolower($alias)] = $groupRoot . $class; - break; - } elseif ($token === '{') { - $groupRoot = $class; - $class = ''; - } elseif ($token === '}') { - continue; - } else { - break; - } - } - - return $statements; - } - - /** - * Gets the namespace. - * - * @return string The found namespace. - */ - private function parseNamespace() - { - $name = ''; - while ( - ($token = $this->next()) && ($token[0] === T_STRING || $token[0] === T_NS_SEPARATOR || ( - PHP_VERSION_ID >= 80000 && - ($token[0] === T_NAME_QUALIFIED || $token[0] === T_NAME_FULLY_QUALIFIED) - )) - ) { - $name .= $token[1]; - } - - return $name; - } -} diff --git a/system/vendor/php-di/phpdoc-reader/src/PhpDocReader/PhpParser/UseStatementParser.php b/system/vendor/php-di/phpdoc-reader/src/PhpDocReader/PhpParser/UseStatementParser.php deleted file mode 100644 index 39515df..0000000 --- a/system/vendor/php-di/phpdoc-reader/src/PhpDocReader/PhpParser/UseStatementParser.php +++ /dev/null @@ -1,64 +0,0 @@ - and Christian Kaps - */ -class UseStatementParser -{ - /** - * @return array A list with use statements in the form (Alias => FQN). - */ - public function parseUseStatements(\ReflectionClass $class): array - { - $filename = $class->getFilename(); - if ($filename === false) { - return []; - } - - $content = $this->getFileContent($filename, $class->getStartLine()); - - if ($content === null) { - return []; - } - - $namespace = preg_quote($class->getNamespaceName(), '/'); - $content = preg_replace('/^.*?(\bnamespace\s+' . $namespace . '\s*[;{].*)$/s', '\\1', $content); - $tokenizer = new TokenParser('parseUseStatements($class->getNamespaceName()); - } - - /** - * Gets the content of the file right up to the given line number. - * - * @param string $filename The name of the file to load. - * @param int $lineNumber The number of lines to read from file. - */ - private function getFileContent(string $filename, int $lineNumber): string - { - if (! is_file($filename)) { - throw new \RuntimeException("Unable to read file $filename"); - } - - $content = ''; - $lineCnt = 0; - $file = new SplFileObject($filename); - while (! $file->eof()) { - if ($lineCnt++ === $lineNumber) { - break; - } - - $content .= $file->fgets(); - } - - return $content; - } -} diff --git a/system/vendor/php-di/slim-bridge/CONTRIBUTING.md b/system/vendor/php-di/slim-bridge/CONTRIBUTING.md deleted file mode 100644 index 852fd1a..0000000 --- a/system/vendor/php-di/slim-bridge/CONTRIBUTING.md +++ /dev/null @@ -1,15 +0,0 @@ -# Contributing - -First of all, **thank you** for contributing! - -Here are a few rules to follow in order to ease code reviews and merging: - -- follow [PSR-1](http://www.php-fig.org/psr/1/) and [PSR-2](http://www.php-fig.org/psr/2/) -- run the test suite -- write (or update) unit tests when applicable -- write documentation for new features -- use [commit messages that make sense](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html) - -One may ask you to [squash your commits](http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html) too. This is used to "clean" your pull request before merging it (we don't want commits such as `fix tests`, `fix 2`, `fix 3`, etc.). - -When creating your pull request on GitHub, please write a description which gives the context and/or explains why you are creating it. diff --git a/system/vendor/php-di/slim-bridge/LICENSE b/system/vendor/php-di/slim-bridge/LICENSE deleted file mode 100644 index b2b0416..0000000 --- a/system/vendor/php-di/slim-bridge/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Matthieu Napoli - -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/system/vendor/php-di/slim-bridge/README.md b/system/vendor/php-di/slim-bridge/README.md deleted file mode 100644 index 55ca458..0000000 --- a/system/vendor/php-di/slim-bridge/README.md +++ /dev/null @@ -1,120 +0,0 @@ -# PHP-DI integration with Slim - -This package configures Slim to work with the [PHP-DI container](http://php-di.org/). - -[![Build Status](https://travis-ci.org/PHP-DI/Slim-Bridge.svg?branch=master)](https://travis-ci.org/PHP-DI/Slim-Bridge) -[![](https://img.shields.io/packagist/dt/php-di/slim-bridge.svg)](https://packagist.org/packages/php-di/slim-bridge) - -The full documentation is here: **http://php-di.org/doc/frameworks/slim.html** - -## Why? - -### PHP-DI as a container - -The most obvious difference with the default Slim installation is that you will be using PHP-DI as the container, which has the following benefits: - -- [autowiring](http://php-di.org/doc/autowiring.html) -- powerful [configuration format](http://php-di.org/doc/php-definitions.html) -- support for [modular systems](http://php-di.org/doc/definition-overriding.html) -- ... - -If you want to learn more about all that PHP-DI can offer [have a look at its introduction](http://php-di.org/). - -### Controllers as services - -While your controllers can be simple closures, you can also **write them as classes and have PHP-DI instantiate them only when they are called**: - -```php -class UserController -{ - private $userRepository; - - public function __construct(UserRepository $userRepository) - { - $this->userRepository = $userRepository; - } - - public function delete($request, $response) - { - $this->userRepository->remove($request->getAttribute('id')); - - $response->getBody()->write('User deleted'); - return $response; - } -} - -$app->delete('/user/{id}', ['UserController', 'delete']); -``` - -Dependencies can then be injected in your controller using [autowiring, PHP-DI config files or even annotations](http://php-di.org/doc/definition.html). - -### Controller parameters - -By default, Slim controllers have a strict signature: `$request, $response, $args`. The PHP-DI bridge offers a more flexible and developer friendly alternative. - -Controller parameters can be any of these things: - -- the request or response (parameters must be named `$request` or `$response`) -- route placeholders -- request attributes -- services (injected by type-hint) - -You can mix all these types of parameters together too. They will be matched by priority in the order of the list above. - -#### Request or response injection - -You can inject the request or response in the controller parameters by name: - -```php -$app->get('/', function (ResponseInterface $response, ServerRequestInterface $request) { - // ... -}); -``` - -As you can see, the order of the parameters doesn't matter. That allows to skip injecting the `$request` if it's not needed for example. - -#### Route placeholder injection - -```php -$app->get('/hello/{name}', function ($name, ResponseInterface $response) { - $response->getBody()->write('Hello ' . $name); - return $response; -}); -``` - -As you can see above, the route's URL contains a `name` placeholder. By simply adding a parameter **with the same name** to the controller, PHP-DI will directly inject it. - -#### Request attribute injection - -```php -$app->add(function (ServerRequestInterface $request, RequestHandlerInterface $handler) { - $request = $request->withAttribute('name', 'Bob'); - $response = $handler->handle($request); - return $response; -}); - -$app->get('/', function ($name, ResponseInterface $response) { - $response->getBody()->write('Hello ' . $name); - return $response; -}); -``` - -As you can see above, a middleware sets a `name` attribute. By simply adding a parameter **with the same name** to the controller, PHP-DI will directly inject it. - -#### Service injection - -To inject services into your controllers, you can write them as classes. But if you want to write a micro-application using closures, you don't have to give up dependency injection either. - -You can inject services by type-hinting them: - -```php -$app->get('/', function (ResponseInterface $response, Twig $twig) { - return $twig->render($response, 'home.twig'); -}); -``` - -> Note: you can only inject services that you can type-hint and that PHP-DI can provide. Type-hint injection is simple, it simply injects the result of `$container->get(/* the type-hinted class */)`. - -## Documentation - -The documentation can be read here: **http://php-di.org/doc/frameworks/slim.html** diff --git a/system/vendor/php-di/slim-bridge/composer.json b/system/vendor/php-di/slim-bridge/composer.json deleted file mode 100644 index 63794ec..0000000 --- a/system/vendor/php-di/slim-bridge/composer.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "php-di/slim-bridge", - "description": "PHP-DI integration in Slim", - "license": "MIT", - "type": "library", - "autoload": { - "psr-4": { - "DI\\Bridge\\Slim\\": "src/" - } - }, - "autoload-dev": { - "psr-4": { - "DI\\Bridge\\Slim\\Test\\": "tests/" - } - }, - "require": { - "php": "^7.1 || ^8.0", - "php-di/php-di": "^6.0|^7.0", - "php-di/invoker": "^2.0.0", - "slim/slim": "^4.2.0" - }, - "require-dev": { - "laminas/laminas-diactoros": "^2.1", - "phpunit/phpunit": ">= 7.0 < 10" - } -} diff --git a/system/vendor/php-di/slim-bridge/src/Bridge.php b/system/vendor/php-di/slim-bridge/src/Bridge.php deleted file mode 100644 index f97770d..0000000 --- a/system/vendor/php-di/slim-bridge/src/Bridge.php +++ /dev/null @@ -1,57 +0,0 @@ -set(CallableResolverInterface::class, new CallableResolver($callableResolver)); - $app = AppFactory::createFromContainer($container); - - $container->set(App::class, $app); - - $controllerInvoker = static::createControllerInvoker($container); - $app->getRouteCollector()->setDefaultInvocationStrategy($controllerInvoker); - - return $app; - } - - private static function createControllerInvoker(ContainerInterface $container): ControllerInvoker - { - $resolvers = [ - // Inject parameters by name first - new AssociativeArrayResolver(), - // Then inject services by type-hints for those that weren't resolved - new TypeHintContainerResolver($container), - // Then fall back on parameters default values for optional route parameters - new DefaultValueResolver(), - ]; - - $invoker = new Invoker(new ResolverChain($resolvers), $container); - - return new ControllerInvoker($invoker); - } -} diff --git a/system/vendor/php-di/slim-bridge/src/CallableResolver.php b/system/vendor/php-di/slim-bridge/src/CallableResolver.php deleted file mode 100644 index 7172ef1..0000000 --- a/system/vendor/php-di/slim-bridge/src/CallableResolver.php +++ /dev/null @@ -1,79 +0,0 @@ -callableResolver = $callableResolver; - } - - /** - * {@inheritdoc} - */ - public function resolve($toResolve): callable - { - return $this->callableResolver->resolve($this->translateNotation($toResolve)); - } - - /** - * {@inheritdoc} - */ - public function resolveRoute($toResolve): callable - { - return $this->resolvePossibleSignature($toResolve, 'handle', RequestHandlerInterface::class); - } - - /** - * {@inheritdoc} - */ - public function resolveMiddleware($toResolve): callable - { - return $this->resolvePossibleSignature($toResolve, 'process', MiddlewareInterface::class); - } - - /** - * Translate Slim string callable notation ('nameOrKey:method') to PHP-DI notation ('nameOrKey::method'). - */ - private function translateNotation($toResolve) - { - if (is_string($toResolve) && preg_match(\Slim\CallableResolver::$callablePattern, $toResolve)) { - $toResolve = str_replace(':', '::', $toResolve); - } - - return $toResolve; - } - - private function resolvePossibleSignature($toResolve, string $method, string $typeName): callable - { - if (is_string($toResolve)) { - $toResolve = $this->translateNotation($toResolve); - - try { - $callable = $this->callableResolver->resolve([$toResolve, $method]); - - if (is_array($callable) && $callable[0] instanceof $typeName) { - return $callable; - } - } catch (NotCallableException $e) { - // Fall back to looking for a generic callable. - } - } - - return $this->callableResolver->resolve($toResolve); - } -} diff --git a/system/vendor/php-di/slim-bridge/src/ControllerInvoker.php b/system/vendor/php-di/slim-bridge/src/ControllerInvoker.php deleted file mode 100644 index ba3bfe8..0000000 --- a/system/vendor/php-di/slim-bridge/src/ControllerInvoker.php +++ /dev/null @@ -1,58 +0,0 @@ -invoker = $invoker; - } - /** - * Invoke a route callable. - * - * @param callable $callable The callable to invoke using the strategy. - * @param ServerRequestInterface $request The request object. - * @param ResponseInterface $response The response object. - * @param array $routeArguments The route's placeholder arguments - * - * @return ResponseInterface|string The response from the callable. - */ - public function __invoke( - callable $callable, - ServerRequestInterface $request, - ResponseInterface $response, - array $routeArguments - ): ResponseInterface { - // Inject the request and response by parameter name - $parameters = [ - 'request' => self::injectRouteArguments($request, $routeArguments), - 'response' => $response, - ]; - // Inject the route arguments by name - $parameters += $routeArguments; - // Inject the attributes defined on the request - $parameters += $request->getAttributes(); - - return $this->invoker->call($callable, $parameters); - } - - private static function injectRouteArguments(ServerRequestInterface $request, array $routeArguments): ServerRequestInterface - { - $requestWithArgs = $request; - foreach ($routeArguments as $key => $value) { - $requestWithArgs = $requestWithArgs->withAttribute($key, $value); - } - return $requestWithArgs; - } -} diff --git a/system/vendor/psr/container/.gitignore b/system/vendor/psr/container/.gitignore deleted file mode 100644 index b2395aa..0000000 --- a/system/vendor/psr/container/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -composer.lock -composer.phar -/vendor/ diff --git a/system/vendor/psr/container/LICENSE b/system/vendor/psr/container/LICENSE deleted file mode 100644 index 2877a48..0000000 --- a/system/vendor/psr/container/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2013-2016 container-interop -Copyright (c) 2016 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/system/vendor/psr/container/README.md b/system/vendor/psr/container/README.md deleted file mode 100644 index 1b9d9e5..0000000 --- a/system/vendor/psr/container/README.md +++ /dev/null @@ -1,13 +0,0 @@ -Container interface -============== - -This repository holds all interfaces related to [PSR-11 (Container Interface)][psr-url]. - -Note that this is not a Container implementation of its own. It is merely abstractions that describe the components of a Dependency Injection Container. - -The installable [package][package-url] and [implementations][implementation-url] are listed on Packagist. - -[psr-url]: https://www.php-fig.org/psr/psr-11/ -[package-url]: https://packagist.org/packages/psr/container -[implementation-url]: https://packagist.org/providers/psr/container-implementation - diff --git a/system/vendor/psr/container/composer.json b/system/vendor/psr/container/composer.json deleted file mode 100644 index 017f41e..0000000 --- a/system/vendor/psr/container/composer.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "psr/container", - "type": "library", - "description": "Common Container Interface (PHP FIG PSR-11)", - "keywords": ["psr", "psr-11", "container", "container-interop", "container-interface"], - "homepage": "https://github.com/php-fig/container", - "license": "MIT", - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "require": { - "php": ">=7.4.0" - }, - "autoload": { - "psr-4": { - "Psr\\Container\\": "src/" - } - } -} diff --git a/system/vendor/psr/container/src/ContainerExceptionInterface.php b/system/vendor/psr/container/src/ContainerExceptionInterface.php deleted file mode 100644 index 0f213f2..0000000 --- a/system/vendor/psr/container/src/ContainerExceptionInterface.php +++ /dev/null @@ -1,12 +0,0 @@ -=7.2.0" - }, - "autoload": { - "psr-4": { - "Psr\\EventDispatcher\\": "src/" - } - }, - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - } -} diff --git a/system/vendor/psr/event-dispatcher/src/EventDispatcherInterface.php b/system/vendor/psr/event-dispatcher/src/EventDispatcherInterface.php deleted file mode 100644 index 4306fa9..0000000 --- a/system/vendor/psr/event-dispatcher/src/EventDispatcherInterface.php +++ /dev/null @@ -1,21 +0,0 @@ -=7.0.0", - "psr/http-message": "^1.0 || ^2.0" - }, - "autoload": { - "psr-4": { - "Psr\\Http\\Message\\": "src/" - } - }, - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - } -} diff --git a/system/vendor/psr/http-factory/src/RequestFactoryInterface.php b/system/vendor/psr/http-factory/src/RequestFactoryInterface.php deleted file mode 100644 index cb39a08..0000000 --- a/system/vendor/psr/http-factory/src/RequestFactoryInterface.php +++ /dev/null @@ -1,18 +0,0 @@ - `RequestInterface`, `ServerRequestInterface`, `ResponseInterface` extend `MessageInterface` because the `Request` and the `Response` are `HTTP Messages`. -> When using `ServerRequestInterface`, both `RequestInterface` and `Psr\Http\Message\MessageInterface` methods are considered. - diff --git a/system/vendor/psr/http-message/docs/PSR7-Usage.md b/system/vendor/psr/http-message/docs/PSR7-Usage.md deleted file mode 100644 index b6d048a..0000000 --- a/system/vendor/psr/http-message/docs/PSR7-Usage.md +++ /dev/null @@ -1,159 +0,0 @@ -### PSR-7 Usage - -All PSR-7 applications comply with these interfaces -They were created to establish a standard between middleware implementations. - -> `RequestInterface`, `ServerRequestInterface`, `ResponseInterface` extend `MessageInterface` because the `Request` and the `Response` are `HTTP Messages`. -> When using `ServerRequestInterface`, both `RequestInterface` and `Psr\Http\Message\MessageInterface` methods are considered. - - -The following examples will illustrate how basic operations are done in PSR-7. - -##### Examples - - -For this examples to work (at least) a PSR-7 implementation package is required. (eg: zendframework/zend-diactoros, guzzlehttp/psr7, slim/slim, etc) -All PSR-7 implementations should have the same behaviour. - -The following will be assumed: -`$request` is an object of `Psr\Http\Message\RequestInterface` and - -`$response` is an object implementing `Psr\Http\Message\RequestInterface` - - -### Working with HTTP Headers - -#### Adding headers to response: - -```php -$response->withHeader('My-Custom-Header', 'My Custom Message'); -``` - -#### Appending values to headers - -```php -$response->withAddedHeader('My-Custom-Header', 'The second message'); -``` - -#### Checking if header exists: - -```php -$request->hasHeader('My-Custom-Header'); // will return false -$response->hasHeader('My-Custom-Header'); // will return true -``` - -> Note: My-Custom-Header was only added in the Response - -#### Getting comma-separated values from a header (also applies to request) - -```php -// getting value from request headers -$request->getHeaderLine('Content-Type'); // will return: "text/html; charset=UTF-8" -// getting value from response headers -$response->getHeaderLine('My-Custom-Header'); // will return: "My Custom Message; The second message" -``` - -#### Getting array of value from a header (also applies to request) -```php -// getting value from request headers -$request->getHeader('Content-Type'); // will return: ["text/html", "charset=UTF-8"] -// getting value from response headers -$response->getHeader('My-Custom-Header'); // will return: ["My Custom Message", "The second message"] -``` - -#### Removing headers from HTTP Messages -```php -// removing a header from Request, removing deprecated "Content-MD5" header -$request->withoutHeader('Content-MD5'); - -// removing a header from Response -// effect: the browser won't know the size of the stream -// the browser will download the stream till it ends -$response->withoutHeader('Content-Length'); -``` - -### Working with HTTP Message Body - -When working with the PSR-7 there are two methods of implementation: -#### 1. Getting the body separately - -> This method makes the body handling easier to understand and is useful when repeatedly calling body methods. (You only call `getBody()` once). Using this method mistakes like `$response->write()` are also prevented. - -```php -$body = $response->getBody(); -// operations on body, eg. read, write, seek -// ... -// replacing the old body -$response->withBody($body); -// this last statement is optional as we working with objects -// in this case the "new" body is same with the "old" one -// the $body variable has the same value as the one in $request, only the reference is passed -``` - -#### 2. Working directly on response - -> This method is useful when only performing few operations as the `$request->getBody()` statement fragment is required - -```php -$response->getBody()->write('hello'); -``` - -### Getting the body contents - -The following snippet gets the contents of a stream contents. -> Note: Streams must be rewinded, if content was written into streams, it will be ignored when calling `getContents()` because the stream pointer is set to the last character, which is `\0` - meaning end of stream. -```php -$body = $response->getBody(); -$body->rewind(); // or $body->seek(0); -$bodyText = $body->getContents(); -``` -> Note: If `$body->seek(1)` is called before `$body->getContents()`, the first character will be ommited as the starting pointer is set to `1`, not `0`. This is why using `$body->rewind()` is recommended. - -### Append to body - -```php -$response->getBody()->write('Hello'); // writing directly -$body = $request->getBody(); // which is a `StreamInterface` -$body->write('xxxxx'); -``` - -### Prepend to body -Prepending is different when it comes to streams. The content must be copied before writing the content to be prepended. -The following example will explain the behaviour of streams. - -```php -// assuming our response is initially empty -$body = $repsonse->getBody(); -// writing the string "abcd" -$body->write('abcd'); - -// seeking to start of stream -$body->seek(0); -// writing 'ef' -$body->write('ef'); // at this point the stream contains "efcd" -``` - -#### Prepending by rewriting separately - -```php -// assuming our response body stream only contains: "abcd" -$body = $response->getBody(); -$body->rewind(); -$contents = $body->getContents(); // abcd -// seeking the stream to beginning -$body->rewind(); -$body->write('ef'); // stream contains "efcd" -$body->write($contents); // stream contains "efabcd" -``` - -> Note: `getContents()` seeks the stream while reading it, therefore if the second `rewind()` method call was not present the stream would have resulted in `abcdefabcd` because the `write()` method appends to stream if not preceeded by `rewind()` or `seek(0)`. - -#### Prepending by using contents as a string -```php -$body = $response->getBody(); -$body->rewind(); -$contents = $body->getContents(); // efabcd -$contents = 'ef'.$contents; -$body->rewind(); -$body->write($contents); -``` diff --git a/system/vendor/psr/http-message/src/MessageInterface.php b/system/vendor/psr/http-message/src/MessageInterface.php deleted file mode 100644 index 8cdb4ed..0000000 --- a/system/vendor/psr/http-message/src/MessageInterface.php +++ /dev/null @@ -1,189 +0,0 @@ -getHeaders() as $name => $values) { - * echo $name . ": " . implode(", ", $values); - * } - * - * // Emit headers iteratively: - * foreach ($message->getHeaders() as $name => $values) { - * foreach ($values as $value) { - * header(sprintf('%s: %s', $name, $value), false); - * } - * } - * - * While header names are not case-sensitive, getHeaders() will preserve the - * exact case in which headers were originally specified. - * - * @return string[][] Returns an associative array of the message's headers. Each - * key MUST be a header name, and each value MUST be an array of strings - * for that header. - */ - public function getHeaders(); - - /** - * Checks if a header exists by the given case-insensitive name. - * - * @param string $name Case-insensitive header field name. - * @return bool Returns true if any header names match the given header - * name using a case-insensitive string comparison. Returns false if - * no matching header name is found in the message. - */ - public function hasHeader(string $name); - - /** - * Retrieves a message header value by the given case-insensitive name. - * - * This method returns an array of all the header values of the given - * case-insensitive header name. - * - * If the header does not appear in the message, this method MUST return an - * empty array. - * - * @param string $name Case-insensitive header field name. - * @return string[] An array of string values as provided for the given - * header. If the header does not appear in the message, this method MUST - * return an empty array. - */ - public function getHeader(string $name); - - /** - * Retrieves a comma-separated string of the values for a single header. - * - * This method returns all of the header values of the given - * case-insensitive header name as a string concatenated together using - * a comma. - * - * NOTE: Not all header values may be appropriately represented using - * comma concatenation. For such headers, use getHeader() instead - * and supply your own delimiter when concatenating. - * - * If the header does not appear in the message, this method MUST return - * an empty string. - * - * @param string $name Case-insensitive header field name. - * @return string A string of values as provided for the given header - * concatenated together using a comma. If the header does not appear in - * the message, this method MUST return an empty string. - */ - public function getHeaderLine(string $name); - - /** - * Return an instance with the provided value replacing the specified header. - * - * While header names are case-insensitive, the casing of the header will - * be preserved by this function, and returned from getHeaders(). - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * new and/or updated header and value. - * - * @param string $name Case-insensitive header field name. - * @param string|string[] $value Header value(s). - * @return static - * @throws \InvalidArgumentException for invalid header names or values. - */ - public function withHeader(string $name, $value); - - /** - * Return an instance with the specified header appended with the given value. - * - * Existing values for the specified header will be maintained. The new - * value(s) will be appended to the existing list. If the header did not - * exist previously, it will be added. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * new header and/or value. - * - * @param string $name Case-insensitive header field name to add. - * @param string|string[] $value Header value(s). - * @return static - * @throws \InvalidArgumentException for invalid header names or values. - */ - public function withAddedHeader(string $name, $value); - - /** - * Return an instance without the specified header. - * - * Header resolution MUST be done without case-sensitivity. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that removes - * the named header. - * - * @param string $name Case-insensitive header field name to remove. - * @return static - */ - public function withoutHeader(string $name); - - /** - * Gets the body of the message. - * - * @return StreamInterface Returns the body as a stream. - */ - public function getBody(); - - /** - * Return an instance with the specified message body. - * - * The body MUST be a StreamInterface object. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return a new instance that has the - * new body stream. - * - * @param StreamInterface $body Body. - * @return static - * @throws \InvalidArgumentException When the body is not valid. - */ - public function withBody(StreamInterface $body); -} diff --git a/system/vendor/psr/http-message/src/RequestInterface.php b/system/vendor/psr/http-message/src/RequestInterface.php deleted file mode 100644 index 38066df..0000000 --- a/system/vendor/psr/http-message/src/RequestInterface.php +++ /dev/null @@ -1,131 +0,0 @@ -getQuery()` - * or from the `QUERY_STRING` server param. - * - * @return array - */ - public function getQueryParams(); - - /** - * Return an instance with the specified query string arguments. - * - * These values SHOULD remain immutable over the course of the incoming - * request. They MAY be injected during instantiation, such as from PHP's - * $_GET superglobal, or MAY be derived from some other value such as the - * URI. In cases where the arguments are parsed from the URI, the data - * MUST be compatible with what PHP's parse_str() would return for - * purposes of how duplicate query parameters are handled, and how nested - * sets are handled. - * - * Setting query string arguments MUST NOT change the URI stored by the - * request, nor the values in the server params. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * updated query string arguments. - * - * @param array $query Array of query string arguments, typically from - * $_GET. - * @return static - */ - public function withQueryParams(array $query); - - /** - * Retrieve normalized file upload data. - * - * This method returns upload metadata in a normalized tree, with each leaf - * an instance of Psr\Http\Message\UploadedFileInterface. - * - * These values MAY be prepared from $_FILES or the message body during - * instantiation, or MAY be injected via withUploadedFiles(). - * - * @return array An array tree of UploadedFileInterface instances; an empty - * array MUST be returned if no data is present. - */ - public function getUploadedFiles(); - - /** - * Create a new instance with the specified uploaded files. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * updated body parameters. - * - * @param array $uploadedFiles An array tree of UploadedFileInterface instances. - * @return static - * @throws \InvalidArgumentException if an invalid structure is provided. - */ - public function withUploadedFiles(array $uploadedFiles); - - /** - * Retrieve any parameters provided in the request body. - * - * If the request Content-Type is either application/x-www-form-urlencoded - * or multipart/form-data, and the request method is POST, this method MUST - * return the contents of $_POST. - * - * Otherwise, this method may return any results of deserializing - * the request body content; as parsing returns structured content, the - * potential types MUST be arrays or objects only. A null value indicates - * the absence of body content. - * - * @return null|array|object The deserialized body parameters, if any. - * These will typically be an array or object. - */ - public function getParsedBody(); - - /** - * Return an instance with the specified body parameters. - * - * These MAY be injected during instantiation. - * - * If the request Content-Type is either application/x-www-form-urlencoded - * or multipart/form-data, and the request method is POST, use this method - * ONLY to inject the contents of $_POST. - * - * The data IS NOT REQUIRED to come from $_POST, but MUST be the results of - * deserializing the request body content. Deserialization/parsing returns - * structured data, and, as such, this method ONLY accepts arrays or objects, - * or a null value if nothing was available to parse. - * - * As an example, if content negotiation determines that the request data - * is a JSON payload, this method could be used to create a request - * instance with the deserialized parameters. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * updated body parameters. - * - * @param null|array|object $data The deserialized body data. This will - * typically be in an array or object. - * @return static - * @throws \InvalidArgumentException if an unsupported argument type is - * provided. - */ - public function withParsedBody($data); - - /** - * Retrieve attributes derived from the request. - * - * The request "attributes" may be used to allow injection of any - * parameters derived from the request: e.g., the results of path - * match operations; the results of decrypting cookies; the results of - * deserializing non-form-encoded message bodies; etc. Attributes - * will be application and request specific, and CAN be mutable. - * - * @return array Attributes derived from the request. - */ - public function getAttributes(); - - /** - * Retrieve a single derived request attribute. - * - * Retrieves a single derived request attribute as described in - * getAttributes(). If the attribute has not been previously set, returns - * the default value as provided. - * - * This method obviates the need for a hasAttribute() method, as it allows - * specifying a default value to return if the attribute is not found. - * - * @see getAttributes() - * @param string $name The attribute name. - * @param mixed $default Default value to return if the attribute does not exist. - * @return mixed - */ - public function getAttribute(string $name, $default = null); - - /** - * Return an instance with the specified derived request attribute. - * - * This method allows setting a single derived request attribute as - * described in getAttributes(). - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * updated attribute. - * - * @see getAttributes() - * @param string $name The attribute name. - * @param mixed $value The value of the attribute. - * @return static - */ - public function withAttribute(string $name, $value); - - /** - * Return an instance that removes the specified derived request attribute. - * - * This method allows removing a single derived request attribute as - * described in getAttributes(). - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that removes - * the attribute. - * - * @see getAttributes() - * @param string $name The attribute name. - * @return static - */ - public function withoutAttribute(string $name); -} diff --git a/system/vendor/psr/http-message/src/StreamInterface.php b/system/vendor/psr/http-message/src/StreamInterface.php deleted file mode 100644 index 5924663..0000000 --- a/system/vendor/psr/http-message/src/StreamInterface.php +++ /dev/null @@ -1,160 +0,0 @@ - - * [user-info@]host[:port] - * - * - * If the port component is not set or is the standard port for the current - * scheme, it SHOULD NOT be included. - * - * @see https://tools.ietf.org/html/rfc3986#section-3.2 - * @return string The URI authority, in "[user-info@]host[:port]" format. - */ - public function getAuthority(); - - /** - * Retrieve the user information component of the URI. - * - * If no user information is present, this method MUST return an empty - * string. - * - * If a user is present in the URI, this will return that value; - * additionally, if the password is also present, it will be appended to the - * user value, with a colon (":") separating the values. - * - * The trailing "@" character is not part of the user information and MUST - * NOT be added. - * - * @return string The URI user information, in "username[:password]" format. - */ - public function getUserInfo(); - - /** - * Retrieve the host component of the URI. - * - * If no host is present, this method MUST return an empty string. - * - * The value returned MUST be normalized to lowercase, per RFC 3986 - * Section 3.2.2. - * - * @see http://tools.ietf.org/html/rfc3986#section-3.2.2 - * @return string The URI host. - */ - public function getHost(); - - /** - * Retrieve the port component of the URI. - * - * If a port is present, and it is non-standard for the current scheme, - * this method MUST return it as an integer. If the port is the standard port - * used with the current scheme, this method SHOULD return null. - * - * If no port is present, and no scheme is present, this method MUST return - * a null value. - * - * If no port is present, but a scheme is present, this method MAY return - * the standard port for that scheme, but SHOULD return null. - * - * @return null|int The URI port. - */ - public function getPort(); - - /** - * Retrieve the path component of the URI. - * - * The path can either be empty or absolute (starting with a slash) or - * rootless (not starting with a slash). Implementations MUST support all - * three syntaxes. - * - * Normally, the empty path "" and absolute path "/" are considered equal as - * defined in RFC 7230 Section 2.7.3. But this method MUST NOT automatically - * do this normalization because in contexts with a trimmed base path, e.g. - * the front controller, this difference becomes significant. It's the task - * of the user to handle both "" and "/". - * - * The value returned MUST be percent-encoded, but MUST NOT double-encode - * any characters. To determine what characters to encode, please refer to - * RFC 3986, Sections 2 and 3.3. - * - * As an example, if the value should include a slash ("/") not intended as - * delimiter between path segments, that value MUST be passed in encoded - * form (e.g., "%2F") to the instance. - * - * @see https://tools.ietf.org/html/rfc3986#section-2 - * @see https://tools.ietf.org/html/rfc3986#section-3.3 - * @return string The URI path. - */ - public function getPath(); - - /** - * Retrieve the query string of the URI. - * - * If no query string is present, this method MUST return an empty string. - * - * The leading "?" character is not part of the query and MUST NOT be - * added. - * - * The value returned MUST be percent-encoded, but MUST NOT double-encode - * any characters. To determine what characters to encode, please refer to - * RFC 3986, Sections 2 and 3.4. - * - * As an example, if a value in a key/value pair of the query string should - * include an ampersand ("&") not intended as a delimiter between values, - * that value MUST be passed in encoded form (e.g., "%26") to the instance. - * - * @see https://tools.ietf.org/html/rfc3986#section-2 - * @see https://tools.ietf.org/html/rfc3986#section-3.4 - * @return string The URI query string. - */ - public function getQuery(); - - /** - * Retrieve the fragment component of the URI. - * - * If no fragment is present, this method MUST return an empty string. - * - * The leading "#" character is not part of the fragment and MUST NOT be - * added. - * - * The value returned MUST be percent-encoded, but MUST NOT double-encode - * any characters. To determine what characters to encode, please refer to - * RFC 3986, Sections 2 and 3.5. - * - * @see https://tools.ietf.org/html/rfc3986#section-2 - * @see https://tools.ietf.org/html/rfc3986#section-3.5 - * @return string The URI fragment. - */ - public function getFragment(); - - /** - * Return an instance with the specified scheme. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified scheme. - * - * Implementations MUST support the schemes "http" and "https" case - * insensitively, and MAY accommodate other schemes if required. - * - * An empty scheme is equivalent to removing the scheme. - * - * @param string $scheme The scheme to use with the new instance. - * @return static A new instance with the specified scheme. - * @throws \InvalidArgumentException for invalid or unsupported schemes. - */ - public function withScheme(string $scheme); - - /** - * Return an instance with the specified user information. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified user information. - * - * Password is optional, but the user information MUST include the - * user; an empty string for the user is equivalent to removing user - * information. - * - * @param string $user The user name to use for authority. - * @param null|string $password The password associated with $user. - * @return static A new instance with the specified user information. - */ - public function withUserInfo(string $user, ?string $password = null); - - /** - * Return an instance with the specified host. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified host. - * - * An empty host value is equivalent to removing the host. - * - * @param string $host The hostname to use with the new instance. - * @return static A new instance with the specified host. - * @throws \InvalidArgumentException for invalid hostnames. - */ - public function withHost(string $host); - - /** - * Return an instance with the specified port. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified port. - * - * Implementations MUST raise an exception for ports outside the - * established TCP and UDP port ranges. - * - * A null value provided for the port is equivalent to removing the port - * information. - * - * @param null|int $port The port to use with the new instance; a null value - * removes the port information. - * @return static A new instance with the specified port. - * @throws \InvalidArgumentException for invalid ports. - */ - public function withPort(?int $port); - - /** - * Return an instance with the specified path. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified path. - * - * The path can either be empty or absolute (starting with a slash) or - * rootless (not starting with a slash). Implementations MUST support all - * three syntaxes. - * - * If the path is intended to be domain-relative rather than path relative then - * it must begin with a slash ("/"). Paths not starting with a slash ("/") - * are assumed to be relative to some base path known to the application or - * consumer. - * - * Users can provide both encoded and decoded path characters. - * Implementations ensure the correct encoding as outlined in getPath(). - * - * @param string $path The path to use with the new instance. - * @return static A new instance with the specified path. - * @throws \InvalidArgumentException for invalid paths. - */ - public function withPath(string $path); - - /** - * Return an instance with the specified query string. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified query string. - * - * Users can provide both encoded and decoded query characters. - * Implementations ensure the correct encoding as outlined in getQuery(). - * - * An empty query string value is equivalent to removing the query string. - * - * @param string $query The query string to use with the new instance. - * @return static A new instance with the specified query string. - * @throws \InvalidArgumentException for invalid query strings. - */ - public function withQuery(string $query); - - /** - * Return an instance with the specified URI fragment. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified URI fragment. - * - * Users can provide both encoded and decoded fragment characters. - * Implementations ensure the correct encoding as outlined in getFragment(). - * - * An empty fragment value is equivalent to removing the fragment. - * - * @param string $fragment The fragment to use with the new instance. - * @return static A new instance with the specified fragment. - */ - public function withFragment(string $fragment); - - /** - * Return the string representation as a URI reference. - * - * Depending on which components of the URI are present, the resulting - * string is either a full URI or relative reference according to RFC 3986, - * Section 4.1. The method concatenates the various components of the URI, - * using the appropriate delimiters: - * - * - If a scheme is present, it MUST be suffixed by ":". - * - If an authority is present, it MUST be prefixed by "//". - * - The path can be concatenated without delimiters. But there are two - * cases where the path has to be adjusted to make the URI reference - * valid as PHP does not allow to throw an exception in __toString(): - * - If the path is rootless and an authority is present, the path MUST - * be prefixed by "/". - * - If the path is starting with more than one "/" and no authority is - * present, the starting slashes MUST be reduced to one. - * - If a query is present, it MUST be prefixed by "?". - * - If a fragment is present, it MUST be prefixed by "#". - * - * @see http://tools.ietf.org/html/rfc3986#section-4.1 - * @return string - */ - public function __toString(); -} diff --git a/system/vendor/psr/http-server-handler/LICENSE b/system/vendor/psr/http-server-handler/LICENSE deleted file mode 100644 index b71ec5d..0000000 --- a/system/vendor/psr/http-server-handler/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2016 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/system/vendor/psr/http-server-handler/README.md b/system/vendor/psr/http-server-handler/README.md deleted file mode 100644 index 111a9ed..0000000 --- a/system/vendor/psr/http-server-handler/README.md +++ /dev/null @@ -1,12 +0,0 @@ -HTTP Server Request Handlers for Middleware -=========================================== - -This repository holds the `RequestHandlerInterface` related to [PSR-15 (HTTP Server Request Handlers)][psr-url]. - -Note that this is not a Server Request Handler implementation of its own. It is merely the interface that describe a Server Request Handler. - -The installable [package][package-url] and [implementations][implementation-url] are listed on Packagist. - -[psr-url]: https://www.php-fig.org/psr/psr-15/ -[package-url]: https://packagist.org/packages/psr/http-server-handler -[implementation-url]: https://packagist.org/providers/psr/http-server-handler-implementation diff --git a/system/vendor/psr/http-server-handler/composer.json b/system/vendor/psr/http-server-handler/composer.json deleted file mode 100644 index c54b2de..0000000 --- a/system/vendor/psr/http-server-handler/composer.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "psr/http-server-handler", - "description": "Common interface for HTTP server-side request handler", - "keywords": [ - "psr", - "psr-7", - "psr-15", - "http-interop", - "http", - "server", - "handler", - "request", - "response" - ], - "license": "MIT", - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "require": { - "php": ">=7.0", - "psr/http-message": "^1.0 || ^2.0" - }, - "autoload": { - "psr-4": { - "Psr\\Http\\Server\\": "src/" - } - }, - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - } -} diff --git a/system/vendor/psr/http-server-handler/src/RequestHandlerInterface.php b/system/vendor/psr/http-server-handler/src/RequestHandlerInterface.php deleted file mode 100644 index 83911e2..0000000 --- a/system/vendor/psr/http-server-handler/src/RequestHandlerInterface.php +++ /dev/null @@ -1,22 +0,0 @@ -=7.0", - "psr/http-message": "^1.0 || ^2.0", - "psr/http-server-handler": "^1.0" - }, - "autoload": { - "psr-4": { - "Psr\\Http\\Server\\": "src/" - } - }, - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - } -} diff --git a/system/vendor/psr/http-server-middleware/src/MiddlewareInterface.php b/system/vendor/psr/http-server-middleware/src/MiddlewareInterface.php deleted file mode 100644 index a6c14f8..0000000 --- a/system/vendor/psr/http-server-middleware/src/MiddlewareInterface.php +++ /dev/null @@ -1,25 +0,0 @@ -logger = $logger; - } - - public function doSomething() - { - 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 - } -} -``` - -You can then pick one of the implementations of the interface to get a logger. - -If you want to implement the interface, you can require this package and -implement `Psr\Log\LoggerInterface` in your code. Please read the -[specification text](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md) -for details. diff --git a/system/vendor/psr/log/composer.json b/system/vendor/psr/log/composer.json deleted file mode 100644 index 879fc6f..0000000 --- a/system/vendor/psr/log/composer.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "psr/log", - "description": "Common interface for logging libraries", - "keywords": ["psr", "psr-3", "log"], - "homepage": "https://github.com/php-fig/log", - "license": "MIT", - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "require": { - "php": ">=8.0.0" - }, - "autoload": { - "psr-4": { - "Psr\\Log\\": "src" - } - }, - "extra": { - "branch-alias": { - "dev-master": "3.x-dev" - } - } -} diff --git a/system/vendor/psr/log/src/AbstractLogger.php b/system/vendor/psr/log/src/AbstractLogger.php deleted file mode 100644 index d60a091..0000000 --- a/system/vendor/psr/log/src/AbstractLogger.php +++ /dev/null @@ -1,15 +0,0 @@ -logger = $logger; - } -} diff --git a/system/vendor/psr/log/src/LoggerInterface.php b/system/vendor/psr/log/src/LoggerInterface.php deleted file mode 100644 index b3a24b5..0000000 --- a/system/vendor/psr/log/src/LoggerInterface.php +++ /dev/null @@ -1,125 +0,0 @@ -log(LogLevel::EMERGENCY, $message, $context); - } - - /** - * Action must be taken immediately. - * - * Example: Entire website down, database unavailable, etc. This should - * trigger the SMS alerts and wake you up. - * - * @param string|\Stringable $message - * @param array $context - * - * @return void - */ - public function alert(string|\Stringable $message, array $context = []): void - { - $this->log(LogLevel::ALERT, $message, $context); - } - - /** - * Critical conditions. - * - * Example: Application component unavailable, unexpected exception. - * - * @param string|\Stringable $message - * @param array $context - * - * @return void - */ - public function critical(string|\Stringable $message, array $context = []): void - { - $this->log(LogLevel::CRITICAL, $message, $context); - } - - /** - * Runtime errors that do not require immediate action but should typically - * be logged and monitored. - * - * @param string|\Stringable $message - * @param array $context - * - * @return void - */ - public function error(string|\Stringable $message, array $context = []): void - { - $this->log(LogLevel::ERROR, $message, $context); - } - - /** - * Exceptional occurrences that are not errors. - * - * Example: Use of deprecated APIs, poor use of an API, undesirable things - * that are not necessarily wrong. - * - * @param string|\Stringable $message - * @param array $context - * - * @return void - */ - public function warning(string|\Stringable $message, array $context = []): void - { - $this->log(LogLevel::WARNING, $message, $context); - } - - /** - * Normal but significant events. - * - * @param string|\Stringable $message - * @param array $context - * - * @return void - */ - public function notice(string|\Stringable $message, array $context = []): void - { - $this->log(LogLevel::NOTICE, $message, $context); - } - - /** - * Interesting events. - * - * Example: User logs in, SQL logs. - * - * @param string|\Stringable $message - * @param array $context - * - * @return void - */ - public function info(string|\Stringable $message, array $context = []): void - { - $this->log(LogLevel::INFO, $message, $context); - } - - /** - * Detailed debug information. - * - * @param string|\Stringable $message - * @param array $context - * - * @return void - */ - public function debug(string|\Stringable $message, array $context = []): void - { - $this->log(LogLevel::DEBUG, $message, $context); - } - - /** - * Logs with an arbitrary level. - * - * @param mixed $level - * @param string|\Stringable $message - * @param array $context - * - * @return void - * - * @throws \Psr\Log\InvalidArgumentException - */ - abstract public function log($level, string|\Stringable $message, array $context = []): void; -} diff --git a/system/vendor/psr/log/src/NullLogger.php b/system/vendor/psr/log/src/NullLogger.php deleted file mode 100644 index c1cc3c0..0000000 --- a/system/vendor/psr/log/src/NullLogger.php +++ /dev/null @@ -1,30 +0,0 @@ -logger) { }` - * blocks. - */ -class NullLogger extends AbstractLogger -{ - /** - * Logs with an arbitrary level. - * - * @param mixed $level - * @param string|\Stringable $message - * @param array $context - * - * @return void - * - * @throws \Psr\Log\InvalidArgumentException - */ - public function log($level, string|\Stringable $message, array $context = []): void - { - // noop - } -} diff --git a/system/vendor/ralouphie/getallheaders/LICENSE b/system/vendor/ralouphie/getallheaders/LICENSE deleted file mode 100644 index be5540c..0000000 --- a/system/vendor/ralouphie/getallheaders/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Ralph Khattar - -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/system/vendor/ralouphie/getallheaders/README.md b/system/vendor/ralouphie/getallheaders/README.md deleted file mode 100644 index 9430d76..0000000 --- a/system/vendor/ralouphie/getallheaders/README.md +++ /dev/null @@ -1,27 +0,0 @@ -getallheaders -============= - -PHP `getallheaders()` polyfill. Compatible with PHP >= 5.3. - -[![Build Status](https://travis-ci.org/ralouphie/getallheaders.svg?branch=master)](https://travis-ci.org/ralouphie/getallheaders) -[![Coverage Status](https://coveralls.io/repos/ralouphie/getallheaders/badge.png?branch=master)](https://coveralls.io/r/ralouphie/getallheaders?branch=master) -[![Latest Stable Version](https://poser.pugx.org/ralouphie/getallheaders/v/stable.png)](https://packagist.org/packages/ralouphie/getallheaders) -[![Latest Unstable Version](https://poser.pugx.org/ralouphie/getallheaders/v/unstable.png)](https://packagist.org/packages/ralouphie/getallheaders) -[![License](https://poser.pugx.org/ralouphie/getallheaders/license.png)](https://packagist.org/packages/ralouphie/getallheaders) - - -This is a simple polyfill for [`getallheaders()`](http://www.php.net/manual/en/function.getallheaders.php). - -## Install - -For PHP version **`>= 5.6`**: - -``` -composer require ralouphie/getallheaders -``` - -For PHP version **`< 5.6`**: - -``` -composer require ralouphie/getallheaders "^2" -``` diff --git a/system/vendor/ralouphie/getallheaders/composer.json b/system/vendor/ralouphie/getallheaders/composer.json deleted file mode 100644 index de8ce62..0000000 --- a/system/vendor/ralouphie/getallheaders/composer.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "ralouphie/getallheaders", - "description": "A polyfill for getallheaders.", - "license": "MIT", - "authors": [ - { - "name": "Ralph Khattar", - "email": "ralph.khattar@gmail.com" - } - ], - "require": { - "php": ">=5.6" - }, - "require-dev": { - "phpunit/phpunit": "^5 || ^6.5", - "php-coveralls/php-coveralls": "^2.1" - }, - "autoload": { - "files": ["src/getallheaders.php"] - }, - "autoload-dev": { - "psr-4": { - "getallheaders\\Tests\\": "tests/" - } - } -} diff --git a/system/vendor/ralouphie/getallheaders/src/getallheaders.php b/system/vendor/ralouphie/getallheaders/src/getallheaders.php deleted file mode 100644 index c7285a5..0000000 --- a/system/vendor/ralouphie/getallheaders/src/getallheaders.php +++ /dev/null @@ -1,46 +0,0 @@ - 'Content-Type', - 'CONTENT_LENGTH' => 'Content-Length', - 'CONTENT_MD5' => 'Content-Md5', - ); - - foreach ($_SERVER as $key => $value) { - if (substr($key, 0, 5) === 'HTTP_') { - $key = substr($key, 5); - if (!isset($copy_server[$key]) || !isset($_SERVER[$key])) { - $key = str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', $key)))); - $headers[$key] = $value; - } - } elseif (isset($copy_server[$key])) { - $headers[$copy_server[$key]] = $value; - } - } - - if (!isset($headers['Authorization'])) { - if (isset($_SERVER['REDIRECT_HTTP_AUTHORIZATION'])) { - $headers['Authorization'] = $_SERVER['REDIRECT_HTTP_AUTHORIZATION']; - } elseif (isset($_SERVER['PHP_AUTH_USER'])) { - $basic_pass = isset($_SERVER['PHP_AUTH_PW']) ? $_SERVER['PHP_AUTH_PW'] : ''; - $headers['Authorization'] = 'Basic ' . base64_encode($_SERVER['PHP_AUTH_USER'] . ':' . $basic_pass); - } elseif (isset($_SERVER['PHP_AUTH_DIGEST'])) { - $headers['Authorization'] = $_SERVER['PHP_AUTH_DIGEST']; - } - } - - return $headers; - } - -} diff --git a/system/vendor/slim/csrf/CHANGELOG.md b/system/vendor/slim/csrf/CHANGELOG.md deleted file mode 100644 index c577ad7..0000000 --- a/system/vendor/slim/csrf/CHANGELOG.md +++ /dev/null @@ -1,22 +0,0 @@ -# Change Log - -## 2016-08-14 - -Now supports "persistence mode", to persist a single CSRF name/value pair throughout the life of a user's session. Added the following methods: - -- `protected getLastKeyPair` - gets the most recently generated key/value pair from storage. -- `protected loadLastKeyPair` - gets the most recently generated key/value pair from storage, and assign it to `$this->keyPair`. -- `public setPersistentTokenMode` -- `public getPersistentTokenMode` - -Note that if CSRF token validation fails, then the token should be renewed regardless of the persistence setting. - -The methods `getTokenName` and `getTokenValue` now return `null` if `$this->keyPair` has not yet been set. - -### Tests added: - -- `testPersistenceModeTrueBetweenRequestsArray` - Token should persist between requests after initial creation, when stored in an array. -- `testPersistenceModeTrueBetweenRequestsArrayAccess` - Token should persist between requests after initial creation, when stored in an ArrayObject. -- `testPersistenceModeFalseBetweenRequestsArray` - Token should be changed between requests, when stored in an array. -- `testPersistenceModeFalseBetweenRequestsArrayAccess` - Token should be changed between requests, when stored in an ArrayObject. -- `testUpdateAfterInvalidTokenWithPersistenceModeTrue` - New token should be generated after an invalid request, even if persistence mode is enabled. \ No newline at end of file diff --git a/system/vendor/slim/csrf/LICENSE.md b/system/vendor/slim/csrf/LICENSE.md deleted file mode 100644 index 130902a..0000000 --- a/system/vendor/slim/csrf/LICENSE.md +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2012-2015 Josh Lockhart - -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/system/vendor/slim/csrf/composer.json b/system/vendor/slim/csrf/composer.json deleted file mode 100644 index ea2f030..0000000 --- a/system/vendor/slim/csrf/composer.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "slim/csrf", - "type": "library", - "description": "Slim Framework 4 CSRF protection PSR-15 middleware", - "keywords": ["slim","framework","middleware","csrf"], - "homepage": "https://www.slimframework.com", - "license": "MIT", - "authors": [ - { - "name": "Josh Lockhart", - "email": "hello@joshlockhart.com", - "homepage": "http://joshlockhart.com" - } - ], - "config": { - "sort-packages": true - }, - "require": { - "php": "^7.4 || ^8.0", - "psr/http-factory": "^1.0", - "psr/http-message": "^1.0", - "psr/http-server-handler": "^1.0", - "psr/http-server-middleware": "^1.0" - }, - "require-dev": { - "phpspec/prophecy": "^1.15", - "phpspec/prophecy-phpunit": "^2.0", - "phpunit/phpunit": "^9.5", - "squizlabs/php_codesniffer": "^3.7" - }, - "autoload": { - "psr-4": { - "Slim\\Csrf\\": "src" - } - }, - "autoload-dev": { - "psr-4": { - "Slim\\Csrf\\Tests\\": "tests" - } - } -} diff --git a/system/vendor/slim/csrf/src/Guard.php b/system/vendor/slim/csrf/src/Guard.php deleted file mode 100644 index 9bd7df7..0000000 --- a/system/vendor/slim/csrf/src/Guard.php +++ /dev/null @@ -1,540 +0,0 @@ -responseFactory = $responseFactory; - $this->prefix = rtrim($prefix, '_'); - $this->strength = $strength; - - $this->setStorage($storage); - $this->setFailureHandler($failureHandler); - $this->setStorageLimit($storageLimit); - $this->setPersistentTokenMode($persistentTokenMode); - } - - /** - * @param array|ArrayAccess|null $storage - * - * @return self - * - * @throws RuntimeException - */ - public function setStorage(&$storage = null): self - { - if ( - is_array($storage) - || ($storage instanceof ArrayAccess && $storage instanceof Countable && $storage instanceof Iterator) - ) { - $this->storage = &$storage; - return $this; - } - - if (session_status() !== PHP_SESSION_ACTIVE) { - throw new RuntimeException( - 'Invalid CSRF storage. ' . - 'Use session_start() before instantiating the Guard middleware or provide array storage.' - ); - } - - if (!array_key_exists($this->prefix, $_SESSION) || !is_array($_SESSION[$this->prefix])) { - $_SESSION[$this->prefix] = []; - } - - $this->storage = &$_SESSION[$this->prefix]; - return $this; - } - - /** - * @param callable|null $failureHandler Value to set - * - * @return self - */ - public function setFailureHandler(?callable $failureHandler): self - { - $this->failureHandler = $failureHandler; - return $this; - } - - /** - * @param bool $persistentTokenMode True to use the same token throughout the session - * (unless there is a validation error), false to get a new token with each request. - * - * @return self - */ - public function setPersistentTokenMode(bool $persistentTokenMode): self - { - $this->persistentTokenMode = $persistentTokenMode; - return $this; - } - - /** - * @param int $storageLimit Value to set - * - * @return self - */ - public function setStorageLimit(int $storageLimit): self - { - $this->storageLimit = $storageLimit; - return $this; - } - - /** - * @return string - * - * @throws Exception - */ - protected function createToken(): string - { - return bin2hex(random_bytes($this->strength)); - } - - /** - * @return array - * - * @throws Exception - */ - public function generateToken(): array - { - // Generate new CSRF token - $name = uniqid($this->prefix); - $value = $this->createToken(); - $this->saveTokenToStorage($name, $value); - - - $this->keyPair = [ - $this->getTokenNameKey() => $name, - $this->getTokenValueKey() => $this->maskToken($value) - ]; - $this->enforceStorageLimit(); - return $this->keyPair; - } - - /** - * Validate CSRF token from current request against token value - * stored in $_SESSION or user provided storage - * - * @param string $name CSRF name - * @param string $value CSRF token value - * - * @return bool - */ - public function validateToken(string $name, string $value): bool - { - if (!isset($this->storage[$name])) { - return false; - } - - $token = $this->storage[$name]; - - return hash_equals($token, $this->unmaskToken($value)); - } - - /** - * @return string|null - */ - public function getTokenName(): ?string - { - return $this->keyPair[$this->getTokenNameKey()] ?? null; - } - - /** - * @return string|null - */ - public function getTokenValue(): ?string - { - return $this->keyPair[$this->getTokenValueKey()] ?? null; - } - - /** - * @return string - */ - public function getTokenNameKey(): string - { - return $this->prefix . '_name'; - } - - /** - * @return string - */ - public function getTokenValueKey(): string - { - return $this->prefix . '_value'; - } - - /** - * @return bool - */ - public function getPersistentTokenMode(): bool - { - return $this->persistentTokenMode; - } - - /** - * @return string[]|null - * - * @throws Exception - */ - protected function getLastKeyPair(): ?array - { - if ( - (is_array($this->storage) && empty($this->storage)) - || ($this->storage instanceof Countable && count($this->storage) < 1) - ) { - return null; - } - - $name = null; - $value = null; - if (is_array($this->storage)) { - end($this->storage); - $name = key($this->storage); - $value = $this->storage[$name]; - reset($this->storage); - } elseif ($this->storage instanceof Iterator) { - $this->storage->rewind(); - while ($this->storage->valid()) { - $name = $this->storage->key(); - $value = $this->storage->current(); - $this->storage->next(); - } - $this->storage->rewind(); - } - - return $name !== null && $value !== null - ? [ - $this->getTokenNameKey() => $name, - $this->getTokenValueKey() => $this->maskToken($value) - ] - : null; - } - - /** - * Load the most recent key pair in storage. - * - * @return bool `true` if there was a key pair to load in storage, false otherwise. - * - * @throws Exception - */ - protected function loadLastKeyPair(): bool - { - return (bool) $this->keyPair = $this->getLastKeyPair(); - } - - /** - * @param string $name CSRF token name - * @param string $value CSRF token value - * - * @return void - */ - protected function saveTokenToStorage(string $name, string $value): void - { - $this->storage[$name] = $value; - } - - /** - * Remove token from storage - * - * @param string $name CSRF token name - * - * @return void - */ - public function removeTokenFromStorage(string $name): void - { - $this->storage[$name] = ''; - unset($this->storage[$name]); - } - - /** - * Remove the oldest tokens from the storage array so that there - * are never more than storageLimit tokens in the array. - * - * This is required as a token is generated every request and so - * most will never be used. - * - * @return void - */ - protected function enforceStorageLimit(): void - { - if ( - $this->storageLimit === 0 - || ( - !is_array($this->storage) - && !($this->storage instanceof Countable && $this->storage instanceof Iterator) - ) - ) { - return; - } - - if (is_array($this->storage)) { - while (count($this->storage) > $this->storageLimit) { - array_shift($this->storage); - } - return; - } - - if ($this->storage instanceof Iterator) { - while (count($this->storage) > $this->storageLimit) { - $this->storage->rewind(); - unset($this->storage[$this->storage->key()]); - } - } - } - - /** - * @param ServerRequestInterface $request - * - * @return ServerRequestInterface - * - * @throws Exception - */ - public function appendNewTokenToRequest(ServerRequestInterface $request): ServerRequestInterface - { - $token = $this->generateToken(); - return $this->appendTokenToRequest($request, $token); - } - - /** - * @param ServerRequestInterface $request - * @param array $pair - * - * @return ServerRequestInterface - */ - protected function appendTokenToRequest(ServerRequestInterface $request, array $pair): ServerRequestInterface - { - $name = $this->getTokenNameKey(); - $value = $this->getTokenValueKey(); - return $request - ->withAttribute($name, $pair[$name]) - ->withAttribute($value, $pair[$value]); - } - - /** - * @param ServerRequestInterface $request - * @param RequestHandlerInterface $handler - * - * @return ResponseInterface - * - * @throws Exception - */ - public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface - { - $body = $request->getParsedBody(); - $name = null; - $value = null; - - if (is_array($body)) { - $name = $body[$this->getTokenNameKey()] ?? null; - $value = $body[$this->getTokenValueKey()] ?? null; - } - - if (in_array($request->getMethod(), ['POST', 'PUT', 'DELETE', 'PATCH'])) { - $isValid = $this->validateToken((string) $name, (string) $value); - if ($isValid && !$this->persistentTokenMode) { - // successfully validated token, so delete it if not in persistentTokenMode - $this->removeTokenFromStorage($name); - } - - if ($name === null || $value === null || !$isValid) { - $request = $this->appendNewTokenToRequest($request); - return $this->handleFailure($request, $handler); - } - } else { - // Method is GET/OPTIONS/HEAD/etc, so do not accept the token in the body of this request - if ($name !== null) { - $this->enforceStorageLimit(); - return $this->handleFailure($request, $handler); - } - } - - if (!$this->persistentTokenMode || !$this->loadLastKeyPair()) { - $request = $this->appendNewTokenToRequest($request); - } else { - $pair = $this->loadLastKeyPair() ? $this->keyPair : $this->generateToken(); - $request = $this->appendTokenToRequest($request, $pair); - } - $this->enforceStorageLimit(); - - return $handler->handle($request); - } - - /** - * @param ServerRequestInterface $request - * @param RequestHandlerInterface $handler - * - * @return ResponseInterface - */ - public function handleFailure(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface - { - if (!is_callable($this->failureHandler)) { - $response = $this->responseFactory->createResponse(); - $body = $response->getBody(); - $body->write('Failed CSRF check!'); - return $response - ->withStatus(400) - ->withHeader('Content-Type', 'text/plain') - ->withBody($body); - } - - return call_user_func($this->failureHandler, $request, $handler); - } - - /** - * Mask token using random key and doing a XOR between this key and provided token. It will prevent BREACH attack. - * - * @param string $token Token to mask - * - * @return string Masked token, base64 encoded - * - * @throws Exception - */ - private function maskToken(string $token): string - { - // Key length need to be the same as the length of the token - $key = random_bytes(strlen($token)); - return base64_encode($key . ($key ^ $token)); - } - - /** - * @param string $maskedToken Masked token, base64 encoded - * - * @return string Unmasked token - * - * @see maskToken() - */ - private function unmaskToken(string $maskedToken): string - { - $decoded = base64_decode($maskedToken, true); - if ($decoded === false) { - return ''; - } - $tokenLength = strlen($decoded) / 2; - // If $tokenLength is not an int value, token is invalid (token length and key length need to be the same) - if (!is_int($tokenLength)) { - return ''; - } - - $key = substr($decoded, 0, $tokenLength); - $decodedMaskedToken = substr($decoded, $tokenLength, $tokenLength); - - return $key ^ $decodedMaskedToken; - } -} diff --git a/system/vendor/slim/flash/.gitignore b/system/vendor/slim/flash/.gitignore deleted file mode 100644 index 43c5622..0000000 --- a/system/vendor/slim/flash/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -vendor -composer.lock diff --git a/system/vendor/slim/flash/.travis.yml b/system/vendor/slim/flash/.travis.yml deleted file mode 100644 index 48814a2..0000000 --- a/system/vendor/slim/flash/.travis.yml +++ /dev/null @@ -1,16 +0,0 @@ -language: php - -php: - - 5.5 - - 5.6 - - 7.0 - - 7.1 - - hhvm - -matrix: - allow_failures: - - php: hhvm - -before_script: composer install - -script: phpunit --coverage-text diff --git a/system/vendor/slim/flash/CONTRIBUTING.md b/system/vendor/slim/flash/CONTRIBUTING.md deleted file mode 100644 index 6872439..0000000 --- a/system/vendor/slim/flash/CONTRIBUTING.md +++ /dev/null @@ -1,19 +0,0 @@ -# How to Contribute - -## Pull Requests - -1. Fork this repository -2. Create a new branch for each feature or improvement -3. Send a pull request from each feature branch - -It is very important to separate new features or improvements into separate feature branches, and to send a pull request for each branch. This allows me to review and pull in new features or improvements individually. - -## Style Guide - -All pull requests must adhere to the [PSR-2 standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md). - -## Unit Testing - -All pull requests must be accompanied by passing unit tests and complete code coverage. The Slim Framework uses phpunit for testing. - -[Learn about PHPUnit](https://github.com/sebastianbergmann/phpunit/) diff --git a/system/vendor/slim/flash/LICENSE.md b/system/vendor/slim/flash/LICENSE.md deleted file mode 100644 index 242ec2a..0000000 --- a/system/vendor/slim/flash/LICENSE.md +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2012-2015 Josh Lockhart - -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/system/vendor/slim/flash/README.md b/system/vendor/slim/flash/README.md deleted file mode 100644 index 2b2a30a..0000000 --- a/system/vendor/slim/flash/README.md +++ /dev/null @@ -1,82 +0,0 @@ -# Slim Framework Flash Messages - -[![Build Status](https://travis-ci.org/slimphp/Slim-Flash.svg?branch=master)](https://travis-ci.org/slimphp/Slim-Flash) - -This repository contains a Slim Framework Flash messages service provider. This enables you to define transient messages that persist only from the current request to the next request. - -## Install - -Via Composer - -``` bash -$ composer require slim/flash -``` - -Requires Slim 3.0.0 or newer. - -## Usage - -```php -// Start PHP session -session_start(); - -$app = new \Slim\App(); - -// Fetch DI Container -$container = $app->getContainer(); - -// Register provider -$container['flash'] = function () { - return new \Slim\Flash\Messages(); -}; - -$app->get('/foo', function ($req, $res, $args) { - // Set flash message for next request - $this->flash->addMessage('Test', 'This is a message'); - - // Redirect - return $res->withStatus(302)->withHeader('Location', '/bar'); -}); - -$app->get('/bar', function ($req, $res, $args) { - // Get flash messages from previous request - $messages = $this->flash->getMessages(); - print_r($messages); - - // Get the first message from a specific key - $test = $this->flash->getFirstMessage('Test'); - print_r($test); -}); - -$app->run(); -``` - -> Please note that a message could be a string, object or array. Please check what your storage can handle. - -### Using with Twig-View - -If you use [Twig-View](https://github.com/slimphp/Twig-View), then [slim-twig-flash](https://github.com/kanellov/slim-twig-flash) may be a useful integration package. - - -## Testing - -``` bash -$ phpunit -``` - -## Contributing - -Please see [CONTRIBUTING](CONTRIBUTING.md) for details. - -## Security - -If you discover any security related issues, please email security@slimframework.com instead of using the issue tracker. - -## Credits - -- [Josh Lockhart](https://github.com/codeguy) -- [All Contributors](../../contributors) - -## License - -The MIT License (MIT). Please see [License File](LICENSE.md) for more information. diff --git a/system/vendor/slim/flash/composer.json b/system/vendor/slim/flash/composer.json deleted file mode 100644 index a25a493..0000000 --- a/system/vendor/slim/flash/composer.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "slim/flash", - "type": "library", - "description": "Slim Framework Flash message service provider", - "keywords": ["slim","framework","provider","flash","message"], - "homepage": "http://slimframework.com", - "license": "MIT", - "authors": [ - { - "name": "Josh Lockhart", - "email": "hello@joshlockhart.com", - "homepage": "http://joshlockhart.com" - } - ], - "require": { - "php": ">=5.5.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.0" - }, - "autoload": { - "psr-4": { - "Slim\\Flash\\": "src" - } - }, - "autoload-dev": { - "psr-4": { - "Slim\\Flash\\Tests\\": "tests" - } - } -} diff --git a/system/vendor/slim/flash/phpunit.xml.dist b/system/vendor/slim/flash/phpunit.xml.dist deleted file mode 100644 index 355121f..0000000 --- a/system/vendor/slim/flash/phpunit.xml.dist +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - tests/ - - - - - - src/ - - - diff --git a/system/vendor/slim/flash/src/Messages.php b/system/vendor/slim/flash/src/Messages.php deleted file mode 100644 index 4f89679..0000000 --- a/system/vendor/slim/flash/src/Messages.php +++ /dev/null @@ -1,214 +0,0 @@ -storageKey = $storageKey; - } - - // Set storage - if (is_array($storage) || $storage instanceof ArrayAccess) { - $this->storage = &$storage; - } elseif (is_null($storage)) { - if (!isset($_SESSION)) { - throw new RuntimeException('Flash messages middleware failed. Session not found.'); - } - $this->storage = &$_SESSION; - } else { - throw new InvalidArgumentException('Flash messages storage must be an array or implement \ArrayAccess'); - } - - // Load messages from previous request - if (isset($this->storage[$this->storageKey]) && is_array($this->storage[$this->storageKey])) { - $this->fromPrevious = $this->storage[$this->storageKey]; - } - $this->storage[$this->storageKey] = []; - } - - /** - * Add flash message for the next request - * - * @param string $key The key to store the message under - * @param mixed $message Message to show on next request - */ - public function addMessage($key, $message) - { - // Create Array for this key - if (!isset($this->storage[$this->storageKey][$key])) { - $this->storage[$this->storageKey][$key] = []; - } - - // Push onto the array - $this->storage[$this->storageKey][$key][] = $message; - } - - /** - * Add flash message for current request - * - * @param string $key The key to store the message under - * @param mixed $message Message to show on next request - */ - public function addMessageNow($key, $message) - { - // Create Array for this key - if (!isset($this->forNow[$key])) { - $this->forNow[$key] = []; - } - - // Push onto the array - $this->forNow[$key][] = $message; - } - - /** - * Get flash messages - * - * @return array Messages to show for current request - */ - public function getMessages() - { - $messages = $this->fromPrevious; - - foreach ($this->forNow as $key => $values) { - if (!isset($messages[$key])) { - $messages[$key] = []; - } - - foreach ($values as $value) { - array_push($messages[$key], $value); - } - } - - return $messages; - } - - /** - * Get Flash Message - * - * @param string $key The key to get the message from - * @return mixed|null Returns the message - */ - public function getMessage($key) - { - $messages = $this->getMessages(); - - // If the key exists then return all messages or null - return (isset($messages[$key])) ? $messages[$key] : null; - } - - /** - * Get the first Flash message - * - * @param string $key The key to get the message from - * @param string $default Default value if key doesn't exist - * @return mixed Returns the message - */ - public function getFirstMessage($key, $default = null) - { - $messages = self::getMessage($key); - if (is_array($messages) && count($messages) > 0) { - return $messages[0]; - } - - return $default; - } - - /** - * Has Flash Message - * - * @param string $key The key to get the message from - * @return bool Whether the message is set or not - */ - public function hasMessage($key) - { - $messages = $this->getMessages(); - return isset($messages[$key]); - } - - /** - * Clear all messages - * - * @return void - */ - public function clearMessages() - { - if (isset($this->storage[$this->storageKey])) { - $this->storage[$this->storageKey] = []; - } - - $this->fromPrevious = []; - $this->forNow = []; - } - - /** - * Clear specific message - * - * @param String $key The key to clear - * @return void - */ - public function clearMessage($key) - { - if (isset($this->storage[$this->storageKey][$key])) { - unset($this->storage[$this->storageKey][$key]); - } - - if (isset($this->fromPrevious[$key])) { - unset($this->fromPrevious[$key]); - } - - if (isset($this->forNow[$key])) { - unset($this->forNow[$key]); - } - } -} diff --git a/system/vendor/slim/flash/tests/MessagesTest.php b/system/vendor/slim/flash/tests/MessagesTest.php deleted file mode 100644 index 1d242e0..0000000 --- a/system/vendor/slim/flash/tests/MessagesTest.php +++ /dev/null @@ -1,282 +0,0 @@ - ['Test']]; - $flash = new Messages($storage); - - $this->assertEquals(['Test'], $flash->getMessages()); - } - - // Test a string can be added to a message array for the current request - public function testAddMessageFromAnIntegerForCurrentRequest() - { - $storage = ['slimFlash' => []]; - $flash = new Messages($storage); - - $flash->addMessageNow('key', 46); - $flash->addMessageNow('key', 48); - - $messages = $flash->getMessages(); - $this->assertEquals(['46','48'], $messages['key']); - - $this->assertArrayHasKey('slimFlash', $storage); - $this->assertEmpty($storage['slimFlash']); - } - - // Test a string can be added to a message array for the current request - public function testAddMessageFromStringForCurrentRequest() - { - $storage = ['slimFlash' => []]; - $flash = new Messages($storage); - - $flash->addMessageNow('key', 'value'); - - $messages = $flash->getMessages(); - $this->assertEquals(['value'], $messages['key']); - - $this->assertArrayHasKey('slimFlash', $storage); - $this->assertEmpty($storage['slimFlash']); - } - - // Test an array can be added to a message array for the current request - public function testAddMessageFromArrayForCurrentRequest() - { - $storage = ['slimFlash' => []]; - $flash = new Messages($storage); - - $formData = [ - 'username' => 'Scooby Doo', - 'emailAddress' => 'scooby@mysteryinc.org', - ]; - - $flash->addMessageNow('old', $formData); - - $messages = $flash->getMessages(); - $this->assertEquals($formData, $messages['old'][0]); - - $this->assertArrayHasKey('slimFlash', $storage); - $this->assertEmpty($storage['slimFlash']); - } - - // Test an object can be added to a message array for the current request - public function testAddMessageFromObjectForCurrentRequest() - { - $storage = ['slimFlash' => []]; - $flash = new Messages($storage); - - $user = new \stdClass(); - $user->name = 'Scooby Doo'; - $user->emailAddress = 'scooby@mysteryinc.org'; - - $flash->addMessageNow('user', $user); - - $messages = $flash->getMessages(); - $this->assertInstanceOf(\stdClass::class, $messages['user'][0]); - - $this->assertArrayHasKey('slimFlash', $storage); - $this->assertEmpty($storage['slimFlash']); - } - - // Test a string can be added to a message array for the next request - public function testAddMessageFromAnIntegerForNextRequest() - { - $storage = ['slimFlash' => []]; - $flash = new Messages($storage); - - $flash->addMessage('key', 46); - $flash->addMessage('key', 48); - - $this->assertArrayHasKey('slimFlash', $storage); - $this->assertEquals(['46', '48'], $storage['slimFlash']['key']); - } - - // Test a string can be added to a message array for the next request - public function testAddMessageFromStringForNextRequest() - { - $storage = ['slimFlash' => []]; - $flash = new Messages($storage); - - $flash->addMessage('key', 'value'); - - $this->assertArrayHasKey('slimFlash', $storage); - $this->assertEquals(['value'], $storage['slimFlash']['key']); - } - - // Test an array can be added to a message array for the next request - public function testAddMessageFromArrayForNextRequest() - { - $storage = ['slimFlash' => []]; - $flash = new Messages($storage); - - $formData = [ - 'username' => 'Scooby Doo', - 'emailAddress' => 'scooby@mysteryinc.org', - ]; - - $flash->addMessage('old', $formData); - - $this->assertArrayHasKey('slimFlash', $storage); - $this->assertEquals($formData, $storage['slimFlash']['old'][0]); - } - - // Test an object can be added to a message array for the next request - public function testAddMessageFromObjectForNextRequest() - { - $storage = ['slimFlash' => []]; - $flash = new Messages($storage); - - $user = new \stdClass(); - $user->name = 'Scooby Doo'; - $user->emailAddress = 'scooby@mysteryinc.org'; - - $flash->addMessage('user', $user); - - $this->assertArrayHasKey('slimFlash', $storage); - $this->assertInstanceOf(\stdClass::class, $storage['slimFlash']['user'][0]); - } - - // Test get empty messages from previous request - public function testGetEmptyMessagesFromPrevRequest() - { - $storage = []; - $flash = new Messages($storage); - - $this->assertEquals([], $flash->getMessages()); - } - - // Test set messages for current request - public function testSetMessagesForCurrentRequest() - { - $storage = ['slimFlash' => [ 'error' => ['An error']]]; - - $flash = new Messages($storage); - $flash->addMessageNow('error', 'Another error'); - $flash->addMessageNow('success', 'A success'); - $flash->addMessageNow('info', 'An info'); - - $messages = $flash->getMessages(); - $this->assertEquals(['An error', 'Another error'], $messages['error']); - $this->assertEquals(['A success'], $messages['success']); - $this->assertEquals(['An info'], $messages['info']); - - $this->assertArrayHasKey('slimFlash', $storage); - $this->assertEmpty([], $storage['slimFlash']); - } - - // Test set messages for next request - public function testSetMessagesForNextRequest() - { - $storage = []; - - $flash = new Messages($storage); - $flash->addMessage('Test', 'Test'); - $flash->addMessage('Test', 'Test2'); - - $this->assertArrayHasKey('slimFlash', $storage); - $this->assertEquals(['Test', 'Test2'], $storage['slimFlash']['Test']); - } - - //Test getting the message from the key - public function testGetMessageFromKey() - { - $storage = ['slimFlash' => [ 'Test' => ['Test', 'Test2']]]; - $flash = new Messages($storage); - - $this->assertEquals(['Test', 'Test2'], $flash->getMessage('Test')); - } - - //Test getting the first message from the key - public function testGetFirstMessageFromKey() - { - $storage = ['slimFlash' => [ 'Test' => ['Test', 'Test2']]]; - $flash = new Messages($storage); - - $this->assertEquals('Test', $flash->getFirstMessage('Test')); - } - - //Test getting the default message if the key doesn't exist - public function testDefaultFromGetFirstMessageFromKeyIfKeyDoesntExist() - { - $storage = ['slimFlash' => []]; - $flash = new Messages($storage); - - $this->assertEquals('This', $flash->getFirstMessage('Test', 'This')); - } - - //Test getting the message from the key - public function testGetMessageFromKeyIncludingCurrent() - { - $storage = ['slimFlash' => [ 'Test' => ['Test', 'Test2']]]; - $flash = new Messages($storage); - $flash->addMessageNow('Test', 'Test3'); - - $messages = $flash->getMessages(); - - $this->assertEquals(['Test', 'Test2','Test3'], $flash->getMessage('Test')); - } - - public function testHasMessage() - { - $storage = ['slimFlash' => []]; - $flash = new Messages($storage); - $this->assertFalse($flash->hasMessage('Test')); - - $storage = ['slimFlash' => [ 'Test' => ['Test']]]; - $flash = new Messages($storage); - $this->assertTrue($flash->hasMessage('Test')); - } - - public function testClearMessages() - { - $storage = ['slimFlash' => []]; - $flash = new Messages($storage); - - $storage = ['slimFlash' => [ 'Test' => ['Test']]]; - $flash = new Messages($storage); - $flash->addMessageNow('Now', 'hear this'); - $this->assertTrue($flash->hasMessage('Test')); - $this->assertTrue($flash->hasMessage('Now')); - - $flash->clearMessages(); - $this->assertFalse($flash->hasMessage('Test')); - $this->assertFalse($flash->hasMessage('Now')); - } - - public function testClearMessage() - { - $storage = ['slimFlash' => []]; - $flash = new Messages($storage); - - $storage = ['slimFlash' => [ 'Test' => ['Test'], 'Foo' => ['Bar']]]; - $flash = new Messages($storage); - $flash->addMessageNow('Now', 'hear this'); - $this->assertTrue($flash->hasMessage('Test')); - $this->assertTrue($flash->hasMessage('Foo')); - $this->assertTrue($flash->hasMessage('Now')); - - $flash->clearMessage('Test'); - $flash->clearMessage('Now'); - $this->assertFalse($flash->hasMessage('Test')); - $this->assertFalse($flash->hasMessage('Now')); - $this->assertTrue($flash->hasMessage('Foo')); - } - - public function testSettingCustomStorageKey() - { - $storage = ['some-key' => [ 'Test' => ['Test']]]; - $flash = new Messages($storage); - $this->assertFalse($flash->hasMessage('Test')); - - $flash = new Messages($storage, 'some-key'); - $this->assertTrue($flash->hasMessage('Test')); - } -} diff --git a/system/vendor/slim/flash/tests/bootstrap.php b/system/vendor/slim/flash/tests/bootstrap.php deleted file mode 100644 index 5330160..0000000 --- a/system/vendor/slim/flash/tests/bootstrap.php +++ /dev/null @@ -1,2 +0,0 @@ - '', - 'domain' => null, - 'hostonly' => null, - 'path' => null, - 'expires' => null, - 'secure' => false, - 'httponly' => false, - 'samesite' => null - ]; - - /** - * @param array $cookies - */ - public function __construct(array $cookies = []) - { - $this->requestCookies = $cookies; - } - - /** - * Set default cookie properties - * - * @param array $settings - * - * @return static - */ - public function setDefaults(array $settings): self - { - $this->defaults = array_replace($this->defaults, $settings); - - return $this; - } - - /** - * Get cookie - * - * @param string $name - * @param string|array|null $default - * @return mixed|null - */ - public function get(string $name, $default = null) - { - return array_key_exists($name, $this->requestCookies) ? $this->requestCookies[$name] : $default; - } - - /** - * Set cookie - * - * @param string $name - * @param string|array $value - * @return static - */ - public function set(string $name, $value): self - { - if (!is_array($value)) { - $value = ['value' => $value]; - } - - $this->responseCookies[$name] = array_replace($this->defaults, $value); - - return $this; - } - - /** - * Convert all response cookies into an associate array of header values - * - * @return array - */ - public function toHeaders(): array - { - $headers = []; - - foreach ($this->responseCookies as $name => $properties) { - $headers[] = $this->toHeader($name, $properties); - } - - return $headers; - } - - /** - * Convert to `Set-Cookie` header - * - * @param string $name Cookie name - * @param array $properties Cookie properties - * - * @return string - */ - protected function toHeader(string $name, array $properties): string - { - $result = urlencode($name) . '=' . urlencode($properties['value']); - - if (isset($properties['domain'])) { - $result .= '; domain=' . $properties['domain']; - } - - if (isset($properties['path'])) { - $result .= '; path=' . $properties['path']; - } - - if (isset($properties['expires'])) { - if (is_string($properties['expires'])) { - $timestamp = strtotime($properties['expires']); - } else { - $timestamp = (int) $properties['expires']; - } - if ($timestamp && $timestamp !== 0) { - $result .= '; expires=' . gmdate('D, d-M-Y H:i:s e', $timestamp); - } - } - - if (isset($properties['secure']) && $properties['secure']) { - $result .= '; secure'; - } - - if (isset($properties['hostonly']) && $properties['hostonly']) { - $result .= '; HostOnly'; - } - - if (isset($properties['httponly']) && $properties['httponly']) { - $result .= '; HttpOnly'; - } - - if ( - isset($properties['samesite']) - && in_array(strtolower($properties['samesite']), ['lax', 'strict', 'none'], true) - ) { - // While strtolower is needed for correct comparison, the RFC doesn't care about case - $result .= '; SameSite=' . $properties['samesite']; - } - - return $result; - } - - /** - * Parse cookie values from header value - * - * Returns an associative array of cookie names and values - * - * @param string|array $header - * - * @return array - */ - public static function parseHeader($header): array - { - if (is_array($header)) { - $header = $header[0] ?? ''; - } - - if (!is_string($header)) { - throw new InvalidArgumentException('Cannot parse Cookie data. Header value must be a string.'); - } - - $header = rtrim($header, "\r\n"); - $pieces = preg_split('@[;]\s*@', $header); - $cookies = []; - - if (is_array($pieces)) { - foreach ($pieces as $cookie) { - $cookie = explode('=', $cookie, 2); - - if (count($cookie) === 2) { - $key = urldecode($cookie[0]); - $value = urldecode($cookie[1]); - - if (!isset($cookies[$key])) { - $cookies[$key] = $value; - } - } - } - } - - return $cookies; - } -} diff --git a/system/vendor/slim/psr7/src/Environment.php b/system/vendor/slim/psr7/src/Environment.php deleted file mode 100644 index 55f187b..0000000 --- a/system/vendor/slim/psr7/src/Environment.php +++ /dev/null @@ -1,55 +0,0 @@ - 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', - 'HTTP_ACCEPT_CHARSET' => 'ISO-8859-1,utf-8;q=0.7,*;q=0.3', - 'HTTP_ACCEPT_LANGUAGE' => 'en-US,en;q=0.8', - 'HTTP_USER_AGENT' => 'Slim Framework', - 'QUERY_STRING' => '', - 'REMOTE_ADDR' => '127.0.0.1', - 'REQUEST_METHOD' => 'GET', - 'REQUEST_SCHEME' => $scheme, - 'REQUEST_TIME' => time(), - 'REQUEST_TIME_FLOAT' => microtime(true), - 'REQUEST_URI' => '', - 'SCRIPT_NAME' => '', - 'SERVER_NAME' => 'localhost', - 'SERVER_PORT' => $port, - 'SERVER_PROTOCOL' => 'HTTP/1.1', - ], $data); - } -} diff --git a/system/vendor/slim/psr7/src/Factory/RequestFactory.php b/system/vendor/slim/psr7/src/Factory/RequestFactory.php deleted file mode 100644 index e825ee3..0000000 --- a/system/vendor/slim/psr7/src/Factory/RequestFactory.php +++ /dev/null @@ -1,59 +0,0 @@ -streamFactory = $streamFactory ?? new StreamFactory(); - $this->uriFactory = $uriFactory ?? new UriFactory(); - } - - /** - * {@inheritdoc} - */ - public function createRequest(string $method, $uri): RequestInterface - { - if (is_string($uri)) { - $uri = $this->uriFactory->createUri($uri); - } - - if (!$uri instanceof UriInterface) { - throw new InvalidArgumentException( - 'Parameter 2 of RequestFactory::createRequest() must be a string or a compatible UriInterface.' - ); - } - - $body = $this->streamFactory->createStream(); - - return new Request($method, $uri, new Headers(), [], [], $body); - } -} diff --git a/system/vendor/slim/psr7/src/Factory/ResponseFactory.php b/system/vendor/slim/psr7/src/Factory/ResponseFactory.php deleted file mode 100644 index c1a23a7..0000000 --- a/system/vendor/slim/psr7/src/Factory/ResponseFactory.php +++ /dev/null @@ -1,35 +0,0 @@ -withStatus($code, $reasonPhrase); - } - - return $res; - } -} diff --git a/system/vendor/slim/psr7/src/Factory/ServerRequestFactory.php b/system/vendor/slim/psr7/src/Factory/ServerRequestFactory.php deleted file mode 100644 index 5bc2447..0000000 --- a/system/vendor/slim/psr7/src/Factory/ServerRequestFactory.php +++ /dev/null @@ -1,110 +0,0 @@ -streamFactory = $streamFactory ?? new StreamFactory(); - $this->uriFactory = $uriFactory ?? new UriFactory(); - } - - /** - * {@inheritdoc} - */ - public function createServerRequest(string $method, $uri, array $serverParams = []): ServerRequestInterface - { - if (is_string($uri)) { - $uri = $this->uriFactory->createUri($uri); - } - - if (!$uri instanceof UriInterface) { - throw new InvalidArgumentException('URI must either be string or instance of ' . UriInterface::class); - } - - $body = $this->streamFactory->createStream(); - $headers = new Headers(); - $cookies = []; - - if (!empty($serverParams)) { - $headers = Headers::createFromGlobals(); - $cookies = Cookies::parseHeader($headers->getHeader('Cookie', [])); - } - - return new Request($method, $uri, $headers, $cookies, $serverParams, $body); - } - - /** - * Create new ServerRequest from environment. - * - * @internal This method is not part of PSR-17 - * - * @return Request - */ - public static function createFromGlobals(): Request - { - $method = $_SERVER['REQUEST_METHOD'] ?? 'GET'; - $uri = (new UriFactory())->createFromGlobals($_SERVER); - - $headers = Headers::createFromGlobals(); - $cookies = Cookies::parseHeader($headers->getHeader('Cookie', [])); - - // Cache the php://input stream as it cannot be re-read - $cacheResource = fopen('php://temp', 'wb+'); - $cache = $cacheResource ? new Stream($cacheResource) : null; - - $body = (new StreamFactory())->createStreamFromFile('php://input', 'r', $cache); - $uploadedFiles = UploadedFile::createFromGlobals($_SERVER); - - $request = new Request($method, $uri, $headers, $cookies, $_SERVER, $body, $uploadedFiles); - $contentTypes = $request->getHeader('Content-Type'); - - $parsedContentType = ''; - foreach ($contentTypes as $contentType) { - $fragments = explode(';', $contentType); - $parsedContentType = current($fragments); - } - - $contentTypesWithParsedBodies = ['application/x-www-form-urlencoded', 'multipart/form-data']; - if ($method === 'POST' && in_array($parsedContentType, $contentTypesWithParsedBodies)) { - return $request->withParsedBody($_POST); - } - - return $request; - } -} diff --git a/system/vendor/slim/psr7/src/Factory/StreamFactory.php b/system/vendor/slim/psr7/src/Factory/StreamFactory.php deleted file mode 100644 index 31d99b5..0000000 --- a/system/vendor/slim/psr7/src/Factory/StreamFactory.php +++ /dev/null @@ -1,95 +0,0 @@ -createStreamFromResource($resource); - } - - /** - * {@inheritdoc} - */ - public function createStreamFromFile( - string $filename, - string $mode = 'r', - StreamInterface $cache = null - ): StreamInterface { - set_error_handler( - static function (int $errno, string $errstr) use ($filename, $mode): void { - throw new RuntimeException( - "Unable to open $filename using mode $mode: $errstr", - $errno - ); - } - ); - - try { - $resource = fopen($filename, $mode); - } catch (ValueError $exception) { - throw new RuntimeException("Unable to open $filename using mode $mode: " . $exception->getMessage()); - } finally { - restore_error_handler(); - } - - if (!is_resource($resource)) { - throw new RuntimeException( - "StreamFactory::createStreamFromFile() could not create resource from file `$filename`" - ); - } - - return new Stream($resource, $cache); - } - - /** - * {@inheritdoc} - */ - public function createStreamFromResource($resource, StreamInterface $cache = null): StreamInterface - { - if (!is_resource($resource)) { - throw new InvalidArgumentException( - 'Parameter 1 of StreamFactory::createStreamFromResource() must be a resource.' - ); - } - - return new Stream($resource, $cache); - } -} diff --git a/system/vendor/slim/psr7/src/Factory/UploadedFileFactory.php b/system/vendor/slim/psr7/src/Factory/UploadedFileFactory.php deleted file mode 100644 index 5699e96..0000000 --- a/system/vendor/slim/psr7/src/Factory/UploadedFileFactory.php +++ /dev/null @@ -1,47 +0,0 @@ -getMetadata('uri'); - - if (!is_string($file) || !$stream->isReadable()) { - throw new InvalidArgumentException('File is not readable.'); - } - - if ($size === null) { - $size = $stream->getSize(); - } - - return new UploadedFile($stream, $clientFilename, $clientMediaType, $size, $error); - } -} diff --git a/system/vendor/slim/psr7/src/Factory/UriFactory.php b/system/vendor/slim/psr7/src/Factory/UriFactory.php deleted file mode 100644 index 74ab377..0000000 --- a/system/vendor/slim/psr7/src/Factory/UriFactory.php +++ /dev/null @@ -1,113 +0,0 @@ - 1) { - $queryString = parse_url('https://www.example.com' . $globals['REQUEST_URI'], PHP_URL_QUERY) ?? ''; - } - } - - // Build Uri and return - return new Uri($scheme, $host, $port, $requestUri, $queryString, '', $username, $password); - } -} diff --git a/system/vendor/slim/psr7/src/Header.php b/system/vendor/slim/psr7/src/Header.php deleted file mode 100644 index ecdad32..0000000 --- a/system/vendor/slim/psr7/src/Header.php +++ /dev/null @@ -1,96 +0,0 @@ -originalName = $originalName; - $this->normalizedName = $normalizedName; - $this->values = $values; - } - - /** - * @return string - */ - public function getOriginalName(): string - { - return $this->originalName; - } - - /** - * @return string - */ - public function getNormalizedName(): string - { - return $this->normalizedName; - } - - /** - * @param string $value - * - * @return self - */ - public function addValue(string $value): self - { - $this->values[] = $value; - - return $this; - } - - /** - * @param array|string $values - * - * @return self - */ - public function addValues($values): self - { - if (is_string($values)) { - return $this->addValue($values); - } - - if (!is_array($values)) { - throw new InvalidArgumentException('Parameter 1 of Header::addValues() should be a string or an array.'); - } - - $this->values = array_merge($this->values, $values); - - return $this; - } - - /** - * @return array - */ - public function getValues(): array - { - return $this->values; - } -} diff --git a/system/vendor/slim/psr7/src/Headers.php b/system/vendor/slim/psr7/src/Headers.php deleted file mode 100644 index e413147..0000000 --- a/system/vendor/slim/psr7/src/Headers.php +++ /dev/null @@ -1,318 +0,0 @@ -globals = $globals ?? $_SERVER; - $this->setHeaders($headers); - } - - /** - * {@inheritdoc} - */ - public function addHeader($name, $value): HeadersInterface - { - [$values, $originalName, $normalizedName] = $this->prepareHeader($name, $value); - - if (isset($this->headers[$normalizedName])) { - $header = $this->headers[$normalizedName]; - $header->addValues($values); - } else { - $this->headers[$normalizedName] = new Header($originalName, $normalizedName, $values); - } - - return $this; - } - - /** - * {@inheritdoc} - */ - public function removeHeader(string $name): HeadersInterface - { - $name = $this->normalizeHeaderName($name); - unset($this->headers[$name]); - return $this; - } - - /** - * {@inheritdoc} - */ - public function getHeader(string $name, $default = []): array - { - $name = $this->normalizeHeaderName($name); - - if (isset($this->headers[$name])) { - $header = $this->headers[$name]; - return $header->getValues(); - } - - if (empty($default)) { - return $default; - } - - $this->validateHeader($name, $default); - return $this->trimHeaderValue($default); - } - - /** - * {@inheritdoc} - */ - public function setHeader($name, $value): HeadersInterface - { - [$values, $originalName, $normalizedName] = $this->prepareHeader($name, $value); - - // Ensure we preserve original case if the header already exists in the stack - if (isset($this->headers[$normalizedName])) { - $existingHeader = $this->headers[$normalizedName]; - $originalName = $existingHeader->getOriginalName(); - } - - $this->headers[$normalizedName] = new Header($originalName, $normalizedName, $values); - - return $this; - } - - /** - * {@inheritdoc} - */ - public function setHeaders(array $headers): HeadersInterface - { - $this->headers = []; - - foreach ($this->parseAuthorizationHeader($headers) as $name => $value) { - $this->addHeader($name, $value); - } - - return $this; - } - - /** - * {@inheritdoc} - */ - public function hasHeader(string $name): bool - { - $name = $this->normalizeHeaderName($name); - return isset($this->headers[$name]); - } - - /** - * {@inheritdoc} - */ - public function getHeaders(bool $originalCase = false): array - { - $headers = []; - - foreach ($this->headers as $header) { - $name = $originalCase ? $header->getOriginalName() : $header->getNormalizedName(); - $headers[$name] = $header->getValues(); - } - - return $headers; - } - - /** - * @param string $name - * @param bool $preserveCase - * @return string - */ - protected function normalizeHeaderName(string $name, bool $preserveCase = false): string - { - $name = strtr($name, '_', '-'); - - if (!$preserveCase) { - $name = strtolower($name); - } - - if (strpos(strtolower($name), 'http-') === 0) { - $name = substr($name, 5); - } - - return $name; - } - - /** - * Parse incoming headers and determine Authorization header from original headers - * - * @param array $headers - * @return array - */ - protected function parseAuthorizationHeader(array $headers): array - { - $hasAuthorizationHeader = false; - foreach ($headers as $name => $value) { - if (strtolower((string) $name) === 'authorization') { - $hasAuthorizationHeader = true; - break; - } - } - - if (!$hasAuthorizationHeader) { - if (isset($this->globals['REDIRECT_HTTP_AUTHORIZATION'])) { - $headers['Authorization'] = $this->globals['REDIRECT_HTTP_AUTHORIZATION']; - } elseif (isset($this->globals['PHP_AUTH_USER'])) { - $pw = $this->globals['PHP_AUTH_PW'] ?? ''; - $headers['Authorization'] = 'Basic ' . base64_encode($this->globals['PHP_AUTH_USER'] . ':' . $pw); - } elseif (isset($this->globals['PHP_AUTH_DIGEST'])) { - $headers['Authorization'] = $this->globals['PHP_AUTH_DIGEST']; - } - } - - return $headers; - } - - /** - * @param array|string $value - * - * @return array - */ - protected function trimHeaderValue($value): array - { - $items = is_array($value) ? $value : [$value]; - $result = []; - foreach ($items as $item) { - $result[] = trim((string) $item, " \t"); - } - return $result; - } - - /** - * @param string $name - * @param array|string $value - * - * @throws InvalidArgumentException - * - * @return array - */ - protected function prepareHeader($name, $value): array - { - $this->validateHeader($name, $value); - $values = $this->trimHeaderValue($value); - $originalName = $this->normalizeHeaderName($name, true); - $normalizedName = $this->normalizeHeaderName($name); - return [$values, $originalName, $normalizedName]; - } - - /** - * Make sure the header complies with RFC 7230. - * - * Header names must be a non-empty string consisting of token characters. - * - * Header values must be strings consisting of visible characters with all optional - * leading and trailing whitespace stripped. This method will always strip such - * optional whitespace. Note that the method does not allow folding whitespace within - * the values as this was deprecated for almost all instances by the RFC. - * - * header-field = field-name ":" OWS field-value OWS - * field-name = 1*( "!" / "#" / "$" / "%" / "&" / "'" / "*" / "+" / "-" / "." / "^" - * / "_" / "`" / "|" / "~" / %x30-39 / ( %x41-5A / %x61-7A ) ) - * OWS = *( SP / HTAB ) - * field-value = *( ( %x21-7E / %x80-FF ) [ 1*( SP / HTAB ) ( %x21-7E / %x80-FF ) ] ) - * - * @see https://tools.ietf.org/html/rfc7230#section-3.2.4 - * - * @param string $name - * @param array|string $value - * - * @throws InvalidArgumentException; - */ - protected function validateHeader($name, $value): void - { - $this->validateHeaderName($name); - $this->validateHeaderValue($value); - } - - /** - * @param mixed $name - * - * @throws InvalidArgumentException - */ - protected function validateHeaderName($name): void - { - if (!is_string($name) || preg_match("@^[!#$%&'*+.^_`|~0-9A-Za-z-]+$@D", $name) !== 1) { - throw new InvalidArgumentException('Header name must be an RFC 7230 compatible string.'); - } - } - - /** - * @param mixed $value - * - * @throws InvalidArgumentException - */ - protected function validateHeaderValue($value): void - { - $items = is_array($value) ? $value : [$value]; - - if (empty($items)) { - throw new InvalidArgumentException( - 'Header values must be a string or an array of strings, empty array given.' - ); - } - - $pattern = "@^[ \t\x21-\x7E\x80-\xFF]*$@D"; - foreach ($items as $item) { - $hasInvalidType = !is_numeric($item) && !is_string($item); - $rejected = $hasInvalidType || preg_match($pattern, (string) $item) !== 1; - if ($rejected) { - throw new InvalidArgumentException( - 'Header values must be RFC 7230 compatible strings.' - ); - } - } - } - - /** - * @return static - */ - public static function createFromGlobals() - { - $headers = null; - - if (function_exists('getallheaders')) { - $headers = getallheaders(); - } - - if (!is_array($headers)) { - $headers = []; - } - - return new static($headers); - } -} diff --git a/system/vendor/slim/psr7/src/Interfaces/HeadersInterface.php b/system/vendor/slim/psr7/src/Interfaces/HeadersInterface.php deleted file mode 100644 index 3f486f1..0000000 --- a/system/vendor/slim/psr7/src/Interfaces/HeadersInterface.php +++ /dev/null @@ -1,90 +0,0 @@ - true, - '1.1' => true, - '2.0' => true, - '2' => true, - ]; - - /** - * @var HeadersInterface - */ - protected $headers; - - /** - * @var StreamInterface - */ - protected $body; - - /** - * Disable magic setter to ensure immutability - * - * @param string $name The property name - * @param mixed $value The property value - * - * @return void - */ - public function __set($name, $value): void - { - // Do nothing - } - - /** - * {@inheritdoc} - */ - public function getProtocolVersion(): string - { - return $this->protocolVersion; - } - - /** - * @return static - * {@inheritdoc} - */ - public function withProtocolVersion($version) - { - if (!isset(self::$validProtocolVersions[$version])) { - throw new InvalidArgumentException( - 'Invalid HTTP version. Must be one of: ' - . implode(', ', array_keys(self::$validProtocolVersions)) - ); - } - - $clone = clone $this; - $clone->protocolVersion = $version; - - return $clone; - } - - /** - * {@inheritdoc} - */ - public function getHeaders(): array - { - return $this->headers->getHeaders(true); - } - - /** - * {@inheritdoc} - */ - public function hasHeader($name): bool - { - return $this->headers->hasHeader($name); - } - - /** - * {@inheritdoc} - */ - public function getHeader($name): array - { - return $this->headers->getHeader($name); - } - - /** - * {@inheritdoc} - */ - public function getHeaderLine($name): string - { - $values = $this->headers->getHeader($name); - return implode(',', $values); - } - - /** - * @return static - * {@inheritdoc} - */ - public function withHeader($name, $value) - { - $clone = clone $this; - $clone->headers->setHeader($name, $value); - - if ($this instanceof Response && $this->body instanceof NonBufferedBody) { - header(sprintf('%s: %s', $name, $clone->getHeaderLine($name))); - } - - return $clone; - } - - /** - * @return static - * {@inheritdoc} - */ - public function withAddedHeader($name, $value) - { - $clone = clone $this; - $clone->headers->addHeader($name, $value); - - if ($this instanceof Response && $this->body instanceof NonBufferedBody) { - header(sprintf('%s: %s', $name, $clone->getHeaderLine($name))); - } - - return $clone; - } - - /** - * @return static - * {@inheritdoc} - */ - public function withoutHeader($name) - { - $clone = clone $this; - $clone->headers->removeHeader($name); - - if ($this instanceof Response && $this->body instanceof NonBufferedBody) { - header_remove($name); - } - - return $clone; - } - - /** - * {@inheritdoc} - */ - public function getBody(): StreamInterface - { - return $this->body; - } - - /** - * @return static - * {@inheritdoc} - */ - public function withBody(StreamInterface $body) - { - $clone = clone $this; - $clone->body = $body; - - return $clone; - } -} diff --git a/system/vendor/slim/psr7/src/NonBufferedBody.php b/system/vendor/slim/psr7/src/NonBufferedBody.php deleted file mode 100644 index ad22c2d..0000000 --- a/system/vendor/slim/psr7/src/NonBufferedBody.php +++ /dev/null @@ -1,153 +0,0 @@ -method = $this->filterMethod($method); - $this->uri = $uri; - $this->headers = $headers; - $this->cookies = $cookies; - $this->serverParams = $serverParams; - $this->attributes = []; - $this->body = $body; - $this->uploadedFiles = $uploadedFiles; - - if (isset($serverParams['SERVER_PROTOCOL'])) { - $this->protocolVersion = str_replace('HTTP/', '', $serverParams['SERVER_PROTOCOL']); - } - - if (!$this->headers->hasHeader('Host') || $this->uri->getHost() !== '') { - $this->headers->setHeader('Host', $this->uri->getHost()); - } - } - - /** - * This method is applied to the cloned object after PHP performs an initial shallow-copy. - * This method completes a deep-copy by creating new objects for the cloned object's internal reference pointers. - */ - public function __clone() - { - $this->headers = clone $this->headers; - $this->body = clone $this->body; - } - - /** - * {@inheritdoc} - */ - public function getMethod(): string - { - return $this->method; - } - - /** - * {@inheritdoc} - * @return static - */ - public function withMethod($method) - { - $method = $this->filterMethod($method); - $clone = clone $this; - $clone->method = $method; - - return $clone; - } - - /** - * Validate the HTTP method - * - * @param string $method - * - * @return string - * - * @throws InvalidArgumentException on invalid HTTP method. - */ - protected function filterMethod($method): string - { - /** @var mixed $method */ - if (!is_string($method)) { - throw new InvalidArgumentException(sprintf( - 'Unsupported HTTP method; must be a string, received %s', - (is_object($method) ? get_class($method) : gettype($method)) - )); - } - - if (preg_match("/^[!#$%&'*+.^_`|~0-9a-z-]+$/i", $method) !== 1) { - throw new InvalidArgumentException(sprintf( - 'Unsupported HTTP method "%s" provided', - $method - )); - } - - return $method; - } - - /** - * {@inheritdoc} - */ - public function getRequestTarget(): string - { - if ($this->requestTarget) { - return $this->requestTarget; - } - - if ($this->uri === null) { - return '/'; - } - - $path = $this->uri->getPath(); - $path = '/' . ltrim($path, '/'); - - $query = $this->uri->getQuery(); - if ($query) { - $path .= '?' . $query; - } - - return $path; - } - - /** - * {@inheritdoc} - * @return static - */ - public function withRequestTarget($requestTarget) - { - if (!is_string($requestTarget) || preg_match('#\s#', $requestTarget)) { - throw new InvalidArgumentException( - 'Invalid request target provided; must be a string and cannot contain whitespace' - ); - } - - $clone = clone $this; - $clone->requestTarget = $requestTarget; - - return $clone; - } - - /** - * {@inheritdoc} - */ - public function getUri(): UriInterface - { - return $this->uri; - } - - /** - * {@inheritdoc} - * @return static - */ - public function withUri(UriInterface $uri, $preserveHost = false) - { - $clone = clone $this; - $clone->uri = $uri; - - if (!$preserveHost && $uri->getHost() !== '') { - $clone->headers->setHeader('Host', $uri->getHost()); - return $clone; - } - - if (($uri->getHost() !== '' && !$this->hasHeader('Host') || $this->getHeaderLine('Host') === '')) { - $clone->headers->setHeader('Host', $uri->getHost()); - return $clone; - } - - return $clone; - } - - /** - * {@inheritdoc} - */ - public function getCookieParams(): array - { - return $this->cookies; - } - - /** - * {@inheritdoc} - * @return static - */ - public function withCookieParams(array $cookies) - { - $clone = clone $this; - $clone->cookies = $cookies; - - return $clone; - } - - /** - * {@inheritdoc} - */ - public function getQueryParams(): array - { - if (is_array($this->queryParams)) { - return $this->queryParams; - } - - if ($this->uri === null) { - return []; - } - - parse_str($this->uri->getQuery(), $this->queryParams); // <-- URL decodes data - assert(is_array($this->queryParams)); - - return $this->queryParams; - } - - /** - * {@inheritdoc} - * @return static - */ - public function withQueryParams(array $query) - { - $clone = clone $this; - $clone->queryParams = $query; - - return $clone; - } - - /** - * {@inheritdoc} - */ - public function getUploadedFiles(): array - { - return $this->uploadedFiles; - } - - /** - * {@inheritdoc} - * @return static - */ - public function withUploadedFiles(array $uploadedFiles) - { - $clone = clone $this; - $clone->uploadedFiles = $uploadedFiles; - - return $clone; - } - - /** - * {@inheritdoc} - */ - public function getServerParams(): array - { - return $this->serverParams; - } - - /** - * {@inheritdoc} - */ - public function getAttributes(): array - { - return $this->attributes; - } - - /** - * {@inheritdoc} - * @return mixed - */ - public function getAttribute($name, $default = null) - { - return $this->attributes[$name] ?? $default; - } - - /** - * {@inheritdoc} - * @return static - */ - public function withAttribute($name, $value) - { - $clone = clone $this; - $clone->attributes[$name] = $value; - - return $clone; - } - - /** - * {@inheritdoc} - * @return static - */ - public function withoutAttribute($name) - { - $clone = clone $this; - - unset($clone->attributes[$name]); - - return $clone; - } - - /** - * {@inheritdoc} - */ - public function getParsedBody() - { - return $this->parsedBody; - } - - /** - * {@inheritdoc} - * @return static - */ - public function withParsedBody($data) - { - /** @var mixed $data */ - if (!is_null($data) && !is_object($data) && !is_array($data)) { - throw new InvalidArgumentException('Parsed body value must be an array, an object, or null'); - } - - $clone = clone $this; - $clone->parsedBody = $data; - - return $clone; - } -} diff --git a/system/vendor/slim/psr7/src/Response.php b/system/vendor/slim/psr7/src/Response.php deleted file mode 100644 index c6d4c6e..0000000 --- a/system/vendor/slim/psr7/src/Response.php +++ /dev/null @@ -1,216 +0,0 @@ - 'Continue', - StatusCodeInterface::STATUS_SWITCHING_PROTOCOLS => 'Switching Protocols', - StatusCodeInterface::STATUS_PROCESSING => 'Processing', - - // Successful 2xx - StatusCodeInterface::STATUS_OK => 'OK', - StatusCodeInterface::STATUS_CREATED => 'Created', - StatusCodeInterface::STATUS_ACCEPTED => 'Accepted', - StatusCodeInterface::STATUS_NON_AUTHORITATIVE_INFORMATION => 'Non-Authoritative Information', - StatusCodeInterface::STATUS_NO_CONTENT => 'No Content', - StatusCodeInterface::STATUS_RESET_CONTENT => 'Reset Content', - StatusCodeInterface::STATUS_PARTIAL_CONTENT => 'Partial Content', - StatusCodeInterface::STATUS_MULTI_STATUS => 'Multi-Status', - StatusCodeInterface::STATUS_ALREADY_REPORTED => 'Already Reported', - StatusCodeInterface::STATUS_IM_USED => 'IM Used', - - // Redirection 3xx - StatusCodeInterface::STATUS_MULTIPLE_CHOICES => 'Multiple Choices', - StatusCodeInterface::STATUS_MOVED_PERMANENTLY => 'Moved Permanently', - StatusCodeInterface::STATUS_FOUND => 'Found', - StatusCodeInterface::STATUS_SEE_OTHER => 'See Other', - StatusCodeInterface::STATUS_NOT_MODIFIED => 'Not Modified', - StatusCodeInterface::STATUS_USE_PROXY => 'Use Proxy', - StatusCodeInterface::STATUS_RESERVED => '(Unused)', - StatusCodeInterface::STATUS_TEMPORARY_REDIRECT => 'Temporary Redirect', - StatusCodeInterface::STATUS_PERMANENT_REDIRECT => 'Permanent Redirect', - - // Client Error 4xx - StatusCodeInterface::STATUS_BAD_REQUEST => 'Bad Request', - StatusCodeInterface::STATUS_UNAUTHORIZED => 'Unauthorized', - StatusCodeInterface::STATUS_PAYMENT_REQUIRED => 'Payment Required', - StatusCodeInterface::STATUS_FORBIDDEN => 'Forbidden', - StatusCodeInterface::STATUS_NOT_FOUND => 'Not Found', - StatusCodeInterface::STATUS_METHOD_NOT_ALLOWED => 'Method Not Allowed', - StatusCodeInterface::STATUS_NOT_ACCEPTABLE => 'Not Acceptable', - StatusCodeInterface::STATUS_PROXY_AUTHENTICATION_REQUIRED => 'Proxy Authentication Required', - StatusCodeInterface::STATUS_REQUEST_TIMEOUT => 'Request Timeout', - StatusCodeInterface::STATUS_CONFLICT => 'Conflict', - StatusCodeInterface::STATUS_GONE => 'Gone', - StatusCodeInterface::STATUS_LENGTH_REQUIRED => 'Length Required', - StatusCodeInterface::STATUS_PRECONDITION_FAILED => 'Precondition Failed', - StatusCodeInterface::STATUS_PAYLOAD_TOO_LARGE => 'Request Entity Too Large', - StatusCodeInterface::STATUS_URI_TOO_LONG => 'Request-URI Too Long', - StatusCodeInterface::STATUS_UNSUPPORTED_MEDIA_TYPE => 'Unsupported Media Type', - StatusCodeInterface::STATUS_RANGE_NOT_SATISFIABLE => 'Requested Range Not Satisfiable', - StatusCodeInterface::STATUS_EXPECTATION_FAILED => 'Expectation Failed', - StatusCodeInterface::STATUS_IM_A_TEAPOT => 'I\'m a teapot', - StatusCodeInterface::STATUS_MISDIRECTED_REQUEST => 'Misdirected Request', - StatusCodeInterface::STATUS_UNPROCESSABLE_ENTITY => 'Unprocessable Entity', - StatusCodeInterface::STATUS_LOCKED => 'Locked', - StatusCodeInterface::STATUS_FAILED_DEPENDENCY => 'Failed Dependency', - StatusCodeInterface::STATUS_UPGRADE_REQUIRED => 'Upgrade Required', - StatusCodeInterface::STATUS_PRECONDITION_REQUIRED => 'Precondition Required', - StatusCodeInterface::STATUS_TOO_MANY_REQUESTS => 'Too Many Requests', - StatusCodeInterface::STATUS_REQUEST_HEADER_FIELDS_TOO_LARGE => 'Request Header Fields Too Large', - 444 => 'Connection Closed Without Response', - StatusCodeInterface::STATUS_UNAVAILABLE_FOR_LEGAL_REASONS => 'Unavailable For Legal Reasons', - 499 => 'Client Closed Request', - - // Server Error 5xx - StatusCodeInterface::STATUS_INTERNAL_SERVER_ERROR => 'Internal Server Error', - StatusCodeInterface::STATUS_NOT_IMPLEMENTED => 'Not Implemented', - StatusCodeInterface::STATUS_BAD_GATEWAY => 'Bad Gateway', - StatusCodeInterface::STATUS_SERVICE_UNAVAILABLE => 'Service Unavailable', - StatusCodeInterface::STATUS_GATEWAY_TIMEOUT => 'Gateway Timeout', - StatusCodeInterface::STATUS_VERSION_NOT_SUPPORTED => 'HTTP Version Not Supported', - StatusCodeInterface::STATUS_VARIANT_ALSO_NEGOTIATES => 'Variant Also Negotiates', - StatusCodeInterface::STATUS_INSUFFICIENT_STORAGE => 'Insufficient Storage', - StatusCodeInterface::STATUS_LOOP_DETECTED => 'Loop Detected', - StatusCodeInterface::STATUS_NOT_EXTENDED => 'Not Extended', - StatusCodeInterface::STATUS_NETWORK_AUTHENTICATION_REQUIRED => 'Network Authentication Required', - 599 => 'Network Connect Timeout Error', - ]; - - /** - * @param int $status The response status code. - * @param HeadersInterface|null $headers The response headers. - * @param StreamInterface|null $body The response body. - */ - public function __construct( - int $status = StatusCodeInterface::STATUS_OK, - ?HeadersInterface $headers = null, - ?StreamInterface $body = null - ) { - $this->status = $this->filterStatus($status); - $this->headers = $headers ?: new Headers([], []); - $this->body = $body ?: (new StreamFactory())->createStream(); - } - - /** - * This method is applied to the cloned object after PHP performs an initial shallow-copy. - * This method completes a deep-copy by creating new objects for the cloned object's internal reference pointers. - */ - public function __clone() - { - $this->headers = clone $this->headers; - } - - /** - * {@inheritdoc} - */ - public function getStatusCode(): int - { - return $this->status; - } - - /** - * {@inheritdoc} - * @return static - */ - public function withStatus($code, $reasonPhrase = '') - { - $code = $this->filterStatus($code); - $reasonPhrase = $this->filterReasonPhrase($reasonPhrase); - - $clone = clone $this; - $clone->status = $code; - $clone->reasonPhrase = $reasonPhrase; - - return $clone; - } - - /** - * {@inheritdoc} - */ - public function getReasonPhrase(): string - { - if ($this->reasonPhrase !== '') { - return $this->reasonPhrase; - } - - if (isset(static::$messages[$this->status])) { - return static::$messages[$this->status]; - } - - return ''; - } - - /** - * Filter HTTP status code. - * - * @param int $status HTTP status code. - * - * @return int - * - * @throws InvalidArgumentException If an invalid HTTP status code is provided. - */ - protected function filterStatus($status): int - { - if (!is_integer($status) || $status < StatusCodeInterface::STATUS_CONTINUE || $status > 599) { - throw new InvalidArgumentException('Invalid HTTP status code.'); - } - - return $status; - } - - /** - * Filter Reason Phrase - * - * @param mixed $reasonPhrase - * - * @return string - * - * @throws InvalidArgumentException - */ - protected function filterReasonPhrase($reasonPhrase = ''): string - { - if (is_object($reasonPhrase) && method_exists($reasonPhrase, '__toString')) { - $reasonPhrase = (string) $reasonPhrase; - } - - if (!is_string($reasonPhrase)) { - throw new InvalidArgumentException('Response reason phrase must be a string.'); - } - - if (strpos($reasonPhrase, "\r") !== false || strpos($reasonPhrase, "\n") !== false) { - throw new InvalidArgumentException( - 'Reason phrase contains one of the following prohibited characters: \r \n' - ); - } - - return $reasonPhrase; - } -} diff --git a/system/vendor/slim/psr7/src/Stream.php b/system/vendor/slim/psr7/src/Stream.php deleted file mode 100644 index 9de6685..0000000 --- a/system/vendor/slim/psr7/src/Stream.php +++ /dev/null @@ -1,396 +0,0 @@ -attach($stream); - - if ($cache && (!$cache->isSeekable() || !$cache->isWritable())) { - throw new RuntimeException('Cache stream must be seekable and writable'); - } - $this->cache = $cache; - } - - /** - * {@inheritdoc} - * @return array|mixed - */ - public function getMetadata($key = null) - { - if (!$this->stream) { - return null; - } - - $this->meta = stream_get_meta_data($this->stream); - - if (!$key) { - return $this->meta; - } - - return $this->meta[$key] ?? null; - } - - /** - * Attach new resource to this object. - * - * @internal This method is not part of the PSR-7 standard. - * - * @param resource $stream A PHP resource handle. - * - * @throws InvalidArgumentException If argument is not a valid PHP resource. - * - * @return void - */ - protected function attach($stream): void - { - if (!is_resource($stream)) { - throw new InvalidArgumentException(__METHOD__ . ' argument must be a valid PHP resource'); - } - - if ($this->stream) { - $this->detach(); - } - - $this->stream = $stream; - } - - /** - * {@inheritdoc} - */ - public function detach() - { - $oldResource = $this->stream; - $this->stream = null; - $this->meta = null; - $this->readable = null; - $this->writable = null; - $this->seekable = null; - $this->size = null; - $this->isPipe = null; - - $this->cache = null; - $this->finished = false; - - return $oldResource; - } - - /** - * {@inheritdoc} - */ - public function __toString(): string - { - if (!$this->stream) { - return ''; - } - if ($this->cache && $this->finished) { - $this->cache->rewind(); - return $this->cache->getContents(); - } - if ($this->isSeekable()) { - $this->rewind(); - } - return $this->getContents(); - } - - /** - * {@inheritdoc} - */ - public function close(): void - { - if ($this->stream) { - if ($this->isPipe()) { - pclose($this->stream); - } else { - fclose($this->stream); - } - } - - $this->detach(); - } - - /** - * {@inheritdoc} - */ - public function getSize(): ?int - { - if ($this->stream && !$this->size) { - $stats = fstat($this->stream); - - if ($stats) { - $this->size = !$this->isPipe() ? $stats['size'] : null; - } - } - - return $this->size; - } - - /** - * {@inheritdoc} - */ - public function tell(): int - { - $position = false; - - if ($this->stream) { - $position = ftell($this->stream); - } - - if ($position === false || $this->isPipe()) { - throw new RuntimeException('Could not get the position of the pointer in stream.'); - } - - return $position; - } - - /** - * {@inheritdoc} - */ - public function eof(): bool - { - return !$this->stream || feof($this->stream); - } - - /** - * {@inheritdoc} - */ - public function isReadable(): bool - { - if ($this->readable !== null) { - return $this->readable; - } - - $this->readable = false; - - if ($this->stream) { - $mode = $this->getMetadata('mode'); - - if (is_string($mode) && (strstr($mode, 'r') !== false || strstr($mode, '+') !== false)) { - $this->readable = true; - } - } - - return $this->readable; - } - - /** - * {@inheritdoc} - */ - public function isWritable(): bool - { - if ($this->writable === null) { - $this->writable = false; - - if ($this->stream) { - $mode = $this->getMetadata('mode'); - - if (is_string($mode) && (strstr($mode, 'w') !== false || strstr($mode, '+') !== false)) { - $this->writable = true; - } - } - } - - return $this->writable; - } - - /** - * {@inheritdoc} - */ - public function isSeekable(): bool - { - if ($this->seekable === null) { - $this->seekable = false; - - if ($this->stream) { - $this->seekable = !$this->isPipe() && $this->getMetadata('seekable'); - } - } - - return $this->seekable; - } - - /** - * {@inheritdoc} - */ - public function seek($offset, $whence = SEEK_SET): void - { - if (!$this->isSeekable() || $this->stream && fseek($this->stream, $offset, $whence) === -1) { - throw new RuntimeException('Could not seek in stream.'); - } - } - - /** - * {@inheritdoc} - */ - public function rewind(): void - { - if (!$this->isSeekable() || $this->stream && rewind($this->stream) === false) { - throw new RuntimeException('Could not rewind stream.'); - } - } - - /** - * {@inheritdoc} - */ - public function read($length): string - { - $data = false; - - if ($this->isReadable() && $this->stream && $length >= 0) { - $data = fread($this->stream, $length); - } - - if (is_string($data)) { - if ($this->cache) { - $this->cache->write($data); - } - if ($this->eof()) { - $this->finished = true; - } - return $data; - } - - throw new RuntimeException('Could not read from stream.'); - } - - /** - * {@inheritdoc} - * @return int - */ - public function write($string) - { - $written = false; - - if ($this->isWritable() && $this->stream) { - $written = fwrite($this->stream, $string); - } - - if ($written !== false) { - $this->size = null; - return $written; - } - - throw new RuntimeException('Could not write to stream.'); - } - - /** - * {@inheritdoc} - */ - public function getContents(): string - { - if ($this->cache && $this->finished) { - $this->cache->rewind(); - return $this->cache->getContents(); - } - - $contents = false; - - if ($this->stream) { - $contents = stream_get_contents($this->stream); - } - - if (is_string($contents)) { - if ($this->cache) { - $this->cache->write($contents); - } - if ($this->eof()) { - $this->finished = true; - } - return $contents; - } - - throw new RuntimeException('Could not get contents of stream.'); - } - - /** - * Returns whether or not the stream is a pipe. - * - * @internal This method is not part of the PSR-7 standard. - * - * @return bool - */ - public function isPipe(): bool - { - if ($this->isPipe === null) { - $this->isPipe = false; - - if ($this->stream) { - $stats = fstat($this->stream); - - if (is_array($stats)) { - $this->isPipe = ($stats['mode'] & self::FSTAT_MODE_S_IFIFO) !== 0; - } - } - } - - return $this->isPipe; - } -} diff --git a/system/vendor/slim/psr7/src/UploadedFile.php b/system/vendor/slim/psr7/src/UploadedFile.php deleted file mode 100644 index b0c4df5..0000000 --- a/system/vendor/slim/psr7/src/UploadedFile.php +++ /dev/null @@ -1,279 +0,0 @@ -getMetadata('uri'); - if (!is_string($file)) { - throw new InvalidArgumentException('No URI associated with the stream.'); - } - $this->file = $file; - $this->stream = $fileNameOrStream; - } elseif (is_string($fileNameOrStream)) { - $this->file = $fileNameOrStream; - } else { - throw new InvalidArgumentException( - 'Please provide a string (full path to the uploaded file) or an instance of StreamInterface.' - ); - } - $this->name = $name; - $this->type = $type; - $this->size = $size; - $this->error = $error; - $this->sapi = $sapi; - } - - /** - * {@inheritdoc} - * @return StreamInterface - */ - public function getStream() - { - if ($this->moved) { - throw new RuntimeException(sprintf('Uploaded file %s has already been moved', $this->name)); - } - - if (!$this->stream) { - $this->stream = (new StreamFactory())->createStreamFromFile($this->file); - } - - return $this->stream; - } - - /** - * {@inheritdoc} - */ - public function moveTo($targetPath): void - { - if ($this->moved) { - throw new RuntimeException('Uploaded file already moved'); - } - - $targetIsStream = strpos($targetPath, '://') > 0; - if (!$targetIsStream && !is_writable(dirname($targetPath))) { - throw new InvalidArgumentException('Upload target path is not writable'); - } - - if ($targetIsStream) { - if (!copy($this->file, $targetPath)) { - throw new RuntimeException(sprintf('Error moving uploaded file %s to %s', $this->name, $targetPath)); - } - - if (!unlink($this->file)) { - throw new RuntimeException(sprintf('Error removing uploaded file %s', $this->name)); - } - } elseif ($this->sapi) { - if (!is_uploaded_file($this->file)) { - throw new RuntimeException(sprintf('%s is not a valid uploaded file', $this->file)); - } - - if (!move_uploaded_file($this->file, $targetPath)) { - throw new RuntimeException(sprintf('Error moving uploaded file %s to %s', $this->name, $targetPath)); - } - } else { - if (!rename($this->file, $targetPath)) { - throw new RuntimeException(sprintf('Error moving uploaded file %s to %s', $this->name, $targetPath)); - } - } - - $this->moved = true; - } - - /** - * {@inheritdoc} - */ - public function getError(): int - { - return $this->error; - } - - /** - * {@inheritdoc} - */ - public function getClientFilename(): ?string - { - return $this->name; - } - - /** - * {@inheritdoc} - */ - public function getClientMediaType(): ?string - { - return $this->type; - } - - /** - * {@inheritdoc} - */ - public function getSize(): ?int - { - return $this->size; - } - - /** - * Returns the client-provided full path to the file - * - * @internal This method is not part of the PSR-7 standard - * - * @return string - */ - public function getFilePath(): string - { - return $this->file; - } - - /** - * Create a normalized tree of UploadedFile instances from the Environment. - * - * @internal This method is not part of the PSR-7 standard. - * - * @param array $globals The global server variables. - * - * @return array A normalized tree of UploadedFile instances or null if none are provided. - */ - public static function createFromGlobals(array $globals): array - { - if (isset($globals['slim.files']) && is_array($globals['slim.files'])) { - return $globals['slim.files']; - } - - if (!empty($_FILES)) { - return self::parseUploadedFiles($_FILES); - } - - return []; - } - - /** - * Parse a non-normalized, i.e. $_FILES superglobal, tree of uploaded file data. - * - * @internal This method is not part of the PSR-7 standard. - * - * @param array $uploadedFiles The non-normalized tree of uploaded file data. - * - * @return array A normalized tree of UploadedFile instances. - */ - private static function parseUploadedFiles(array $uploadedFiles): array - { - $parsed = []; - foreach ($uploadedFiles as $field => $uploadedFile) { - if (!isset($uploadedFile['error'])) { - if (is_array($uploadedFile)) { - $parsed[$field] = self::parseUploadedFiles($uploadedFile); - } - continue; - } - - $parsed[$field] = []; - if (!is_array($uploadedFile['error'])) { - $parsed[$field] = new static( - $uploadedFile['tmp_name'], - $uploadedFile['name'] ?? null, - $uploadedFile['type'] ?? null, - $uploadedFile['size'] ?? null, - $uploadedFile['error'], - true - ); - } else { - $subArray = []; - foreach ($uploadedFile['error'] as $fileIdx => $error) { - // Normalize sub array and re-parse to move the input's key name up a level - $subArray[$fileIdx]['name'] = $uploadedFile['name'][$fileIdx]; - $subArray[$fileIdx]['type'] = $uploadedFile['type'][$fileIdx]; - $subArray[$fileIdx]['tmp_name'] = $uploadedFile['tmp_name'][$fileIdx]; - $subArray[$fileIdx]['error'] = $uploadedFile['error'][$fileIdx]; - $subArray[$fileIdx]['size'] = $uploadedFile['size'][$fileIdx]; - - $parsed[$field] = self::parseUploadedFiles($subArray); - } - } - } - - return $parsed; - } -} diff --git a/system/vendor/slim/psr7/src/Uri.php b/system/vendor/slim/psr7/src/Uri.php deleted file mode 100644 index b43aa54..0000000 --- a/system/vendor/slim/psr7/src/Uri.php +++ /dev/null @@ -1,494 +0,0 @@ - null, - 'http' => 80, - 'https' => 443 - ]; - - /** - * Uri scheme (without "://" suffix) - */ - protected string $scheme = ''; - - protected string $user = ''; - - protected string $password = ''; - - protected string $host = ''; - - protected ?int $port; - - protected string $path = ''; - - /** - * Uri query string (without "?" prefix) - */ - protected string $query = ''; - - /** - * Uri fragment string (without "#" prefix) - */ - protected string $fragment = ''; - - /** - * @param string $scheme Uri scheme. - * @param string $host Uri host. - * @param int|null $port Uri port number. - * @param string $path Uri path. - * @param string $query Uri query string. - * @param string $fragment Uri fragment. - * @param string $user Uri user. - * @param string $password Uri password. - */ - public function __construct( - string $scheme, - string $host, - ?int $port = null, - string $path = '/', - string $query = '', - string $fragment = '', - string $user = '', - string $password = '' - ) { - $this->scheme = $this->filterScheme($scheme); - $this->host = $this->filterHost($host); - $this->port = $this->filterPort($port); - $this->path = $this->filterPath($path); - $this->query = $this->filterQuery($query); - $this->fragment = $this->filterFragment($fragment); - $this->user = $this->filterUserInfo($user); - $this->password = $this->filterUserInfo($password); - } - - /** - * {@inheritdoc} - */ - public function getScheme(): string - { - return $this->scheme; - } - - /** - * {@inheritdoc} - * @return static - */ - public function withScheme($scheme) - { - $scheme = $this->filterScheme($scheme); - $clone = clone $this; - $clone->scheme = $scheme; - - return $clone; - } - - /** - * Filter Uri scheme. - * - * @param mixed $scheme Raw Uri scheme. - * - * @return string - * - * @throws InvalidArgumentException If the Uri scheme is not a string. - * @throws InvalidArgumentException If Uri scheme is not exists in SUPPORTED_SCHEMES - */ - protected function filterScheme($scheme): string - { - if (!is_string($scheme)) { - throw new InvalidArgumentException('Uri scheme must be a string.'); - } - - $scheme = str_replace('://', '', strtolower($scheme)); - if (!key_exists($scheme, static::SUPPORTED_SCHEMES)) { - throw new InvalidArgumentException( - 'Uri scheme must be one of: "' . implode('", "', array_keys(static::SUPPORTED_SCHEMES)) . '"' - ); - } - - return $scheme; - } - - /** - * {@inheritdoc} - */ - public function getAuthority(): string - { - $userInfo = $this->getUserInfo(); - $host = $this->getHost(); - $port = $this->getPort(); - - return ($userInfo !== '' ? $userInfo . '@' : '') . $host . ($port !== null ? ':' . $port : ''); - } - - /** - * {@inheritdoc} - */ - public function getUserInfo(): string - { - $info = $this->user; - - if ($this->password !== '') { - $info .= ':' . $this->password; - } - - return $info; - } - - /** - * {@inheritdoc} - * @return static - */ - public function withUserInfo($user, $password = null) - { - $clone = clone $this; - $clone->user = $this->filterUserInfo($user); - - if ($clone->user !== '') { - $clone->password = $this->filterUserInfo($password); - } else { - $clone->password = ''; - } - - return $clone; - } - - /** - * Filters the user info string. - * - * Returns the percent-encoded query string. - * - * @param string|null $info The raw uri query string. - * - * @return string - */ - protected function filterUserInfo(?string $info = null): string - { - if (!is_string($info)) { - return ''; - } - - $match = preg_replace_callback( - '/(?:[^a-zA-Z0-9_\-\.~!\$&\'\(\)\*\+,;=]+|%(?![A-Fa-f0-9]{2}))/u', - function ($match) { - return rawurlencode($match[0]); - }, - $info - ); - - return is_string($match) ? $match : ''; - } - - /** - * {@inheritdoc} - */ - public function getHost(): string - { - return $this->host; - } - - /** - * {@inheritdoc} - * @return static - */ - public function withHost($host) - { - $clone = clone $this; - $clone->host = $this->filterHost($host); - - return $clone; - } - - /** - * Filter Uri host. - * - * If the supplied host is an IPv6 address, then it is converted to a reference - * as per RFC 2373. - * - * @param mixed $host The host to filter. - * - * @return string - * - * @throws InvalidArgumentException for invalid host names. - */ - protected function filterHost($host): string - { - if (is_object($host) && method_exists($host, '__toString')) { - $host = (string) $host; - } - - if (!is_string($host)) { - throw new InvalidArgumentException('Uri host must be a string'); - } - - if (filter_var($host, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) { - $host = '[' . $host . ']'; - } - - return strtolower($host); - } - - /** - * {@inheritdoc} - */ - public function getPort(): ?int - { - return $this->port && !$this->hasStandardPort() ? $this->port : null; - } - - /** - * {@inheritdoc} - * @return static - */ - public function withPort($port) - { - $port = $this->filterPort($port); - $clone = clone $this; - $clone->port = $port; - - return $clone; - } - - /** - * Does this Uri use a standard port? - * - * @return bool - */ - protected function hasStandardPort(): bool - { - return static::SUPPORTED_SCHEMES[$this->scheme] === $this->port; - } - - /** - * Filter Uri port. - * - * @param int|null $port The Uri port number. - * - * @return int|null - * - * @throws InvalidArgumentException If the port is invalid. - */ - protected function filterPort($port): ?int - { - if (is_null($port) || (is_integer($port) && ($port >= 1 && $port <= 65535))) { - return $port; - } - - throw new InvalidArgumentException('Uri port must be null or an integer between 1 and 65535 (inclusive)'); - } - - /** - * {@inheritdoc} - */ - public function getPath(): string - { - return $this->path; - } - - /** - * {@inheritdoc} - * @return static - */ - public function withPath($path) - { - if (!is_string($path)) { - throw new InvalidArgumentException('Uri path must be a string'); - } - - $clone = clone $this; - $clone->path = $this->filterPath($path); - - return $clone; - } - - /** - * Filter Uri path. - * - * This method percent-encodes all reserved characters in the provided path string. - * This method will NOT double-encode characters that are already percent-encoded. - * - * @param string $path The raw uri path. - * - * @return string The RFC 3986 percent-encoded uri path. - * - * @link http://www.faqs.org/rfcs/rfc3986.html - */ - protected function filterPath($path): string - { - $match = preg_replace_callback( - '/(?:[^a-zA-Z0-9_\-\.~:@&=\+\$,\/;%]+|%(?![A-Fa-f0-9]{2}))/', - function ($match) { - return rawurlencode($match[0]); - }, - $path - ); - - return is_string($match) ? $match : ''; - } - - /** - * {@inheritdoc} - */ - public function getQuery(): string - { - return $this->query; - } - - /** - * {@inheritdoc} - * @return static - */ - public function withQuery($query) - { - $query = ltrim($this->filterQuery($query), '?'); - $clone = clone $this; - $clone->query = $query; - - return $clone; - } - - /** - * Filters the query string of a URI. - * - * Returns the percent-encoded query string. - * - * @param mixed $query The raw uri query string. - * - * @return string - */ - protected function filterQuery($query): string - { - if (is_object($query) && method_exists($query, '__toString')) { - $query = (string) $query; - } - - if (!is_string($query)) { - throw new InvalidArgumentException('Uri query must be a string.'); - } - - $match = preg_replace_callback( - '/(?:[^a-zA-Z0-9_\-\.~!\$&\'\(\)\*\+,;=%:@\/\?]+|%(?![A-Fa-f0-9]{2}))/', - function ($match) { - return rawurlencode($match[0]); - }, - $query - ); - - return is_string($match) ? $match : ''; - } - - /** - * {@inheritdoc} - */ - public function getFragment(): string - { - return $this->fragment; - } - - /** - * {@inheritdoc} - * @return static - */ - public function withFragment($fragment) - { - $fragment = $this->filterFragment($fragment); - $clone = clone $this; - $clone->fragment = $fragment; - - return $clone; - } - - /** - * Filters fragment of a URI. - * - * Returns the percent-encoded fragment. - * - * @param mixed $fragment The raw uri query string. - * - * @return string - */ - protected function filterFragment($fragment): string - { - if (is_object($fragment) && method_exists($fragment, '__toString')) { - $fragment = (string) $fragment; - } - - if (!is_string($fragment)) { - throw new InvalidArgumentException('Uri fragment must be a string.'); - } - - $fragment = ltrim($fragment, '#'); - - $match = preg_replace_callback( - '/(?:[^a-zA-Z0-9_\-\.~!\$&\'\(\)\*\+,;=%:@\/\?]+|%(?![A-Fa-f0-9]{2}))/', - function ($match) { - return rawurlencode($match[0]); - }, - $fragment - ); - - return is_string($match) ? $match : ''; - } - - /** - * {@inheritdoc} - */ - public function __toString(): string - { - $scheme = $this->getScheme(); - $authority = $this->getAuthority(); - $path = $this->getPath(); - $query = $this->getQuery(); - $fragment = $this->getFragment(); - - if ($path !== '') { - if ($path[0] !== '/') { - if ($authority !== '') { - // If the path is rootless and an authority is present, the path MUST be prefixed by "/". - $path = '/' . $path; - } - } elseif (isset($path[1]) && $path[1] === '/') { - if ($authority === '') { - // If the path is starting with more than one "/" and no authority is present, - // the starting slashes MUST be reduced to one. - $path = '/' . ltrim($path, '/'); - } - } - } - - return ($scheme !== '' ? $scheme . ':' : '') - . ($authority !== '' ? '//' . $authority : '') - . $path - . ($query !== '' ? '?' . $query : '') - . ($fragment !== '' ? '#' . $fragment : ''); - } -} diff --git a/system/vendor/slim/slim/CHANGELOG.md b/system/vendor/slim/slim/CHANGELOG.md deleted file mode 100644 index 6bcb127..0000000 --- a/system/vendor/slim/slim/CHANGELOG.md +++ /dev/null @@ -1,237 +0,0 @@ -# Changelog - -# 4.11.0 - 2022-11-06 -- [3180: Declare types](https://github.com/slimphp/Slim/pull/3180) thanks to @nbayramberdiyev -- [3181: Update laminas/laminas-diactoros requirement from ^2.8 to ^2.9](https://github.com/slimphp/Slim/pull/3181) thanks to @dependabot[bot] -- [3182: Update guzzlehttp/psr7 requirement from ^2.1 to ^2.2](https://github.com/slimphp/Slim/pull/3182) thanks to @dependabot[bot] -- [3183: Update phpstan/phpstan requirement from ^1.4 to ^1.5](https://github.com/slimphp/Slim/pull/3183) thanks to @dependabot[bot] -- [3184: Update adriansuter/php-autoload-override requirement from ^1.2 to ^1.3](https://github.com/slimphp/Slim/pull/3184) thanks to @dependabot[bot] -- [3189: Update phpstan/phpstan requirement from ^1.5 to ^1.6](https://github.com/slimphp/Slim/pull/3189) thanks to @dependabot[bot] -- [3191: Adding property types to Middleware classes](https://github.com/slimphp/Slim/pull/3191) thanks to @ashleycoles -- [3193: Handlers types](https://github.com/slimphp/Slim/pull/3193) thanks to @ashleycoles -- [3194: Adding types to AbstractErrorRenderer](https://github.com/slimphp/Slim/pull/3194) thanks to @ashleycoles -- [3195: Adding prop types for Exception classes](https://github.com/slimphp/Slim/pull/3195) thanks to @ashleycoles -- [3196: Adding property type declarations for Factory classes](https://github.com/slimphp/Slim/pull/3196) thanks to @ashleycoles -- [3197: Remove redundant docblock types](https://github.com/slimphp/Slim/pull/3197) thanks to @theodorejb -- [3199: Update laminas/laminas-diactoros requirement from ^2.9 to ^2.11](https://github.com/slimphp/Slim/pull/3199) thanks to @dependabot[bot] -- [3200: Update phpstan/phpstan requirement from ^1.6 to ^1.7](https://github.com/slimphp/Slim/pull/3200) thanks to @dependabot[bot] -- [3205: Update guzzlehttp/psr7 requirement from ^2.2 to ^2.4](https://github.com/slimphp/Slim/pull/3205) thanks to @dependabot[bot] -- [3206: Update squizlabs/php_codesniffer requirement from ^3.6 to ^3.7](https://github.com/slimphp/Slim/pull/3206) thanks to @dependabot[bot] -- [3207: Update phpstan/phpstan requirement from ^1.7 to ^1.8](https://github.com/slimphp/Slim/pull/3207) thanks to @dependabot[bot] -- [3211: Assign null coalescing to coalesce equal](https://github.com/slimphp/Slim/pull/3211) thanks to @MathiasReker -- [3213: Void return](https://github.com/slimphp/Slim/pull/3213) thanks to @MathiasReker -- [3214: Is null](https://github.com/slimphp/Slim/pull/3214) thanks to @MathiasReker -- [3216: Refactor](https://github.com/slimphp/Slim/pull/3216) thanks to @mehdihasanpour -- [3218: Refactor some code](https://github.com/slimphp/Slim/pull/3218) thanks to @mehdihasanpour -- [3221: Cleanup](https://github.com/slimphp/Slim/pull/3221) thanks to @mehdihasanpour -- [3225: Update laminas/laminas-diactoros requirement from ^2.11 to ^2.14](https://github.com/slimphp/Slim/pull/3225) thanks to @dependabot[bot] -- [3228: Using assertSame to let assert equal be restricted](https://github.com/slimphp/Slim/pull/3228) thanks to @peter279k -- [3229: Update laminas/laminas-diactoros requirement from ^2.14 to ^2.17](https://github.com/slimphp/Slim/pull/3229) thanks to @dependabot[bot] -- [3235: Persist routes indexed by name in RouteCollector for improved performance.](https://github.com/slimphp/Slim/pull/3235) thanks to @BusterNeece - -# 4.10.0 - 2022-03-14 -- [3120: Add a new PSR-17 factory to Psr17FactoryProvider](https://github.com/slimphp/Slim/pull/3120) thanks to @solventt -- [3123: Replace deprecated setMethods() in tests](https://github.com/slimphp/Slim/pull/3123) thanks to @solventt -- [3126: Update guzzlehttp/psr7 requirement from ^2.0 to ^2.1](https://github.com/slimphp/Slim/pull/3126) thanks to @dependabot[bot] -- [3127: PHPStan v1.0](https://github.com/slimphp/Slim/pull/3127) thanks to @t0mmy742 -- [3128: Update phpstan/phpstan requirement from ^1.0 to ^1.2](https://github.com/slimphp/Slim/pull/3128) thanks to @dependabot[bot] -- [3129: Deprecate PHP 7.3](https://github.com/slimphp/Slim/pull/3129) thanks to @l0gicgate -- [3130: Removed double defined PHP 7.4](https://github.com/slimphp/Slim/pull/3130) thanks to @flangofas -- [3132: Add new `RequestResponseNamedArgs` route strategy](https://github.com/slimphp/Slim/pull/3132) thanks to @adoy -- [3133: Improve typehinting for `RouteParserInterface`](https://github.com/slimphp/Slim/pull/3133) thanks to @jerowork -- [3135: Update phpstan/phpstan requirement from ^1.2 to ^1.3](https://github.com/slimphp/Slim/pull/3135) thanks to @dependabot[bot] -- [3137: Update phpspec/prophecy requirement from ^1.14 to ^1.15](https://github.com/slimphp/Slim/pull/3137) thanks to @dependabot[bot] -- [3138: Update license year](https://github.com/slimphp/Slim/pull/3138) thanks to @Awilum -- [3139: Fixed #1730 (reintroduced in 4.x)](https://github.com/slimphp/Slim/pull/3139) thanks to @adoy -- [3145: Update phpstan/phpstan requirement from ^1.3 to ^1.4](https://github.com/slimphp/Slim/pull/3145) thanks to @dependabot[bot] -- [3146: Inherit HttpException from RuntimeException](https://github.com/slimphp/Slim/pull/3146) thanks to @nbayramberdiyev -- [3148: Upgrade to HTML5](https://github.com/slimphp/Slim/pull/3148) thanks to @nbayramberdiyev -- [3172: Update nyholm/psr7 requirement from ^1.4 to ^1.5](https://github.com/slimphp/Slim/pull/3172) thanks to @dependabot[bot] - -# 4.9.0 - 2021-10-05 -- [3058: Implement exception class for Gone Http error](https://github.com/slimphp/Slim/pull/3058) thanks to @TheKernelPanic -- [3086: Update slim/psr7 requirement from ^1.3 to ^1.4](https://github.com/slimphp/Slim/pull/3086) thanks to @dependabot[bot] -- [3087: Update nyholm/psr7-server requirement from ^1.0.1 to ^1.0.2](https://github.com/slimphp/Slim/pull/3087) thanks to @dependabot[bot] -- [3093: Update phpstan/phpstan requirement from ^0.12.85 to ^0.12.90](https://github.com/slimphp/Slim/pull/3093) thanks to @dependabot[bot] -- [3099: Allow updated psr log](https://github.com/slimphp/Slim/pull/3099) thanks to @t0mmy742 -- [3104: Drop php7.2](https://github.com/slimphp/Slim/pull/3104) thanks to @t0mmy742 -- [3106: Use PSR-17 factory from Guzzle/psr7 2.0](https://github.com/slimphp/Slim/pull/3106) thanks to @t0mmy742 -- [3108: Update README file](https://github.com/slimphp/Slim/pull/3108) thanks to @t0mmy742 -- [3112: Update laminas/laminas-diactoros requirement from ^2.6 to ^2.8](https://github.com/slimphp/Slim/pull/3112) thanks to @dependabot[bot] -- [3114: Update slim/psr7 requirement from ^1.4 to ^1.5](https://github.com/slimphp/Slim/pull/3114) thanks to @dependabot[bot] -- [3115: Update phpstan/phpstan requirement from ^0.12.96 to ^0.12.99](https://github.com/slimphp/Slim/pull/3115) thanks to @dependabot[bot] -- [3116: Remove Zend Diactoros references](https://github.com/slimphp/Slim/pull/3116) thanks to @l0gicgate - -# 4.8.0 - 2021-05-19 -- [3034: Fix phpunit dependency version](https://github.com/slimphp/Slim/pull/3034) thanks to @l0gicgate -- [3037: Replace Travis by GitHub Actions](https://github.com/slimphp/Slim/pull/3037) thanks to @t0mmy742 -- [3043: Cover App creation from AppFactory with empty Container](https://github.com/slimphp/Slim/pull/3043) thanks to @t0mmy742 -- [3045: Update phpstan/phpstan requirement from ^0.12.58 to ^0.12.64](https://github.com/slimphp/Slim/pull/3045) thanks to @dependabot-preview[bot] -- [3047: documentation: min php 7.2 required](https://github.com/slimphp/Slim/pull/3047) thanks to @Rotzbua -- [3054: Update phpstan/phpstan requirement from ^0.12.64 to ^0.12.70](https://github.com/slimphp/Slim/pull/3054) thanks to @dependabot-preview[bot] -- [3056: Fix docblock in ErrorMiddleware](https://github.com/slimphp/Slim/pull/3056) thanks to @piotr-cz -- [3060: Update phpstan/phpstan requirement from ^0.12.70 to ^0.12.80](https://github.com/slimphp/Slim/pull/3060) thanks to @dependabot-preview[bot] -- [3061: Update nyholm/psr7 requirement from ^1.3 to ^1.4](https://github.com/slimphp/Slim/pull/3061) thanks to @dependabot-preview[bot] -- [3063: Allow ^1.0 || ^2.0 in psr/container](https://github.com/slimphp/Slim/pull/3063) thanks to @Ayesh -- [3069: Classname/Method Callable Arrays](https://github.com/slimphp/Slim/pull/3069) thanks to @ddrv -- [3078: Update squizlabs/php_codesniffer requirement from ^3.5 to ^3.6](https://github.com/slimphp/Slim/pull/3078) thanks to @dependabot[bot] -- [3079: Update phpspec/prophecy requirement from ^1.12 to ^1.13](https://github.com/slimphp/Slim/pull/3079) thanks to @dependabot[bot] -- [3080: Update guzzlehttp/psr7 requirement from ^1.7 to ^1.8](https://github.com/slimphp/Slim/pull/3080) thanks to @dependabot[bot] -- [3082: Update phpstan/phpstan requirement from ^0.12.80 to ^0.12.85](https://github.com/slimphp/Slim/pull/3082) thanks to @dependabot[bot] - -# 4.7.0 - 2020-11-30 - -### Fixed -- [3027: Fix: FastRoute dispatcher and data generator should match](https://github.com/slimphp/Slim/pull/3027) thanks to @edudobay - -### Added -- [3015: PHP 8 support](https://github.com/slimphp/Slim/pull/3015) thanks to @edudobay - -### Optimizations -- [3024: Randomize tests](https://github.com/slimphp/Slim/pull/3024) thanks to @pawel-slowik - -## 4.6.0 - 2020-11-15 - -### Fixed -- [2942: Fix PHPdoc for error handlers in ErrorMiddleware ](https://github.com/slimphp/Slim/pull/2942) thanks to @TiMESPLiNTER -- [2944: Remove unused function in ErrorHandler](https://github.com/slimphp/Slim/pull/2944) thanks to @l0gicgate -- [2960: Fix phpstan 0.12 errors](https://github.com/slimphp/Slim/pull/2960) thanks to @adriansuter -- [2982: Removing cloning statements in tests](https://github.com/slimphp/Slim/pull/2982) thanks to @l0gicgate -- [3017: Fix request creator factory test](https://github.com/slimphp/Slim/pull/3017) thanks to @pawel-slowik -- [3022: Ensure RouteParser Always Present After Routing](https://github.com/slimphp/Slim/pull/3022) thanks to @l0gicgate - -### Added -- [2949: Add the support in composer.json](https://github.com/slimphp/Slim/pull/2949) thanks to @ddrv -- [2958: Strict empty string content type checking in BodyParsingMiddleware::getMediaType](https://github.com/slimphp/Slim/pull/2958) thanks to @Ayesh -- [2997: Add hints to methods](https://github.com/slimphp/Slim/pull/2997) thanks to @evgsavosin - [3000: Fix route controller test](https://github.com/slimphp/Slim/pull/3000) thanks to @pawel-slowik -- [3001: Add missing `$strategy` parameter in a Route test](https://github.com/slimphp/Slim/pull/3001) thanks to @pawel-slowik - -### Optimizations -- [2951: Minor optimizations in if() blocks](https://github.com/slimphp/Slim/pull/2951) thanks to @Ayesh -- [2959: Micro optimization: Declare closures in BodyParsingMiddleware as static](https://github.com/slimphp/Slim/pull/2959) thanks to @Ayesh -- [2978: Split the routing results to its own function.](https://github.com/slimphp/Slim/pull/2978) thanks to @dlundgren - -### Dependencies Updated -- [2953: Update nyholm/psr7-server requirement from ^0.4.1](https://github.com/slimphp/Slim/pull/2953) thanks to @dependabot-preview[bot] -- [2954: Update laminas/laminas-diactoros requirement from ^2.1 to ^2.3](https://github.com/slimphp/Slim/pull/2954) thanks to @dependabot-preview[bot] -- [2955: Update guzzlehttp/psr7 requirement from ^1.5 to ^1.6](https://github.com/slimphp/Slim/pull/2955) thanks to @dependabot-preview[bot] -- [2956: Update slim/psr7 requirement from ^1.0 to ^1.1](https://github.com/slimphp/Slim/pull/2956) thanks to @dependabot-preview[bot] -- [2957: Update nyholm/psr7 requirement from ^1.1 to ^1.2](https://github.com/slimphp/Slim/pull/2957) thanks to @dependabot-preview[bot] -- [2963: Update phpstan/phpstan requirement from ^0.12.23 to ^0.12.25](https://github.com/slimphp/Slim/pull/2963) thanks to @dependabot-preview[bot] -- [2965: Update adriansuter/php-autoload-override requirement from ^1.0 to ^1.1](https://github.com/slimphp/Slim/pull/2965) thanks to @dependabot-preview[bot] -- [2967: Update nyholm/psr7 requirement from ^1.2 to ^1.3](https://github.com/slimphp/Slim/pull/2967) thanks to @dependabot-preview[bot] -- [2969: Update nyholm/psr7-server requirement from ^0.4.1 to ^1.0.0](https://github.com/slimphp/Slim/pull/2969) thanks to @dependabot-preview[bot] -- [2970: Update phpstan/phpstan requirement from ^0.12.25 to ^0.12.26](https://github.com/slimphp/Slim/pull/2970) thanks to @dependabot-preview[bot] -- [2971: Update phpstan/phpstan requirement from ^0.12.26 to ^0.12.27](https://github.com/slimphp/Slim/pull/2971) thanks to @dependabot-preview[bot] -- [2972: Update phpstan/phpstan requirement from ^0.12.27 to ^0.12.28](https://github.com/slimphp/Slim/pull/2972) thanks to @dependabot-preview[bot] -- [2973: Update phpstan/phpstan requirement from ^0.12.28 to ^0.12.29](https://github.com/slimphp/Slim/pull/2973) thanks to @dependabot-preview[bot] -- [2975: Update phpstan/phpstan requirement from ^0.12.29 to ^0.12.30](https://github.com/slimphp/Slim/pull/2975) thanks to @dependabot-preview[bot] -- [2976: Update phpstan/phpstan requirement from ^0.12.30 to ^0.12.31](https://github.com/slimphp/Slim/pull/2976) thanks to @dependabot-preview[bot] -- [2980: Update phpstan/phpstan requirement from ^0.12.31 to ^0.12.32](https://github.com/slimphp/Slim/pull/2980) thanks to @dependabot-preview[bot] -- [2981: Update phpspec/prophecy requirement from ^1.10 to ^1.11](https://github.com/slimphp/Slim/pull/2981) thanks to @dependabot-preview[bot] -- [2986: Update phpstan/phpstan requirement from ^0.12.32 to ^0.12.33](https://github.com/slimphp/Slim/pull/2986) thanks to @dependabot-preview[bot] -- [2990: Update phpstan/phpstan requirement from ^0.12.33 to ^0.12.34](https://github.com/slimphp/Slim/pull/2990) thanks to @dependabot-preview[bot] -- [2991: Update phpstan/phpstan requirement from ^0.12.34 to ^0.12.35](https://github.com/slimphp/Slim/pull/2991) thanks to @dependabot-preview[bot] -- [2993: Update phpstan/phpstan requirement from ^0.12.35 to ^0.12.36](https://github.com/slimphp/Slim/pull/2993) thanks to @dependabot-preview[bot] -- [2995: Update phpstan/phpstan requirement from ^0.12.36 to ^0.12.37](https://github.com/slimphp/Slim/pull/2995) thanks to @dependabot-preview[bot] -- [3010: Update guzzlehttp/psr7 requirement from ^1.6 to ^1.7](https://github.com/slimphp/Slim/pull/3010) thanks to @dependabot-preview[bot] -- [3011: Update phpspec/prophecy requirement from ^1.11 to ^1.12](https://github.com/slimphp/Slim/pull/3011) thanks to @dependabot-preview[bot] -- [3012: Update slim/http requirement from ^1.0 to ^1.1](https://github.com/slimphp/Slim/pull/3012) thanks to @dependabot-preview[bot] -- [3013: Update slim/psr7 requirement from ^1.1 to ^1.2](https://github.com/slimphp/Slim/pull/3013) thanks to @dependabot-preview[bot] -- [3014: Update laminas/laminas-diactoros requirement from ^2.3 to ^2.4](https://github.com/slimphp/Slim/pull/3014) thanks to @dependabot-preview[bot] -- [3018: Update phpstan/phpstan requirement from ^0.12.37 to ^0.12.54](https://github.com/slimphp/Slim/pull/3018) thanks to @dependabot-preview[bot] - -## 4.5.0 - 2020-04-14 - -### Added -- [2928](https://github.com/slimphp/Slim/pull/2928) Test against PHP 7.4 -- [2937](https://github.com/slimphp/Slim/pull/2937) Add support for PSR-3 - -### Fixed -- [2916](https://github.com/slimphp/Slim/pull/2916) Rename phpcs.xml to phpcs.xml.dist -- [2917](https://github.com/slimphp/Slim/pull/2917) Update .editorconfig -- [2925](https://github.com/slimphp/Slim/pull/2925) ResponseEmitter: Don't remove Content-Type and Content-Length when body is empt -- [2932](https://github.com/slimphp/Slim/pull/2932) Update the Tidelift enterprise language -- [2938](https://github.com/slimphp/Slim/pull/2938) Modify usage of deprecated expectExceptionMessageRegExp() method - -## 4.4.0 - 2020-01-04 - -### Added -- [2862](https://github.com/slimphp/Slim/pull/2862) Optionally handle subclasses of exceptions in custom error handler -- [2869](https://github.com/slimphp/Slim/pull/2869) php-di/php-di added in composer suggestion -- [2874](https://github.com/slimphp/Slim/pull/2874) Add `null` to param type-hints -- [2889](https://github.com/slimphp/Slim/pull/2889) Make `RouteContext` attributes customizable and change default to use private names -- [2907](https://github.com/slimphp/Slim/pull/2907) Migrate to PSR-12 convention -- [2910](https://github.com/slimphp/Slim/pull/2910) Migrate Zend to Laminas -- [2912](https://github.com/slimphp/Slim/pull/2912) Add Laminas PSR17 Factory -- [2913](https://github.com/slimphp/Slim/pull/2913) Update php-autoload-override version -- [2914](https://github.com/slimphp/Slim/pull/2914) Added ability to add handled exceptions as an array - -### Fixed -- [2864](https://github.com/slimphp/Slim/pull/2864) Optimize error message in error handling if displayErrorDetails was not set -- [2876](https://github.com/slimphp/Slim/pull/2876) Update links from http to https -- [2877](https://github.com/slimphp/Slim/pull/2877) Fix docblock for `Slim\Routing\RouteCollector::cacheFile` -- [2878](https://github.com/slimphp/Slim/pull/2878) check body is writable only on ouput buffering append -- [2896](https://github.com/slimphp/Slim/pull/2896) Render errors uniformly -- [2902](https://github.com/slimphp/Slim/pull/2902) Fix prophecies -- [2908](https://github.com/slimphp/Slim/pull/2908) Use autoload-dev for `Slim\Tests` namespace - -### Removed -- [2871](https://github.com/slimphp/Slim/pull/2871) Remove explicit type-hint -- [2872](https://github.com/slimphp/Slim/pull/2872) Remove type-hint - -## 4.3.0 - 2019-10-05 - -### Added -- [2819](https://github.com/slimphp/Slim/pull/2819) Added description to addRoutingMiddleware() -- [2820](https://github.com/slimphp/Slim/pull/2820) Update link to homepage in composer.json -- [2828](https://github.com/slimphp/Slim/pull/2828) Allow URIs with leading multi-slashes -- [2832](https://github.com/slimphp/Slim/pull/2832) Refactor `FastRouteDispatcher` -- [2835](https://github.com/slimphp/Slim/pull/2835) Rename `pathFor` to `urlFor` in docblock -- [2846](https://github.com/slimphp/Slim/pull/2846) Correcting the branch name as per issue-2843 -- [2849](https://github.com/slimphp/Slim/pull/2849) Create class alias for FastRoute\RouteCollector -- [2855](https://github.com/slimphp/Slim/pull/2855) Add list of allowed methods to HttpMethodNotAllowedException -- [2860](https://github.com/slimphp/Slim/pull/2860) Add base path to `$request` and use `RouteContext` to read - -### Fixed -- [2839](https://github.com/slimphp/Slim/pull/2839) Fix description for handler signature in phpdocs -- [2844](https://github.com/slimphp/Slim/pull/2844) Handle base path by routeCollector instead of RouteCollectorProxy -- [2845](https://github.com/slimphp/Slim/pull/2845) Fix composer scripts -- [2851](https://github.com/slimphp/Slim/pull/2851) Fix example of 'Hello World' app -- [2854](https://github.com/slimphp/Slim/pull/2854) Fix undefined property in tests - -### Removed -- [2853](https://github.com/slimphp/Slim/pull/2853) Remove unused classes - -## 4.2.0 - 2019-08-20 - -### Added -- [2787](https://github.com/slimphp/Slim/pull/2787) Add an advanced callable resolver -- [2791](https://github.com/slimphp/Slim/pull/2791) Add `inferPrivatePropertyTypeFromConstructor` to phpstan -- [2793](https://github.com/slimphp/Slim/pull/2793) Add ability to configure application via a container in `AppFactory` -- [2798](https://github.com/slimphp/Slim/pull/2798) Add PSR-7 Agnostic Body Parsing Middleware -- [2801](https://github.com/slimphp/Slim/pull/2801) Add `setLogErrorRenderer()` method to `ErrorHandler` -- [2807](https://github.com/slimphp/Slim/pull/2807) Add check for Slim callable notation if no resolver given -- [2803](https://github.com/slimphp/Slim/pull/2803) Add ability to emit non seekable streams in `ResponseEmitter` -- [2817](https://github.com/slimphp/Slim/pull/2817) Add the ability to pass in a custom `MiddlewareDispatcherInterface` to the `App` - -### Fixed -- [2789](https://github.com/slimphp/Slim/pull/2789) Fix Cookie header detection in `ResponseEmitter` -- [2796](https://github.com/slimphp/Slim/pull/2796) Fix http message format -- [2800](https://github.com/slimphp/Slim/pull/2800) Fix null comparisons more clear in `ErrorHandler` -- [2802](https://github.com/slimphp/Slim/pull/2802) Fix incorrect search of a header in stack -- [2806](https://github.com/slimphp/Slim/pull/2806) Simplify `Route::prepare()` method argument preparation -- [2809](https://github.com/slimphp/Slim/pull/2809) Eliminate a duplicate code via HOF in `MiddlewareDispatcher` -- [2816](https://github.com/slimphp/Slim/pull/2816) Fix RouteCollectorProxy::redirect() bug - -### Removed -- [2811](https://github.com/slimphp/Slim/pull/2811) Remove `DeferredCallable` - -## 4.1.0 - 2019-08-06 - -### Added -- [#2779](https://github.com/slimphp/Slim/pull/2774) Add support for Slim callables `Class:method` resolution & Container Closure auto-binding in `MiddlewareDispatcher` -- [#2774](https://github.com/slimphp/Slim/pull/2774) Add possibility for custom `RequestHandler` invocation strategies - -### Fixed -- [#2776](https://github.com/slimphp/Slim/pull/2774) Fix group middleware on multiple nested groups diff --git a/system/vendor/slim/slim/LICENSE.md b/system/vendor/slim/slim/LICENSE.md deleted file mode 100644 index d6fd559..0000000 --- a/system/vendor/slim/slim/LICENSE.md +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2011-2022 Josh Lockhart - -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/system/vendor/slim/slim/MAINTAINERS.md b/system/vendor/slim/slim/MAINTAINERS.md deleted file mode 100644 index 2b8ad04..0000000 --- a/system/vendor/slim/slim/MAINTAINERS.md +++ /dev/null @@ -1,17 +0,0 @@ -# Maintainers - -There aren't many rules for maintainers of Slim to remember; what we have is listed here. - -## We don't merge our own PRs - -Our code is better if more than one set of eyes looks at it. Therefore we do not merge our own pull requests unless there is an exceptional circumstance. This helps to spot errors in the patch and also enables us to share information about the project around the maintainer team. - -## PRs tagged `WIP` are not ready to be merged - -Sometimes it's helpful to collaborate on a patch before it's ready to be merged. We use the text `WIP` (for _Work in Progress_) in the title to mark these PRs. - -If a PR has `WIP` in its title, then it is not to be merged. The person who raised the PR will remove the `WIP` text when they are ready for a full review and merge. - -## Assign a merged PR to a milestone - -By ensuring that all merged PRs are assigned to a milestone, we can easily find which PRs were in which release. diff --git a/system/vendor/slim/slim/SECURITY.md b/system/vendor/slim/slim/SECURITY.md deleted file mode 100644 index a5b6df0..0000000 --- a/system/vendor/slim/slim/SECURITY.md +++ /dev/null @@ -1,14 +0,0 @@ -# Security Policy - -### Supported Versions - - -| Version | Supported | -| ------- | ------------------ | -| 3.x.x | :white_check_mark: | -| 4.x.x | :white_check_mark: | - - -### Reporting a Vulnerability - -To report a vulnerability please send an email to security@slimframework.com diff --git a/system/vendor/slim/slim/Slim/App.php b/system/vendor/slim/slim/Slim/App.php deleted file mode 100644 index ebcc751..0000000 --- a/system/vendor/slim/slim/Slim/App.php +++ /dev/null @@ -1,216 +0,0 @@ -routeResolver = $routeResolver ?? new RouteResolver($this->routeCollector); - $routeRunner = new RouteRunner($this->routeResolver, $this->routeCollector->getRouteParser(), $this); - - if (!$middlewareDispatcher) { - $middlewareDispatcher = new MiddlewareDispatcher($routeRunner, $this->callableResolver, $container); - } else { - $middlewareDispatcher->seedMiddlewareStack($routeRunner); - } - - $this->middlewareDispatcher = $middlewareDispatcher; - } - - /** - * @return RouteResolverInterface - */ - public function getRouteResolver(): RouteResolverInterface - { - return $this->routeResolver; - } - - /** - * @return MiddlewareDispatcherInterface - */ - public function getMiddlewareDispatcher(): MiddlewareDispatcherInterface - { - return $this->middlewareDispatcher; - } - - /** - * @param MiddlewareInterface|string|callable $middleware - */ - public function add($middleware): self - { - $this->middlewareDispatcher->add($middleware); - return $this; - } - - /** - * @param MiddlewareInterface $middleware - */ - public function addMiddleware(MiddlewareInterface $middleware): self - { - $this->middlewareDispatcher->addMiddleware($middleware); - return $this; - } - - /** - * Add the Slim built-in routing middleware to the app middleware stack - * - * This method can be used to control middleware order and is not required for default routing operation. - * - * @return RoutingMiddleware - */ - public function addRoutingMiddleware(): RoutingMiddleware - { - $routingMiddleware = new RoutingMiddleware( - $this->getRouteResolver(), - $this->getRouteCollector()->getRouteParser() - ); - $this->add($routingMiddleware); - return $routingMiddleware; - } - - /** - * Add the Slim built-in error middleware to the app middleware stack - * - * @param bool $displayErrorDetails - * @param bool $logErrors - * @param bool $logErrorDetails - * @param LoggerInterface|null $logger - * - * @return ErrorMiddleware - */ - public function addErrorMiddleware( - bool $displayErrorDetails, - bool $logErrors, - bool $logErrorDetails, - ?LoggerInterface $logger = null - ): ErrorMiddleware { - $errorMiddleware = new ErrorMiddleware( - $this->getCallableResolver(), - $this->getResponseFactory(), - $displayErrorDetails, - $logErrors, - $logErrorDetails, - $logger - ); - $this->add($errorMiddleware); - return $errorMiddleware; - } - - /** - * Add the Slim body parsing middleware to the app middleware stack - * - * @param callable[] $bodyParsers - * - * @return BodyParsingMiddleware - */ - public function addBodyParsingMiddleware(array $bodyParsers = []): BodyParsingMiddleware - { - $bodyParsingMiddleware = new BodyParsingMiddleware($bodyParsers); - $this->add($bodyParsingMiddleware); - return $bodyParsingMiddleware; - } - - /** - * Run application - * - * This method traverses the application middleware stack and then sends the - * resultant Response object to the HTTP client. - * - * @param ServerRequestInterface|null $request - * @return void - */ - public function run(?ServerRequestInterface $request = null): void - { - if (!$request) { - $serverRequestCreator = ServerRequestCreatorFactory::create(); - $request = $serverRequestCreator->createServerRequestFromGlobals(); - } - - $response = $this->handle($request); - $responseEmitter = new ResponseEmitter(); - $responseEmitter->emit($response); - } - - /** - * Handle a request - * - * This method traverses the application middleware stack and then returns the - * resultant Response object. - * - * @param ServerRequestInterface $request - * @return ResponseInterface - */ - public function handle(ServerRequestInterface $request): ResponseInterface - { - $response = $this->middlewareDispatcher->handle($request); - - /** - * This is to be in compliance with RFC 2616, Section 9. - * If the incoming request method is HEAD, we need to ensure that the response body - * is empty as the request may fall back on a GET route handler due to FastRoute's - * routing logic which could potentially append content to the response body - * https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.4 - */ - $method = strtoupper($request->getMethod()); - if ($method === 'HEAD') { - $emptyBody = $this->responseFactory->createResponse()->getBody(); - return $response->withBody($emptyBody); - } - - return $response; - } -} diff --git a/system/vendor/slim/slim/Slim/CallableResolver.php b/system/vendor/slim/slim/Slim/CallableResolver.php deleted file mode 100644 index 66f225d..0000000 --- a/system/vendor/slim/slim/Slim/CallableResolver.php +++ /dev/null @@ -1,193 +0,0 @@ -container = $container; - } - - /** - * {@inheritdoc} - */ - public function resolve($toResolve): callable - { - $toResolve = $this->prepareToResolve($toResolve); - if (is_callable($toResolve)) { - return $this->bindToContainer($toResolve); - } - $resolved = $toResolve; - if (is_string($toResolve)) { - $resolved = $this->resolveSlimNotation($toResolve); - $resolved[1] ??= '__invoke'; - } - $callable = $this->assertCallable($resolved, $toResolve); - return $this->bindToContainer($callable); - } - - /** - * {@inheritdoc} - */ - public function resolveRoute($toResolve): callable - { - return $this->resolveByPredicate($toResolve, [$this, 'isRoute'], 'handle'); - } - - /** - * {@inheritdoc} - */ - public function resolveMiddleware($toResolve): callable - { - return $this->resolveByPredicate($toResolve, [$this, 'isMiddleware'], 'process'); - } - - /** - * @param string|callable $toResolve - * - * @throws RuntimeException - */ - private function resolveByPredicate($toResolve, callable $predicate, string $defaultMethod): callable - { - $toResolve = $this->prepareToResolve($toResolve); - if (is_callable($toResolve)) { - return $this->bindToContainer($toResolve); - } - $resolved = $toResolve; - if ($predicate($toResolve)) { - $resolved = [$toResolve, $defaultMethod]; - } - if (is_string($toResolve)) { - [$instance, $method] = $this->resolveSlimNotation($toResolve); - if ($method === null && $predicate($instance)) { - $method = $defaultMethod; - } - $resolved = [$instance, $method ?? '__invoke']; - } - $callable = $this->assertCallable($resolved, $toResolve); - return $this->bindToContainer($callable); - } - - /** - * @param mixed $toResolve - */ - private function isRoute($toResolve): bool - { - return $toResolve instanceof RequestHandlerInterface; - } - - /** - * @param mixed $toResolve - */ - private function isMiddleware($toResolve): bool - { - return $toResolve instanceof MiddlewareInterface; - } - - /** - * @throws RuntimeException - * - * @return array{object, string|null} [Instance, Method Name] - */ - private function resolveSlimNotation(string $toResolve): array - { - preg_match(CallableResolver::$callablePattern, $toResolve, $matches); - [$class, $method] = $matches ? [$matches[1], $matches[2]] : [$toResolve, null]; - - /** @var string $class */ - /** @var string|null $method */ - if ($this->container && $this->container->has($class)) { - $instance = $this->container->get($class); - if (!is_object($instance)) { - throw new RuntimeException(sprintf('%s container entry is not an object', $class)); - } - } else { - if (!class_exists($class)) { - if ($method) { - $class .= '::' . $method . '()'; - } - throw new RuntimeException(sprintf('Callable %s does not exist', $class)); - } - $instance = new $class($this->container); - } - return [$instance, $method]; - } - - /** - * @param mixed $resolved - * @param mixed $toResolve - * - * @throws RuntimeException - */ - private function assertCallable($resolved, $toResolve): callable - { - if (!is_callable($resolved)) { - if (is_callable($toResolve) || is_object($toResolve) || is_array($toResolve)) { - $formatedToResolve = ($toResolveJson = json_encode($toResolve)) !== false ? $toResolveJson : ''; - } else { - $formatedToResolve = is_string($toResolve) ? $toResolve : ''; - } - throw new RuntimeException(sprintf('%s is not resolvable', $formatedToResolve)); - } - return $resolved; - } - - private function bindToContainer(callable $callable): callable - { - if (is_array($callable) && $callable[0] instanceof Closure) { - $callable = $callable[0]; - } - if ($this->container && $callable instanceof Closure) { - /** @var Closure $callable */ - $callable = $callable->bindTo($this->container); - } - return $callable; - } - - /** - * @param string|callable $toResolve - * @return string|callable - */ - private function prepareToResolve($toResolve) - { - if (!is_array($toResolve)) { - return $toResolve; - } - $candidate = $toResolve; - $class = array_shift($candidate); - $method = array_shift($candidate); - if (is_string($class) && is_string($method)) { - return $class . ':' . $method; - } - return $toResolve; - } -} diff --git a/system/vendor/slim/slim/Slim/Error/AbstractErrorRenderer.php b/system/vendor/slim/slim/Slim/Error/AbstractErrorRenderer.php deleted file mode 100644 index 90b290d..0000000 --- a/system/vendor/slim/slim/Slim/Error/AbstractErrorRenderer.php +++ /dev/null @@ -1,46 +0,0 @@ -getTitle(); - } - - return $this->defaultErrorTitle; - } - - protected function getErrorDescription(Throwable $exception): string - { - if ($exception instanceof HttpException) { - return $exception->getDescription(); - } - - return $this->defaultErrorDescription; - } -} diff --git a/system/vendor/slim/slim/Slim/Error/Renderers/HtmlErrorRenderer.php b/system/vendor/slim/slim/Slim/Error/Renderers/HtmlErrorRenderer.php deleted file mode 100644 index e030522..0000000 --- a/system/vendor/slim/slim/Slim/Error/Renderers/HtmlErrorRenderer.php +++ /dev/null @@ -1,84 +0,0 @@ -The application could not run because of the following error:

'; - $html .= '

Details

'; - $html .= $this->renderExceptionFragment($exception); - } else { - $html = "

{$this->getErrorDescription($exception)}

"; - } - - return $this->renderHtmlBody($this->getErrorTitle($exception), $html); - } - - private function renderExceptionFragment(Throwable $exception): string - { - $html = sprintf('
Type: %s
', get_class($exception)); - - /** @var int|string $code */ - $code = $exception->getCode(); - $html .= sprintf('
Code: %s
', $code); - - $html .= sprintf('
Message: %s
', htmlentities($exception->getMessage())); - - $html .= sprintf('
File: %s
', $exception->getFile()); - - $html .= sprintf('
Line: %s
', $exception->getLine()); - - $html .= '

Trace

'; - $html .= sprintf('
%s
', htmlentities($exception->getTraceAsString())); - - return $html; - } - - public function renderHtmlBody(string $title = '', string $html = ''): string - { - return sprintf( - '' . - '' . - ' ' . - ' ' . - ' ' . - ' %s' . - ' ' . - ' ' . - ' ' . - '

%s

' . - '
%s
' . - ' Go Back' . - ' ' . - '', - $title, - $title, - $html - ); - } -} diff --git a/system/vendor/slim/slim/Slim/Error/Renderers/JsonErrorRenderer.php b/system/vendor/slim/slim/Slim/Error/Renderers/JsonErrorRenderer.php deleted file mode 100644 index 63d905b..0000000 --- a/system/vendor/slim/slim/Slim/Error/Renderers/JsonErrorRenderer.php +++ /dev/null @@ -1,56 +0,0 @@ - $this->getErrorTitle($exception)]; - - if ($displayErrorDetails) { - $error['exception'] = []; - do { - $error['exception'][] = $this->formatExceptionFragment($exception); - } while ($exception = $exception->getPrevious()); - } - - return (string) json_encode($error, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES); - } - - /** - * @return array - */ - private function formatExceptionFragment(Throwable $exception): array - { - /** @var int|string $code */ - $code = $exception->getCode(); - return [ - 'type' => get_class($exception), - 'code' => $code, - 'message' => $exception->getMessage(), - 'file' => $exception->getFile(), - 'line' => $exception->getLine(), - ]; - } -} diff --git a/system/vendor/slim/slim/Slim/Error/Renderers/PlainTextErrorRenderer.php b/system/vendor/slim/slim/Slim/Error/Renderers/PlainTextErrorRenderer.php deleted file mode 100644 index 3d80c74..0000000 --- a/system/vendor/slim/slim/Slim/Error/Renderers/PlainTextErrorRenderer.php +++ /dev/null @@ -1,59 +0,0 @@ -getErrorTitle($exception)}\n"; - - if ($displayErrorDetails) { - $text .= $this->formatExceptionFragment($exception); - - while ($exception = $exception->getPrevious()) { - $text .= "\nPrevious Error:\n"; - $text .= $this->formatExceptionFragment($exception); - } - } - - return $text; - } - - private function formatExceptionFragment(Throwable $exception): string - { - $text = sprintf("Type: %s\n", get_class($exception)); - - $code = $exception->getCode(); - /** @var int|string $code */ - $text .= sprintf("Code: %s\n", $code); - - $text .= sprintf("Message: %s\n", htmlentities($exception->getMessage())); - - $text .= sprintf("File: %s\n", $exception->getFile()); - - $text .= sprintf("Line: %s\n", $exception->getLine()); - - $text .= sprintf('Trace: %s', $exception->getTraceAsString()); - - return $text; - } -} diff --git a/system/vendor/slim/slim/Slim/Error/Renderers/XmlErrorRenderer.php b/system/vendor/slim/slim/Slim/Error/Renderers/XmlErrorRenderer.php deleted file mode 100644 index 1171b79..0000000 --- a/system/vendor/slim/slim/Slim/Error/Renderers/XmlErrorRenderer.php +++ /dev/null @@ -1,54 +0,0 @@ -\n"; - $xml .= "\n " . $this->createCdataSection($this->getErrorTitle($exception)) . "\n"; - - if ($displayErrorDetails) { - do { - $xml .= " \n"; - $xml .= ' ' . get_class($exception) . "\n"; - $xml .= ' ' . $exception->getCode() . "\n"; - $xml .= ' ' . $this->createCdataSection($exception->getMessage()) . "\n"; - $xml .= ' ' . $exception->getFile() . "\n"; - $xml .= ' ' . $exception->getLine() . "\n"; - $xml .= " \n"; - } while ($exception = $exception->getPrevious()); - } - - $xml .= ''; - - return $xml; - } - - /** - * Returns a CDATA section with the given content. - */ - private function createCdataSection(string $content): string - { - return sprintf('', str_replace(']]>', ']]]]>', $content)); - } -} diff --git a/system/vendor/slim/slim/Slim/Exception/HttpBadRequestException.php b/system/vendor/slim/slim/Slim/Exception/HttpBadRequestException.php deleted file mode 100644 index 9be551c..0000000 --- a/system/vendor/slim/slim/Slim/Exception/HttpBadRequestException.php +++ /dev/null @@ -1,28 +0,0 @@ -request = $request; - } - - public function getRequest(): ServerRequestInterface - { - return $this->request; - } - - public function getTitle(): string - { - return $this->title; - } - - public function setTitle(string $title): self - { - $this->title = $title; - return $this; - } - - public function getDescription(): string - { - return $this->description; - } - - public function setDescription(string $description): self - { - $this->description = $description; - return $this; - } -} diff --git a/system/vendor/slim/slim/Slim/Exception/HttpForbiddenException.php b/system/vendor/slim/slim/Slim/Exception/HttpForbiddenException.php deleted file mode 100644 index dd3bb23..0000000 --- a/system/vendor/slim/slim/Slim/Exception/HttpForbiddenException.php +++ /dev/null @@ -1,27 +0,0 @@ -allowedMethods; - } - - /** - * @param string[] $methods - */ - public function setAllowedMethods(array $methods): self - { - $this->allowedMethods = $methods; - $this->message = 'Method not allowed. Must be one of: ' . implode(', ', $methods); - return $this; - } -} diff --git a/system/vendor/slim/slim/Slim/Exception/HttpNotFoundException.php b/system/vendor/slim/slim/Slim/Exception/HttpNotFoundException.php deleted file mode 100644 index 865146d..0000000 --- a/system/vendor/slim/slim/Slim/Exception/HttpNotFoundException.php +++ /dev/null @@ -1,27 +0,0 @@ -message = $message; - } - - parent::__construct($request, $this->message, $this->code, $previous); - } -} diff --git a/system/vendor/slim/slim/Slim/Exception/HttpUnauthorizedException.php b/system/vendor/slim/slim/Slim/Exception/HttpUnauthorizedException.php deleted file mode 100644 index 07bd70d..0000000 --- a/system/vendor/slim/slim/Slim/Exception/HttpUnauthorizedException.php +++ /dev/null @@ -1,27 +0,0 @@ -has(ResponseFactoryInterface::class) - && ( - $responseFactoryFromContainer = $container->get(ResponseFactoryInterface::class) - ) instanceof ResponseFactoryInterface - ? $responseFactoryFromContainer - : self::determineResponseFactory(); - - $callableResolver = $container->has(CallableResolverInterface::class) - && ( - $callableResolverFromContainer = $container->get(CallableResolverInterface::class) - ) instanceof CallableResolverInterface - ? $callableResolverFromContainer - : null; - - $routeCollector = $container->has(RouteCollectorInterface::class) - && ( - $routeCollectorFromContainer = $container->get(RouteCollectorInterface::class) - ) instanceof RouteCollectorInterface - ? $routeCollectorFromContainer - : null; - - $routeResolver = $container->has(RouteResolverInterface::class) - && ( - $routeResolverFromContainer = $container->get(RouteResolverInterface::class) - ) instanceof RouteResolverInterface - ? $routeResolverFromContainer - : null; - - $middlewareDispatcher = $container->has(MiddlewareDispatcherInterface::class) - && ( - $middlewareDispatcherFromContainer = $container->get(MiddlewareDispatcherInterface::class) - ) instanceof MiddlewareDispatcherInterface - ? $middlewareDispatcherFromContainer - : null; - - return new App( - $responseFactory, - $container, - $callableResolver, - $routeCollector, - $routeResolver, - $middlewareDispatcher - ); - } - - /** - * @throws RuntimeException - */ - public static function determineResponseFactory(): ResponseFactoryInterface - { - if (static::$responseFactory) { - if (static::$streamFactory) { - return static::attemptResponseFactoryDecoration(static::$responseFactory, static::$streamFactory); - } - return static::$responseFactory; - } - - $psr17FactoryProvider = static::$psr17FactoryProvider ?? new Psr17FactoryProvider(); - - /** @var Psr17Factory $psr17factory */ - foreach ($psr17FactoryProvider->getFactories() as $psr17factory) { - if ($psr17factory::isResponseFactoryAvailable()) { - $responseFactory = $psr17factory::getResponseFactory(); - - if (static::$streamFactory || $psr17factory::isStreamFactoryAvailable()) { - $streamFactory = static::$streamFactory ?? $psr17factory::getStreamFactory(); - return static::attemptResponseFactoryDecoration($responseFactory, $streamFactory); - } - - return $responseFactory; - } - } - - throw new RuntimeException( - "Could not detect any PSR-17 ResponseFactory implementations. " . - "Please install a supported implementation in order to use `AppFactory::create()`. " . - "See https://github.com/slimphp/Slim/blob/4.x/README.md for a list of supported implementations." - ); - } - - protected static function attemptResponseFactoryDecoration( - ResponseFactoryInterface $responseFactory, - StreamFactoryInterface $streamFactory - ): ResponseFactoryInterface { - if ( - static::$slimHttpDecoratorsAutomaticDetectionEnabled - && SlimHttpPsr17Factory::isResponseFactoryAvailable() - ) { - return SlimHttpPsr17Factory::createDecoratedResponseFactory($responseFactory, $streamFactory); - } - - return $responseFactory; - } - - public static function setPsr17FactoryProvider(Psr17FactoryProviderInterface $psr17FactoryProvider): void - { - static::$psr17FactoryProvider = $psr17FactoryProvider; - } - - public static function setResponseFactory(ResponseFactoryInterface $responseFactory): void - { - static::$responseFactory = $responseFactory; - } - - public static function setStreamFactory(StreamFactoryInterface $streamFactory): void - { - static::$streamFactory = $streamFactory; - } - - public static function setContainer(ContainerInterface $container): void - { - static::$container = $container; - } - - public static function setCallableResolver(CallableResolverInterface $callableResolver): void - { - static::$callableResolver = $callableResolver; - } - - public static function setRouteCollector(RouteCollectorInterface $routeCollector): void - { - static::$routeCollector = $routeCollector; - } - - public static function setRouteResolver(RouteResolverInterface $routeResolver): void - { - static::$routeResolver = $routeResolver; - } - - public static function setMiddlewareDispatcher(MiddlewareDispatcherInterface $middlewareDispatcher): void - { - static::$middlewareDispatcher = $middlewareDispatcher; - } - - public static function setSlimHttpDecoratorsAutomaticDetection(bool $enabled): void - { - static::$slimHttpDecoratorsAutomaticDetectionEnabled = $enabled; - } -} diff --git a/system/vendor/slim/slim/Slim/Factory/Psr17/GuzzlePsr17Factory.php b/system/vendor/slim/slim/Slim/Factory/Psr17/GuzzlePsr17Factory.php deleted file mode 100644 index 32a548a..0000000 --- a/system/vendor/slim/slim/Slim/Factory/Psr17/GuzzlePsr17Factory.php +++ /dev/null @@ -1,19 +0,0 @@ -serverRequestCreator = $serverRequestCreator; - $this->serverRequestCreatorMethod = $serverRequestCreatorMethod; - } - - /** - * {@inheritdoc} - */ - public function createServerRequestFromGlobals(): ServerRequestInterface - { - /** @var callable $callable */ - $callable = [$this->serverRequestCreator, $this->serverRequestCreatorMethod]; - return (Closure::fromCallable($callable))(); - } -} diff --git a/system/vendor/slim/slim/Slim/Factory/Psr17/SlimHttpPsr17Factory.php b/system/vendor/slim/slim/Slim/Factory/Psr17/SlimHttpPsr17Factory.php deleted file mode 100644 index 5d63631..0000000 --- a/system/vendor/slim/slim/Slim/Factory/Psr17/SlimHttpPsr17Factory.php +++ /dev/null @@ -1,39 +0,0 @@ -serverRequestCreator = $serverRequestCreator; - } - - /** - * {@inheritdoc} - */ - public function createServerRequestFromGlobals(): ServerRequestInterface - { - if (!static::isServerRequestDecoratorAvailable()) { - throw new RuntimeException('The Slim-Http ServerRequest decorator is not available.'); - } - - $request = $this->serverRequestCreator->createServerRequestFromGlobals(); - - if ( - !(( - $decoratedServerRequest = new static::$serverRequestDecoratorClass($request) - ) instanceof ServerRequestInterface) - ) { - throw new RuntimeException(get_called_class() . ' could not instantiate a decorated server request.'); - } - - return $decoratedServerRequest; - } - - public static function isServerRequestDecoratorAvailable(): bool - { - return class_exists(static::$serverRequestDecoratorClass); - } -} diff --git a/system/vendor/slim/slim/Slim/Factory/Psr17/SlimPsr17Factory.php b/system/vendor/slim/slim/Slim/Factory/Psr17/SlimPsr17Factory.php deleted file mode 100644 index 46c46f9..0000000 --- a/system/vendor/slim/slim/Slim/Factory/Psr17/SlimPsr17Factory.php +++ /dev/null @@ -1,19 +0,0 @@ -getFactories() as $psr17Factory) { - if ($psr17Factory::isServerRequestCreatorAvailable()) { - $serverRequestCreator = $psr17Factory::getServerRequestCreator(); - return static::attemptServerRequestCreatorDecoration($serverRequestCreator); - } - } - - throw new RuntimeException( - "Could not detect any ServerRequest creator implementations. " . - "Please install a supported implementation in order to use `App::run()` " . - "without having to pass in a `ServerRequest` object. " . - "See https://github.com/slimphp/Slim/blob/4.x/README.md for a list of supported implementations." - ); - } - - protected static function attemptServerRequestCreatorDecoration( - ServerRequestCreatorInterface $serverRequestCreator - ): ServerRequestCreatorInterface { - if ( - static::$slimHttpDecoratorsAutomaticDetectionEnabled - && SlimHttpServerRequestCreator::isServerRequestDecoratorAvailable() - ) { - return new SlimHttpServerRequestCreator($serverRequestCreator); - } - - return $serverRequestCreator; - } - - public static function setPsr17FactoryProvider(Psr17FactoryProviderInterface $psr17FactoryProvider): void - { - static::$psr17FactoryProvider = $psr17FactoryProvider; - } - - public static function setServerRequestCreator(ServerRequestCreatorInterface $serverRequestCreator): void - { - self::$serverRequestCreator = $serverRequestCreator; - } - - public static function setSlimHttpDecoratorsAutomaticDetection(bool $enabled): void - { - static::$slimHttpDecoratorsAutomaticDetectionEnabled = $enabled; - } -} diff --git a/system/vendor/slim/slim/Slim/Handlers/ErrorHandler.php b/system/vendor/slim/slim/Slim/Handlers/ErrorHandler.php deleted file mode 100644 index f9606e3..0000000 --- a/system/vendor/slim/slim/Slim/Handlers/ErrorHandler.php +++ /dev/null @@ -1,308 +0,0 @@ - - */ - protected array $errorRenderers = [ - 'application/json' => JsonErrorRenderer::class, - 'application/xml' => XmlErrorRenderer::class, - 'text/xml' => XmlErrorRenderer::class, - 'text/html' => HtmlErrorRenderer::class, - 'text/plain' => PlainTextErrorRenderer::class, - ]; - - protected bool $displayErrorDetails = false; - - protected bool $logErrors; - - protected bool $logErrorDetails = false; - - protected ?string $contentType = null; - - protected ?string $method = null; - - protected ServerRequestInterface $request; - - protected Throwable $exception; - - protected int $statusCode; - - protected CallableResolverInterface $callableResolver; - - protected ResponseFactoryInterface $responseFactory; - - protected LoggerInterface $logger; - - public function __construct( - CallableResolverInterface $callableResolver, - ResponseFactoryInterface $responseFactory, - ?LoggerInterface $logger = null - ) { - $this->callableResolver = $callableResolver; - $this->responseFactory = $responseFactory; - $this->logger = $logger ?: $this->getDefaultLogger(); - } - - /** - * Invoke error handler - * - * @param ServerRequestInterface $request The most recent Request object - * @param Throwable $exception The caught Exception object - * @param bool $displayErrorDetails Whether or not to display the error details - * @param bool $logErrors Whether or not to log errors - * @param bool $logErrorDetails Whether or not to log error details - */ - public function __invoke( - ServerRequestInterface $request, - Throwable $exception, - bool $displayErrorDetails, - bool $logErrors, - bool $logErrorDetails - ): ResponseInterface { - $this->displayErrorDetails = $displayErrorDetails; - $this->logErrors = $logErrors; - $this->logErrorDetails = $logErrorDetails; - $this->request = $request; - $this->exception = $exception; - $this->method = $request->getMethod(); - $this->statusCode = $this->determineStatusCode(); - if ($this->contentType === null) { - $this->contentType = $this->determineContentType($request); - } - - if ($logErrors) { - $this->writeToErrorLog(); - } - - return $this->respond(); - } - - /** - * Force the content type for all error handler responses. - * - * @param string|null $contentType The content type - */ - public function forceContentType(?string $contentType): void - { - $this->contentType = $contentType; - } - - protected function determineStatusCode(): int - { - if ($this->method === 'OPTIONS') { - return 200; - } - - if ($this->exception instanceof HttpException) { - return $this->exception->getCode(); - } - - return 500; - } - - /** - * Determine which content type we know about is wanted using Accept header - * - * Note: This method is a bare-bones implementation designed specifically for - * Slim's error handling requirements. Consider a fully-feature solution such - * as willdurand/negotiation for any other situation. - */ - protected function determineContentType(ServerRequestInterface $request): ?string - { - $acceptHeader = $request->getHeaderLine('Accept'); - $selectedContentTypes = array_intersect( - explode(',', $acceptHeader), - array_keys($this->errorRenderers) - ); - $count = count($selectedContentTypes); - - if ($count) { - $current = current($selectedContentTypes); - - /** - * Ensure other supported content types take precedence over text/plain - * when multiple content types are provided via Accept header. - */ - if ($current === 'text/plain' && $count > 1) { - $next = next($selectedContentTypes); - if (is_string($next)) { - return $next; - } - } - - if (is_string($current)) { - return $current; - } - } - - if (preg_match('/\+(json|xml)/', $acceptHeader, $matches)) { - $mediaType = 'application/' . $matches[1]; - if (array_key_exists($mediaType, $this->errorRenderers)) { - return $mediaType; - } - } - - return null; - } - - /** - * Determine which renderer to use based on content type - * - * @throws RuntimeException - */ - protected function determineRenderer(): callable - { - if ($this->contentType !== null && array_key_exists($this->contentType, $this->errorRenderers)) { - $renderer = $this->errorRenderers[$this->contentType]; - } else { - $renderer = $this->defaultErrorRenderer; - } - - return $this->callableResolver->resolve($renderer); - } - - /** - * Register an error renderer for a specific content-type - * - * @param string $contentType The content-type this renderer should be registered to - * @param ErrorRendererInterface|string|callable $errorRenderer The error renderer - */ - public function registerErrorRenderer(string $contentType, $errorRenderer): void - { - $this->errorRenderers[$contentType] = $errorRenderer; - } - - /** - * Set the default error renderer - * - * @param string $contentType The content type of the default error renderer - * @param ErrorRendererInterface|string|callable $errorRenderer The default error renderer - */ - public function setDefaultErrorRenderer(string $contentType, $errorRenderer): void - { - $this->defaultErrorRendererContentType = $contentType; - $this->defaultErrorRenderer = $errorRenderer; - } - - /** - * Set the renderer for the error logger - * - * @param ErrorRendererInterface|string|callable $logErrorRenderer - */ - public function setLogErrorRenderer($logErrorRenderer): void - { - $this->logErrorRenderer = $logErrorRenderer; - } - - /** - * Write to the error log if $logErrors has been set to true - */ - protected function writeToErrorLog(): void - { - $renderer = $this->callableResolver->resolve($this->logErrorRenderer); - $error = $renderer($this->exception, $this->logErrorDetails); - if (!$this->displayErrorDetails) { - $error .= "\nTips: To display error details in HTTP response "; - $error .= 'set "displayErrorDetails" to true in the ErrorHandler constructor.'; - } - $this->logError($error); - } - - /** - * Wraps the error_log function so that this can be easily tested - */ - protected function logError(string $error): void - { - $this->logger->error($error); - } - - /** - * Returns a default logger implementation. - */ - protected function getDefaultLogger(): LoggerInterface - { - return new Logger(); - } - - protected function respond(): ResponseInterface - { - $response = $this->responseFactory->createResponse($this->statusCode); - if ($this->contentType !== null && array_key_exists($this->contentType, $this->errorRenderers)) { - $response = $response->withHeader('Content-type', $this->contentType); - } else { - $response = $response->withHeader('Content-type', $this->defaultErrorRendererContentType); - } - - if ($this->exception instanceof HttpMethodNotAllowedException) { - $allowedMethods = implode(', ', $this->exception->getAllowedMethods()); - $response = $response->withHeader('Allow', $allowedMethods); - } - - $renderer = $this->determineRenderer(); - $body = call_user_func($renderer, $this->exception, $this->displayErrorDetails); - if ($body !== false) { - /** @var string $body */ - $response->getBody()->write($body); - } - - return $response; - } -} diff --git a/system/vendor/slim/slim/Slim/Handlers/Strategies/RequestHandler.php b/system/vendor/slim/slim/Slim/Handlers/Strategies/RequestHandler.php deleted file mode 100644 index ea88a5f..0000000 --- a/system/vendor/slim/slim/Slim/Handlers/Strategies/RequestHandler.php +++ /dev/null @@ -1,48 +0,0 @@ -appendRouteArgumentsToRequestAttributes = $appendRouteArgumentsToRequestAttributes; - } - - /** - * Invoke a route callable that implements RequestHandlerInterface - * - * @param array $routeArguments - */ - public function __invoke( - callable $callable, - ServerRequestInterface $request, - ResponseInterface $response, - array $routeArguments - ): ResponseInterface { - if ($this->appendRouteArgumentsToRequestAttributes) { - foreach ($routeArguments as $k => $v) { - $request = $request->withAttribute($k, $v); - } - } - - return $callable($request); - } -} diff --git a/system/vendor/slim/slim/Slim/Handlers/Strategies/RequestResponse.php b/system/vendor/slim/slim/Slim/Handlers/Strategies/RequestResponse.php deleted file mode 100644 index 45b2c05..0000000 --- a/system/vendor/slim/slim/Slim/Handlers/Strategies/RequestResponse.php +++ /dev/null @@ -1,40 +0,0 @@ - $routeArguments - */ - public function __invoke( - callable $callable, - ServerRequestInterface $request, - ResponseInterface $response, - array $routeArguments - ): ResponseInterface { - foreach ($routeArguments as $k => $v) { - $request = $request->withAttribute($k, $v); - } - - return $callable($request, $response, $routeArguments); - } -} diff --git a/system/vendor/slim/slim/Slim/Handlers/Strategies/RequestResponseArgs.php b/system/vendor/slim/slim/Slim/Handlers/Strategies/RequestResponseArgs.php deleted file mode 100644 index c4ab16d..0000000 --- a/system/vendor/slim/slim/Slim/Handlers/Strategies/RequestResponseArgs.php +++ /dev/null @@ -1,38 +0,0 @@ - $routeArguments - */ - public function __invoke( - callable $callable, - ServerRequestInterface $request, - ResponseInterface $response, - array $routeArguments - ): ResponseInterface { - return $callable($request, $response, ...array_values($routeArguments)); - } -} diff --git a/system/vendor/slim/slim/Slim/Handlers/Strategies/RequestResponseNamedArgs.php b/system/vendor/slim/slim/Slim/Handlers/Strategies/RequestResponseNamedArgs.php deleted file mode 100644 index 651111d..0000000 --- a/system/vendor/slim/slim/Slim/Handlers/Strategies/RequestResponseNamedArgs.php +++ /dev/null @@ -1,44 +0,0 @@ -= 8.0.0'); - } - } - - /** - * Invoke a route callable with request, response and all route parameters - * as individual arguments. - * - * @param array $routeArguments - */ - public function __invoke( - callable $callable, - ServerRequestInterface $request, - ResponseInterface $response, - array $routeArguments - ): ResponseInterface { - return $callable($request, $response, ...$routeArguments); - } -} diff --git a/system/vendor/slim/slim/Slim/Interfaces/AdvancedCallableResolverInterface.php b/system/vendor/slim/slim/Slim/Interfaces/AdvancedCallableResolverInterface.php deleted file mode 100644 index aa1d897..0000000 --- a/system/vendor/slim/slim/Slim/Interfaces/AdvancedCallableResolverInterface.php +++ /dev/null @@ -1,28 +0,0 @@ - $routeArguments The route's placeholder arguments - * - * @return ResponseInterface The response from the callable. - */ - public function __invoke( - callable $callable, - ServerRequestInterface $request, - ResponseInterface $response, - array $routeArguments - ): ResponseInterface; -} diff --git a/system/vendor/slim/slim/Slim/Interfaces/MiddlewareDispatcherInterface.php b/system/vendor/slim/slim/Slim/Interfaces/MiddlewareDispatcherInterface.php deleted file mode 100644 index aa7a26a..0000000 --- a/system/vendor/slim/slim/Slim/Interfaces/MiddlewareDispatcherInterface.php +++ /dev/null @@ -1,42 +0,0 @@ - - */ - public function getArguments(): array; - - /** - * Set a route argument - */ - public function setArgument(string $name, string $value): RouteInterface; - - /** - * Replace route arguments - * - * @param array $arguments - */ - public function setArguments(array $arguments): self; - - /** - * @param MiddlewareInterface|string|callable $middleware - */ - public function add($middleware): self; - - public function addMiddleware(MiddlewareInterface $middleware): self; - - /** - * Prepare the route for use - * - * @param array $arguments - */ - public function prepare(array $arguments): self; - - /** - * Run route - * - * This method traverses the middleware stack, including the route's callable - * and captures the resultant HTTP response object. It then sends the response - * back to the Application. - */ - public function run(ServerRequestInterface $request): ResponseInterface; -} diff --git a/system/vendor/slim/slim/Slim/Interfaces/RouteParserInterface.php b/system/vendor/slim/slim/Slim/Interfaces/RouteParserInterface.php deleted file mode 100644 index 03d9326..0000000 --- a/system/vendor/slim/slim/Slim/Interfaces/RouteParserInterface.php +++ /dev/null @@ -1,52 +0,0 @@ - $data Named argument replacement data - * @param array $queryParams Optional query string parameters - * - * @throws RuntimeException If named route does not exist - * @throws InvalidArgumentException If required data not provided - */ - public function relativeUrlFor(string $routeName, array $data = [], array $queryParams = []): string; - - /** - * Build the path for a named route including the base path - * - * @param string $routeName Route name - * @param array $data Named argument replacement data - * @param array $queryParams Optional query string parameters - * - * @throws RuntimeException If named route does not exist - * @throws InvalidArgumentException If required data not provided - */ - public function urlFor(string $routeName, array $data = [], array $queryParams = []): string; - - /** - * Get fully qualified URL for named route - * - * @param UriInterface $uri - * @param string $routeName Route name - * @param array $data Named argument replacement data - * @param array $queryParams Optional query string parameters - */ - public function fullUrlFor(UriInterface $uri, string $routeName, array $data = [], array $queryParams = []): string; -} diff --git a/system/vendor/slim/slim/Slim/Interfaces/RouteResolverInterface.php b/system/vendor/slim/slim/Slim/Interfaces/RouteResolverInterface.php deleted file mode 100644 index 256a359..0000000 --- a/system/vendor/slim/slim/Slim/Interfaces/RouteResolverInterface.php +++ /dev/null @@ -1,17 +0,0 @@ -getPath() - */ - public function computeRoutingResults(string $uri, string $method): RoutingResults; - - public function resolveRoute(string $identifier): RouteInterface; -} diff --git a/system/vendor/slim/slim/Slim/Interfaces/ServerRequestCreatorInterface.php b/system/vendor/slim/slim/Slim/Interfaces/ServerRequestCreatorInterface.php deleted file mode 100644 index 54d231e..0000000 --- a/system/vendor/slim/slim/Slim/Interfaces/ServerRequestCreatorInterface.php +++ /dev/null @@ -1,18 +0,0 @@ - $context - * - * @throws InvalidArgumentException - */ - public function log($level, $message, array $context = []): void - { - error_log((string) $message); - } -} diff --git a/system/vendor/slim/slim/Slim/Middleware/BodyParsingMiddleware.php b/system/vendor/slim/slim/Slim/Middleware/BodyParsingMiddleware.php deleted file mode 100644 index 9a90f30..0000000 --- a/system/vendor/slim/slim/Slim/Middleware/BodyParsingMiddleware.php +++ /dev/null @@ -1,196 +0,0 @@ - callable - */ - public function __construct(array $bodyParsers = []) - { - $this->registerDefaultBodyParsers(); - - foreach ($bodyParsers as $mediaType => $parser) { - $this->registerBodyParser($mediaType, $parser); - } - } - - public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface - { - $parsedBody = $request->getParsedBody(); - - if (empty($parsedBody)) { - $parsedBody = $this->parseBody($request); - $request = $request->withParsedBody($parsedBody); - } - - return $handler->handle($request); - } - - /** - * @param string $mediaType A HTTP media type (excluding content-type params). - * @param callable $callable A callable that returns parsed contents for media type. - */ - public function registerBodyParser(string $mediaType, callable $callable): self - { - $this->bodyParsers[$mediaType] = $callable; - return $this; - } - - /** - * @param string $mediaType A HTTP media type (excluding content-type params). - */ - public function hasBodyParser(string $mediaType): bool - { - return isset($this->bodyParsers[$mediaType]); - } - - /** - * @param string $mediaType A HTTP media type (excluding content-type params). - * @throws RuntimeException - */ - public function getBodyParser(string $mediaType): callable - { - if (!isset($this->bodyParsers[$mediaType])) { - throw new RuntimeException('No parser for type ' . $mediaType); - } - return $this->bodyParsers[$mediaType]; - } - - protected function registerDefaultBodyParsers(): void - { - $this->registerBodyParser('application/json', static function ($input) { - $result = json_decode($input, true); - - if (!is_array($result)) { - return null; - } - - return $result; - }); - - $this->registerBodyParser('application/x-www-form-urlencoded', static function ($input) { - parse_str($input, $data); - return $data; - }); - - $xmlCallable = static function ($input) { - $backup = self::disableXmlEntityLoader(true); - $backup_errors = libxml_use_internal_errors(true); - $result = simplexml_load_string($input); - - self::disableXmlEntityLoader($backup); - libxml_clear_errors(); - libxml_use_internal_errors($backup_errors); - - if ($result === false) { - return null; - } - - return $result; - }; - - $this->registerBodyParser('application/xml', $xmlCallable); - $this->registerBodyParser('text/xml', $xmlCallable); - } - - /** - * @return null|array|object - */ - protected function parseBody(ServerRequestInterface $request) - { - $mediaType = $this->getMediaType($request); - if ($mediaType === null) { - return null; - } - - // Check if this specific media type has a parser registered first - if (!isset($this->bodyParsers[$mediaType])) { - // If not, look for a media type with a structured syntax suffix (RFC 6839) - $parts = explode('+', $mediaType); - if (count($parts) >= 2) { - $mediaType = 'application/' . $parts[count($parts) - 1]; - } - } - - if (isset($this->bodyParsers[$mediaType])) { - $body = (string)$request->getBody(); - $parsed = $this->bodyParsers[$mediaType]($body); - - if ($parsed !== null && !is_object($parsed) && !is_array($parsed)) { - throw new RuntimeException( - 'Request body media type parser return value must be an array, an object, or null' - ); - } - - return $parsed; - } - - return null; - } - - /** - * @return string|null The serverRequest media type, minus content-type params - */ - protected function getMediaType(ServerRequestInterface $request): ?string - { - $contentType = $request->getHeader('Content-Type')[0] ?? null; - - if (is_string($contentType) && trim($contentType) !== '') { - $contentTypeParts = explode(';', $contentType); - return strtolower(trim($contentTypeParts[0])); - } - - return null; - } - - protected static function disableXmlEntityLoader(bool $disable): bool - { - if (LIBXML_VERSION >= 20900) { - // libxml >= 2.9.0 disables entity loading by default, so it is - // safe to skip the real call (deprecated in PHP 8). - return true; - } - - // @codeCoverageIgnoreStart - return libxml_disable_entity_loader($disable); - // @codeCoverageIgnoreEnd - } -} diff --git a/system/vendor/slim/slim/Slim/Middleware/ContentLengthMiddleware.php b/system/vendor/slim/slim/Slim/Middleware/ContentLengthMiddleware.php deleted file mode 100644 index 8fa13bc..0000000 --- a/system/vendor/slim/slim/Slim/Middleware/ContentLengthMiddleware.php +++ /dev/null @@ -1,32 +0,0 @@ -handle($request); - - // Add Content-Length header if not already added - $size = $response->getBody()->getSize(); - if ($size !== null && !$response->hasHeader('Content-Length')) { - $response = $response->withHeader('Content-Length', (string) $size); - } - - return $response; - } -} diff --git a/system/vendor/slim/slim/Slim/Middleware/ErrorMiddleware.php b/system/vendor/slim/slim/Slim/Middleware/ErrorMiddleware.php deleted file mode 100644 index 2eb5cc9..0000000 --- a/system/vendor/slim/slim/Slim/Middleware/ErrorMiddleware.php +++ /dev/null @@ -1,212 +0,0 @@ -callableResolver = $callableResolver; - $this->responseFactory = $responseFactory; - $this->displayErrorDetails = $displayErrorDetails; - $this->logErrors = $logErrors; - $this->logErrorDetails = $logErrorDetails; - $this->logger = $logger; - } - - public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface - { - try { - return $handler->handle($request); - } catch (Throwable $e) { - return $this->handleException($request, $e); - } - } - - public function handleException(ServerRequestInterface $request, Throwable $exception): ResponseInterface - { - if ($exception instanceof HttpException) { - $request = $exception->getRequest(); - } - - $exceptionType = get_class($exception); - $handler = $this->getErrorHandler($exceptionType); - - return $handler($request, $exception, $this->displayErrorDetails, $this->logErrors, $this->logErrorDetails); - } - - /** - * Get callable to handle scenarios where an error - * occurs when processing the current request. - * - * @param string $type Exception/Throwable name. ie: RuntimeException::class - * @return callable|ErrorHandler - */ - public function getErrorHandler(string $type) - { - if (isset($this->handlers[$type])) { - return $this->callableResolver->resolve($this->handlers[$type]); - } - - if (isset($this->subClassHandlers[$type])) { - return $this->callableResolver->resolve($this->subClassHandlers[$type]); - } - - foreach ($this->subClassHandlers as $class => $handler) { - if (is_subclass_of($type, $class)) { - return $this->callableResolver->resolve($handler); - } - } - - return $this->getDefaultErrorHandler(); - } - - /** - * Get default error handler - * - * @return ErrorHandler|callable - */ - public function getDefaultErrorHandler() - { - if ($this->defaultErrorHandler === null) { - $this->defaultErrorHandler = new ErrorHandler( - $this->callableResolver, - $this->responseFactory, - $this->logger - ); - } - - return $this->callableResolver->resolve($this->defaultErrorHandler); - } - - /** - * Set callable as the default Slim application error handler. - * - * The callable signature MUST match the ErrorHandlerInterface - * - * @see \Slim\Interfaces\ErrorHandlerInterface - * - * 1. Instance of \Psr\Http\Message\ServerRequestInterface - * 2. Instance of \Throwable - * 3. Boolean $displayErrorDetails - * 4. Boolean $logErrors - * 5. Boolean $logErrorDetails - * - * The callable MUST return an instance of - * \Psr\Http\Message\ResponseInterface. - * - * @param string|callable|ErrorHandler $handler - */ - public function setDefaultErrorHandler($handler): self - { - $this->defaultErrorHandler = $handler; - return $this; - } - - /** - * Set callable to handle scenarios where an error - * occurs when processing the current request. - * - * The callable signature MUST match the ErrorHandlerInterface - * - * Pass true to $handleSubclasses to make the handler handle all subclasses of - * the type as well. Pass an array of classes to make the same function handle multiple exceptions. - * - * @see \Slim\Interfaces\ErrorHandlerInterface - * - * 1. Instance of \Psr\Http\Message\ServerRequestInterface - * 2. Instance of \Throwable - * 3. Boolean $displayErrorDetails - * 4. Boolean $logErrors - * 5. Boolean $logErrorDetails - * - * The callable MUST return an instance of - * \Psr\Http\Message\ResponseInterface. - * - * @param string|string[] $typeOrTypes Exception/Throwable name. - * ie: RuntimeException::class or an array of classes - * ie: [HttpNotFoundException::class, HttpMethodNotAllowedException::class] - * @param string|callable|ErrorHandlerInterface $handler - */ - public function setErrorHandler($typeOrTypes, $handler, bool $handleSubclasses = false): self - { - if (is_array($typeOrTypes)) { - foreach ($typeOrTypes as $type) { - $this->addErrorHandler($type, $handler, $handleSubclasses); - } - } else { - $this->addErrorHandler($typeOrTypes, $handler, $handleSubclasses); - } - - return $this; - } - - /** - * Used internally to avoid code repetition when passing multiple exceptions to setErrorHandler(). - * @param string|callable|ErrorHandlerInterface $handler - */ - private function addErrorHandler(string $type, $handler, bool $handleSubclasses): void - { - if ($handleSubclasses) { - $this->subClassHandlers[$type] = $handler; - } else { - $this->handlers[$type] = $handler; - } - } -} diff --git a/system/vendor/slim/slim/Slim/Middleware/MethodOverrideMiddleware.php b/system/vendor/slim/slim/Slim/Middleware/MethodOverrideMiddleware.php deleted file mode 100644 index 079a1f1..0000000 --- a/system/vendor/slim/slim/Slim/Middleware/MethodOverrideMiddleware.php +++ /dev/null @@ -1,43 +0,0 @@ -getHeaderLine('X-Http-Method-Override'); - - if ($methodHeader) { - $request = $request->withMethod($methodHeader); - } elseif (strtoupper($request->getMethod()) === 'POST') { - $body = $request->getParsedBody(); - - if (is_array($body) && !empty($body['_METHOD'])) { - $request = $request->withMethod($body['_METHOD']); - } - - if ($request->getBody()->eof()) { - $request->getBody()->rewind(); - } - } - - return $handler->handle($request); - } -} diff --git a/system/vendor/slim/slim/Slim/Middleware/OutputBufferingMiddleware.php b/system/vendor/slim/slim/Slim/Middleware/OutputBufferingMiddleware.php deleted file mode 100644 index 69ee1f6..0000000 --- a/system/vendor/slim/slim/Slim/Middleware/OutputBufferingMiddleware.php +++ /dev/null @@ -1,74 +0,0 @@ -streamFactory = $streamFactory; - $this->style = $style; - - if (!in_array($style, [static::APPEND, static::PREPEND], true)) { - throw new InvalidArgumentException("Invalid style `{$style}`. Must be `append` or `prepend`"); - } - } - - /** - * @throws Throwable - */ - public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface - { - try { - ob_start(); - $response = $handler->handle($request); - $output = ob_get_clean(); - } catch (Throwable $e) { - ob_end_clean(); - throw $e; - } - - if (!empty($output)) { - if ($this->style === static::PREPEND) { - $body = $this->streamFactory->createStream(); - $body->write($output . $response->getBody()); - $response = $response->withBody($body); - } elseif ($this->style === static::APPEND && $response->getBody()->isWritable()) { - $response->getBody()->write($output); - } - } - - return $response; - } -} diff --git a/system/vendor/slim/slim/Slim/Middleware/RoutingMiddleware.php b/system/vendor/slim/slim/Slim/Middleware/RoutingMiddleware.php deleted file mode 100644 index a3d3085..0000000 --- a/system/vendor/slim/slim/Slim/Middleware/RoutingMiddleware.php +++ /dev/null @@ -1,98 +0,0 @@ -routeResolver = $routeResolver; - $this->routeParser = $routeParser; - } - - /** - * @throws HttpNotFoundException - * @throws HttpMethodNotAllowedException - * @throws RuntimeException - */ - public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface - { - $request = $this->performRouting($request); - return $handler->handle($request); - } - - /** - * Perform routing - * - * @param ServerRequestInterface $request PSR7 Server Request - * - * @throws HttpNotFoundException - * @throws HttpMethodNotAllowedException - * @throws RuntimeException - */ - public function performRouting(ServerRequestInterface $request): ServerRequestInterface - { - $request = $request->withAttribute(RouteContext::ROUTE_PARSER, $this->routeParser); - - $routingResults = $this->resolveRoutingResultsFromRequest($request); - $routeStatus = $routingResults->getRouteStatus(); - - $request = $request->withAttribute(RouteContext::ROUTING_RESULTS, $routingResults); - - switch ($routeStatus) { - case RoutingResults::FOUND: - $routeArguments = $routingResults->getRouteArguments(); - $routeIdentifier = $routingResults->getRouteIdentifier() ?? ''; - $route = $this->routeResolver - ->resolveRoute($routeIdentifier) - ->prepare($routeArguments); - return $request->withAttribute(RouteContext::ROUTE, $route); - - case RoutingResults::NOT_FOUND: - throw new HttpNotFoundException($request); - - case RoutingResults::METHOD_NOT_ALLOWED: - $exception = new HttpMethodNotAllowedException($request); - $exception->setAllowedMethods($routingResults->getAllowedMethods()); - throw $exception; - - default: - throw new RuntimeException('An unexpected error occurred while performing routing.'); - } - } - - /** - * Resolves the route from the given request - */ - protected function resolveRoutingResultsFromRequest(ServerRequestInterface $request): RoutingResults - { - return $this->routeResolver->computeRoutingResults( - $request->getUri()->getPath(), - $request->getMethod() - ); - } -} diff --git a/system/vendor/slim/slim/Slim/MiddlewareDispatcher.php b/system/vendor/slim/slim/Slim/MiddlewareDispatcher.php deleted file mode 100644 index 7e05644..0000000 --- a/system/vendor/slim/slim/Slim/MiddlewareDispatcher.php +++ /dev/null @@ -1,275 +0,0 @@ -seedMiddlewareStack($kernel); - $this->callableResolver = $callableResolver; - $this->container = $container; - } - - /** - * {@inheritdoc} - */ - public function seedMiddlewareStack(RequestHandlerInterface $kernel): void - { - $this->tip = $kernel; - } - - /** - * Invoke the middleware stack - */ - public function handle(ServerRequestInterface $request): ResponseInterface - { - return $this->tip->handle($request); - } - - /** - * Add a new middleware to the stack - * - * Middleware are organized as a stack. That means middleware - * that have been added before will be executed after the newly - * added one (last in, first out). - * - * @param MiddlewareInterface|string|callable $middleware - */ - public function add($middleware): MiddlewareDispatcherInterface - { - if ($middleware instanceof MiddlewareInterface) { - return $this->addMiddleware($middleware); - } - - if (is_string($middleware)) { - return $this->addDeferred($middleware); - } - - if (is_callable($middleware)) { - return $this->addCallable($middleware); - } - - /** @phpstan-ignore-next-line */ - throw new RuntimeException( - 'A middleware must be an object/class name referencing an implementation of ' . - 'MiddlewareInterface or a callable with a matching signature.' - ); - } - - /** - * Add a new middleware to the stack - * - * Middleware are organized as a stack. That means middleware - * that have been added before will be executed after the newly - * added one (last in, first out). - */ - public function addMiddleware(MiddlewareInterface $middleware): MiddlewareDispatcherInterface - { - $next = $this->tip; - $this->tip = new class ($middleware, $next) implements RequestHandlerInterface { - private MiddlewareInterface $middleware; - - private RequestHandlerInterface $next; - - public function __construct(MiddlewareInterface $middleware, RequestHandlerInterface $next) - { - $this->middleware = $middleware; - $this->next = $next; - } - - public function handle(ServerRequestInterface $request): ResponseInterface - { - return $this->middleware->process($request, $this->next); - } - }; - - return $this; - } - - /** - * Add a new middleware by class name - * - * Middleware are organized as a stack. That means middleware - * that have been added before will be executed after the newly - * added one (last in, first out). - */ - public function addDeferred(string $middleware): self - { - $next = $this->tip; - $this->tip = new class ( - $middleware, - $next, - $this->container, - $this->callableResolver - ) implements RequestHandlerInterface { - private string $middleware; - - private RequestHandlerInterface $next; - - private ?ContainerInterface $container; - - private ?CallableResolverInterface $callableResolver; - - public function __construct( - string $middleware, - RequestHandlerInterface $next, - ?ContainerInterface $container = null, - ?CallableResolverInterface $callableResolver = null - ) { - $this->middleware = $middleware; - $this->next = $next; - $this->container = $container; - $this->callableResolver = $callableResolver; - } - - public function handle(ServerRequestInterface $request): ResponseInterface - { - if ($this->callableResolver instanceof AdvancedCallableResolverInterface) { - $callable = $this->callableResolver->resolveMiddleware($this->middleware); - return $callable($request, $this->next); - } - - $callable = null; - - if ($this->callableResolver instanceof CallableResolverInterface) { - try { - $callable = $this->callableResolver->resolve($this->middleware); - } catch (RuntimeException $e) { - // Do Nothing - } - } - - if (!$callable) { - $resolved = $this->middleware; - $instance = null; - $method = null; - - // Check for Slim callable as `class:method` - if (preg_match(CallableResolver::$callablePattern, $resolved, $matches)) { - $resolved = $matches[1]; - $method = $matches[2]; - } - - if ($this->container && $this->container->has($resolved)) { - $instance = $this->container->get($resolved); - if ($instance instanceof MiddlewareInterface) { - return $instance->process($request, $this->next); - } - } elseif (!function_exists($resolved)) { - if (!class_exists($resolved)) { - throw new RuntimeException(sprintf('Middleware %s does not exist', $resolved)); - } - $instance = new $resolved($this->container); - } - - if ($instance && $instance instanceof MiddlewareInterface) { - return $instance->process($request, $this->next); - } - - $callable = $instance ?? $resolved; - if ($instance && $method) { - $callable = [$instance, $method]; - } - - if ($this->container && $callable instanceof Closure) { - $callable = $callable->bindTo($this->container); - } - } - - if (!is_callable($callable)) { - throw new RuntimeException( - sprintf( - 'Middleware %s is not resolvable', - $this->middleware - ) - ); - } - - return $callable($request, $this->next); - } - }; - - return $this; - } - - /** - * Add a (non-standard) callable middleware to the stack - * - * Middleware are organized as a stack. That means middleware - * that have been added before will be executed after the newly - * added one (last in, first out). - */ - public function addCallable(callable $middleware): self - { - $next = $this->tip; - - if ($this->container && $middleware instanceof Closure) { - /** @var Closure $middleware */ - $middleware = $middleware->bindTo($this->container); - } - - $this->tip = new class ($middleware, $next) implements RequestHandlerInterface { - /** - * @var callable - */ - private $middleware; - - /** - * @var RequestHandlerInterface - */ - private $next; - - public function __construct(callable $middleware, RequestHandlerInterface $next) - { - $this->middleware = $middleware; - $this->next = $next; - } - - public function handle(ServerRequestInterface $request): ResponseInterface - { - return ($this->middleware)($request, $this->next); - } - }; - - return $this; - } -} diff --git a/system/vendor/slim/slim/Slim/ResponseEmitter.php b/system/vendor/slim/slim/Slim/ResponseEmitter.php deleted file mode 100644 index fac36e9..0000000 --- a/system/vendor/slim/slim/Slim/ResponseEmitter.php +++ /dev/null @@ -1,136 +0,0 @@ -responseChunkSize = $responseChunkSize; - } - - /** - * Send the response the client - */ - public function emit(ResponseInterface $response): void - { - $isEmpty = $this->isResponseEmpty($response); - if (headers_sent() === false) { - $this->emitHeaders($response); - - // Set the status _after_ the headers, because of PHP's "helpful" behavior with location headers. - // See https://github.com/slimphp/Slim/issues/1730 - - $this->emitStatusLine($response); - } - - if (!$isEmpty) { - $this->emitBody($response); - } - } - - /** - * Emit Response Headers - */ - private function emitHeaders(ResponseInterface $response): void - { - foreach ($response->getHeaders() as $name => $values) { - $first = strtolower($name) !== 'set-cookie'; - foreach ($values as $value) { - $header = sprintf('%s: %s', $name, $value); - header($header, $first); - $first = false; - } - } - } - - /** - * Emit Status Line - */ - private function emitStatusLine(ResponseInterface $response): void - { - $statusLine = sprintf( - 'HTTP/%s %s %s', - $response->getProtocolVersion(), - $response->getStatusCode(), - $response->getReasonPhrase() - ); - header($statusLine, true, $response->getStatusCode()); - } - - /** - * Emit Body - */ - private function emitBody(ResponseInterface $response): void - { - $body = $response->getBody(); - if ($body->isSeekable()) { - $body->rewind(); - } - - $amountToRead = (int) $response->getHeaderLine('Content-Length'); - if (!$amountToRead) { - $amountToRead = $body->getSize(); - } - - if ($amountToRead) { - while ($amountToRead > 0 && !$body->eof()) { - $length = min($this->responseChunkSize, $amountToRead); - $data = $body->read($length); - echo $data; - - $amountToRead -= strlen($data); - - if (connection_status() !== CONNECTION_NORMAL) { - break; - } - } - } else { - while (!$body->eof()) { - echo $body->read($this->responseChunkSize); - if (connection_status() !== CONNECTION_NORMAL) { - break; - } - } - } - } - - /** - * Asserts response body is empty or status code is 204, 205 or 304 - */ - public function isResponseEmpty(ResponseInterface $response): bool - { - if (in_array($response->getStatusCode(), [204, 205, 304], true)) { - return true; - } - $stream = $response->getBody(); - $seekable = $stream->isSeekable(); - if ($seekable) { - $stream->rewind(); - } - return $seekable ? $stream->read(1) === '' : $stream->eof(); - } -} diff --git a/system/vendor/slim/slim/Slim/Routing/Dispatcher.php b/system/vendor/slim/slim/Slim/Routing/Dispatcher.php deleted file mode 100644 index e33eac3..0000000 --- a/system/vendor/slim/slim/Slim/Routing/Dispatcher.php +++ /dev/null @@ -1,78 +0,0 @@ -routeCollector = $routeCollector; - } - - protected function createDispatcher(): FastRouteDispatcher - { - if ($this->dispatcher) { - return $this->dispatcher; - } - - $routeDefinitionCallback = function (FastRouteCollector $r): void { - $basePath = $this->routeCollector->getBasePath(); - - foreach ($this->routeCollector->getRoutes() as $route) { - $r->addRoute($route->getMethods(), $basePath . $route->getPattern(), $route->getIdentifier()); - } - }; - - $cacheFile = $this->routeCollector->getCacheFile(); - if ($cacheFile) { - /** @var FastRouteDispatcher $dispatcher */ - $dispatcher = \FastRoute\cachedDispatcher($routeDefinitionCallback, [ - 'dataGenerator' => GroupCountBased::class, - 'dispatcher' => FastRouteDispatcher::class, - 'routeParser' => new Std(), - 'cacheFile' => $cacheFile, - ]); - } else { - /** @var FastRouteDispatcher $dispatcher */ - $dispatcher = \FastRoute\simpleDispatcher($routeDefinitionCallback, [ - 'dataGenerator' => GroupCountBased::class, - 'dispatcher' => FastRouteDispatcher::class, - 'routeParser' => new Std(), - ]); - } - - $this->dispatcher = $dispatcher; - return $this->dispatcher; - } - - /** - * {@inheritdoc} - */ - public function dispatch(string $method, string $uri): RoutingResults - { - $dispatcher = $this->createDispatcher(); - $results = $dispatcher->dispatch($method, $uri); - return new RoutingResults($this, $method, $uri, $results[0], $results[1], $results[2]); - } - - /** - * {@inheritdoc} - */ - public function getAllowedMethods(string $uri): array - { - $dispatcher = $this->createDispatcher(); - return $dispatcher->getAllowedMethods($uri); - } -} diff --git a/system/vendor/slim/slim/Slim/Routing/FastRouteDispatcher.php b/system/vendor/slim/slim/Slim/Routing/FastRouteDispatcher.php deleted file mode 100644 index 797746b..0000000 --- a/system/vendor/slim/slim/Slim/Routing/FastRouteDispatcher.php +++ /dev/null @@ -1,109 +0,0 @@ -} - */ - public function dispatch($httpMethod, $uri): array - { - $routingResults = $this->routingResults($httpMethod, $uri); - if ($routingResults[0] === self::FOUND) { - return $routingResults; - } - - // For HEAD requests, attempt fallback to GET - if ($httpMethod === 'HEAD') { - $routingResults = $this->routingResults('GET', $uri); - if ($routingResults[0] === self::FOUND) { - return $routingResults; - } - } - - // If nothing else matches, try fallback routes - $routingResults = $this->routingResults('*', $uri); - if ($routingResults[0] === self::FOUND) { - return $routingResults; - } - - if (!empty($this->getAllowedMethods($uri))) { - return [self::METHOD_NOT_ALLOWED, null, []]; - } - - return [self::NOT_FOUND, null, []]; - } - - /** - * @param string $httpMethod - * @param string $uri - * - * @return array{int, string|null, array} - */ - private function routingResults(string $httpMethod, string $uri): array - { - if (isset($this->staticRouteMap[$httpMethod][$uri])) { - /** @var string $routeIdentifier */ - $routeIdentifier = $this->staticRouteMap[$httpMethod][$uri]; - return [self::FOUND, $routeIdentifier, []]; - } - - if (isset($this->variableRouteData[$httpMethod])) { - /** @var array{0: int, 1?: string, 2?: array} $result */ - $result = $this->dispatchVariableRoute($this->variableRouteData[$httpMethod], $uri); - if ($result[0] === self::FOUND) { - /** @var array{int, string, array} $result */ - return [self::FOUND, $result[1], $result[2]]; - } - } - - return [self::NOT_FOUND, null, []]; - } - - /** - * @param string $uri - * - * @return string[] - */ - public function getAllowedMethods(string $uri): array - { - if (isset($this->allowedMethods[$uri])) { - return $this->allowedMethods[$uri]; - } - - $allowedMethods = []; - foreach ($this->staticRouteMap as $method => $uriMap) { - if (isset($uriMap[$uri])) { - $allowedMethods[$method] = true; - } - } - - foreach ($this->variableRouteData as $method => $routeData) { - $result = $this->dispatchVariableRoute($routeData, $uri); - if ($result[0] === self::FOUND) { - $allowedMethods[$method] = true; - } - } - - return $this->allowedMethods[$uri] = array_keys($allowedMethods); - } -} diff --git a/system/vendor/slim/slim/Slim/Routing/Route.php b/system/vendor/slim/slim/Slim/Routing/Route.php deleted file mode 100644 index 2cd9fa5..0000000 --- a/system/vendor/slim/slim/Slim/Routing/Route.php +++ /dev/null @@ -1,360 +0,0 @@ - - */ - protected array $arguments = []; - - /** - * Route arguments parameters - * - * @var string[] - */ - protected array $savedArguments = []; - - /** - * Container - */ - protected ?ContainerInterface $container = null; - - protected MiddlewareDispatcher $middlewareDispatcher; - - /** - * Route callable - * - * @var callable|string - */ - protected $callable; - - protected CallableResolverInterface $callableResolver; - - protected ResponseFactoryInterface $responseFactory; - - /** - * Route pattern - */ - protected string $pattern; - - protected bool $groupMiddlewareAppended = false; - - /** - * @param string[] $methods The route HTTP methods - * @param string $pattern The route pattern - * @param callable|string $callable The route callable - * @param ResponseFactoryInterface $responseFactory - * @param CallableResolverInterface $callableResolver - * @param ContainerInterface|null $container - * @param InvocationStrategyInterface|null $invocationStrategy - * @param RouteGroupInterface[] $groups The parent route groups - * @param int $identifier The route identifier - */ - public function __construct( - array $methods, - string $pattern, - $callable, - ResponseFactoryInterface $responseFactory, - CallableResolverInterface $callableResolver, - ?ContainerInterface $container = null, - ?InvocationStrategyInterface $invocationStrategy = null, - array $groups = [], - int $identifier = 0 - ) { - $this->methods = $methods; - $this->pattern = $pattern; - $this->callable = $callable; - $this->responseFactory = $responseFactory; - $this->callableResolver = $callableResolver; - $this->container = $container; - $this->invocationStrategy = $invocationStrategy ?? new RequestResponse(); - $this->groups = $groups; - $this->identifier = 'route' . $identifier; - $this->middlewareDispatcher = new MiddlewareDispatcher($this, $callableResolver, $container); - } - - public function getCallableResolver(): CallableResolverInterface - { - return $this->callableResolver; - } - - /** - * {@inheritdoc} - */ - public function getInvocationStrategy(): InvocationStrategyInterface - { - return $this->invocationStrategy; - } - - /** - * {@inheritdoc} - */ - public function setInvocationStrategy(InvocationStrategyInterface $invocationStrategy): RouteInterface - { - $this->invocationStrategy = $invocationStrategy; - return $this; - } - - /** - * {@inheritdoc} - */ - public function getMethods(): array - { - return $this->methods; - } - - /** - * {@inheritdoc} - */ - public function getPattern(): string - { - return $this->pattern; - } - - /** - * {@inheritdoc} - */ - public function setPattern(string $pattern): RouteInterface - { - $this->pattern = $pattern; - return $this; - } - - /** - * {@inheritdoc} - */ - public function getCallable() - { - return $this->callable; - } - - /** - * {@inheritdoc} - */ - public function setCallable($callable): RouteInterface - { - $this->callable = $callable; - return $this; - } - - /** - * {@inheritdoc} - */ - public function getName(): ?string - { - return $this->name; - } - - /** - * {@inheritdoc} - */ - public function setName(string $name): RouteInterface - { - $this->name = $name; - return $this; - } - - /** - * {@inheritdoc} - */ - public function getIdentifier(): string - { - return $this->identifier; - } - - /** - * {@inheritdoc} - */ - public function getArgument(string $name, ?string $default = null): ?string - { - if (array_key_exists($name, $this->arguments)) { - return $this->arguments[$name]; - } - return $default; - } - - /** - * {@inheritdoc} - */ - public function getArguments(): array - { - return $this->arguments; - } - - /** - * {@inheritdoc} - */ - public function setArguments(array $arguments, bool $includeInSavedArguments = true): RouteInterface - { - if ($includeInSavedArguments) { - $this->savedArguments = $arguments; - } - - $this->arguments = $arguments; - return $this; - } - - /** - * @return RouteGroupInterface[] - */ - public function getGroups(): array - { - return $this->groups; - } - - /** - * {@inheritdoc} - */ - public function add($middleware): RouteInterface - { - $this->middlewareDispatcher->add($middleware); - return $this; - } - - /** - * {@inheritdoc} - */ - public function addMiddleware(MiddlewareInterface $middleware): RouteInterface - { - $this->middlewareDispatcher->addMiddleware($middleware); - return $this; - } - - /** - * {@inheritdoc} - */ - public function prepare(array $arguments): RouteInterface - { - $this->arguments = array_replace($this->savedArguments, $arguments); - return $this; - } - - /** - * {@inheritdoc} - */ - public function setArgument(string $name, string $value, bool $includeInSavedArguments = true): RouteInterface - { - if ($includeInSavedArguments) { - $this->savedArguments[$name] = $value; - } - - $this->arguments[$name] = $value; - return $this; - } - - /** - * {@inheritdoc} - */ - public function run(ServerRequestInterface $request): ResponseInterface - { - if (!$this->groupMiddlewareAppended) { - $this->appendGroupMiddlewareToRoute(); - } - - return $this->middlewareDispatcher->handle($request); - } - - /** - * @return void - */ - protected function appendGroupMiddlewareToRoute(): void - { - $inner = $this->middlewareDispatcher; - $this->middlewareDispatcher = new MiddlewareDispatcher($inner, $this->callableResolver, $this->container); - - /** @var RouteGroupInterface $group */ - foreach (array_reverse($this->groups) as $group) { - $group->appendMiddlewareToDispatcher($this->middlewareDispatcher); - } - - $this->groupMiddlewareAppended = true; - } - - /** - * {@inheritdoc} - */ - public function handle(ServerRequestInterface $request): ResponseInterface - { - if ($this->callableResolver instanceof AdvancedCallableResolverInterface) { - $callable = $this->callableResolver->resolveRoute($this->callable); - } else { - $callable = $this->callableResolver->resolve($this->callable); - } - $strategy = $this->invocationStrategy; - - /** @var string[] $strategyImplements */ - $strategyImplements = class_implements($strategy); - - if ( - is_array($callable) - && $callable[0] instanceof RequestHandlerInterface - && !in_array(RequestHandlerInvocationStrategyInterface::class, $strategyImplements) - ) { - $strategy = new RequestHandler(); - } - - $response = $this->responseFactory->createResponse(); - return $strategy($callable, $request, $response, $this->arguments); - } -} diff --git a/system/vendor/slim/slim/Slim/Routing/RouteCollector.php b/system/vendor/slim/slim/Slim/Routing/RouteCollector.php deleted file mode 100644 index 61b4503..0000000 --- a/system/vendor/slim/slim/Slim/Routing/RouteCollector.php +++ /dev/null @@ -1,293 +0,0 @@ -responseFactory = $responseFactory; - $this->callableResolver = $callableResolver; - $this->container = $container; - $this->defaultInvocationStrategy = $defaultInvocationStrategy ?? new RequestResponse(); - $this->routeParser = $routeParser ?? new RouteParser($this); - - if ($cacheFile) { - $this->setCacheFile($cacheFile); - } - } - - public function getRouteParser(): RouteParserInterface - { - return $this->routeParser; - } - - /** - * Get default route invocation strategy - */ - public function getDefaultInvocationStrategy(): InvocationStrategyInterface - { - return $this->defaultInvocationStrategy; - } - - public function setDefaultInvocationStrategy(InvocationStrategyInterface $strategy): RouteCollectorInterface - { - $this->defaultInvocationStrategy = $strategy; - return $this; - } - - /** - * {@inheritdoc} - */ - public function getCacheFile(): ?string - { - return $this->cacheFile; - } - - /** - * {@inheritdoc} - */ - public function setCacheFile(string $cacheFile): RouteCollectorInterface - { - if (file_exists($cacheFile) && !is_readable($cacheFile)) { - throw new RuntimeException( - sprintf('Route collector cache file `%s` is not readable', $cacheFile) - ); - } - - if (!file_exists($cacheFile) && !is_writable(dirname($cacheFile))) { - throw new RuntimeException( - sprintf('Route collector cache file directory `%s` is not writable', dirname($cacheFile)) - ); - } - - $this->cacheFile = $cacheFile; - return $this; - } - - /** - * {@inheritdoc} - */ - public function getBasePath(): string - { - return $this->basePath; - } - - /** - * Set the base path used in urlFor() - */ - public function setBasePath(string $basePath): RouteCollectorInterface - { - $this->basePath = $basePath; - - return $this; - } - - /** - * {@inheritdoc} - */ - public function getRoutes(): array - { - return $this->routes; - } - - /** - * {@inheritdoc} - */ - public function removeNamedRoute(string $name): RouteCollectorInterface - { - $route = $this->getNamedRoute($name); - - unset($this->routesByName[$route->getName()], $this->routes[$route->getIdentifier()]); - return $this; - } - - /** - * {@inheritdoc} - */ - public function getNamedRoute(string $name): RouteInterface - { - if (isset($this->routesByName[$name])) { - $route = $this->routesByName[$name]; - if ($route->getName() === $name) { - return $route; - } - - unset($this->routesByName[$name]); - } - - foreach ($this->routes as $route) { - if ($name === $route->getName()) { - $this->routesByName[$name] = $route; - return $route; - } - } - - throw new RuntimeException('Named route does not exist for name: ' . $name); - } - - /** - * {@inheritdoc} - */ - public function lookupRoute(string $identifier): RouteInterface - { - if (!isset($this->routes[$identifier])) { - throw new RuntimeException('Route not found, looks like your route cache is stale.'); - } - return $this->routes[$identifier]; - } - - /** - * {@inheritdoc} - */ - public function group(string $pattern, $callable): RouteGroupInterface - { - $routeGroup = $this->createGroup($pattern, $callable); - $this->routeGroups[] = $routeGroup; - - $routeGroup->collectRoutes(); - array_pop($this->routeGroups); - - return $routeGroup; - } - - /** - * @param string|callable $callable - */ - protected function createGroup(string $pattern, $callable): RouteGroupInterface - { - $routeCollectorProxy = $this->createProxy($pattern); - return new RouteGroup($pattern, $callable, $this->callableResolver, $routeCollectorProxy); - } - - protected function createProxy(string $pattern): RouteCollectorProxyInterface - { - return new RouteCollectorProxy( - $this->responseFactory, - $this->callableResolver, - $this->container, - $this, - $pattern - ); - } - - /** - * {@inheritdoc} - */ - public function map(array $methods, string $pattern, $handler): RouteInterface - { - $route = $this->createRoute($methods, $pattern, $handler); - $this->routes[$route->getIdentifier()] = $route; - - $routeName = $route->getName(); - if ($routeName !== null && !isset($this->routesByName[$routeName])) { - $this->routesByName[$routeName] = $route; - } - - $this->routeCounter++; - - return $route; - } - - /** - * @param string[] $methods - * @param callable|string $callable - */ - protected function createRoute(array $methods, string $pattern, $callable): RouteInterface - { - return new Route( - $methods, - $pattern, - $callable, - $this->responseFactory, - $this->callableResolver, - $this->container, - $this->defaultInvocationStrategy, - $this->routeGroups, - $this->routeCounter - ); - } -} diff --git a/system/vendor/slim/slim/Slim/Routing/RouteCollectorProxy.php b/system/vendor/slim/slim/Slim/Routing/RouteCollectorProxy.php deleted file mode 100644 index f8bc232..0000000 --- a/system/vendor/slim/slim/Slim/Routing/RouteCollectorProxy.php +++ /dev/null @@ -1,187 +0,0 @@ -responseFactory = $responseFactory; - $this->callableResolver = $callableResolver; - $this->container = $container; - $this->routeCollector = $routeCollector ?? new RouteCollector($responseFactory, $callableResolver, $container); - $this->groupPattern = $groupPattern; - } - - /** - * {@inheritdoc} - */ - public function getResponseFactory(): ResponseFactoryInterface - { - return $this->responseFactory; - } - - /** - * {@inheritdoc} - */ - public function getCallableResolver(): CallableResolverInterface - { - return $this->callableResolver; - } - - /** - * {@inheritdoc} - */ - public function getContainer(): ?ContainerInterface - { - return $this->container; - } - - /** - * {@inheritdoc} - */ - public function getRouteCollector(): RouteCollectorInterface - { - return $this->routeCollector; - } - - /** - * {@inheritdoc} - */ - public function getBasePath(): string - { - return $this->routeCollector->getBasePath(); - } - - /** - * {@inheritdoc} - */ - public function setBasePath(string $basePath): RouteCollectorProxyInterface - { - $this->routeCollector->setBasePath($basePath); - - return $this; - } - - /** - * {@inheritdoc} - */ - public function get(string $pattern, $callable): RouteInterface - { - return $this->map(['GET'], $pattern, $callable); - } - - /** - * {@inheritdoc} - */ - public function post(string $pattern, $callable): RouteInterface - { - return $this->map(['POST'], $pattern, $callable); - } - - /** - * {@inheritdoc} - */ - public function put(string $pattern, $callable): RouteInterface - { - return $this->map(['PUT'], $pattern, $callable); - } - - /** - * {@inheritdoc} - */ - public function patch(string $pattern, $callable): RouteInterface - { - return $this->map(['PATCH'], $pattern, $callable); - } - - /** - * {@inheritdoc} - */ - public function delete(string $pattern, $callable): RouteInterface - { - return $this->map(['DELETE'], $pattern, $callable); - } - - /** - * {@inheritdoc} - */ - public function options(string $pattern, $callable): RouteInterface - { - return $this->map(['OPTIONS'], $pattern, $callable); - } - - /** - * {@inheritdoc} - */ - public function any(string $pattern, $callable): RouteInterface - { - return $this->map(['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'OPTIONS'], $pattern, $callable); - } - - /** - * {@inheritdoc} - */ - public function map(array $methods, string $pattern, $callable): RouteInterface - { - $pattern = $this->groupPattern . $pattern; - - return $this->routeCollector->map($methods, $pattern, $callable); - } - - /** - * {@inheritdoc} - */ - public function group(string $pattern, $callable): RouteGroupInterface - { - $pattern = $this->groupPattern . $pattern; - - return $this->routeCollector->group($pattern, $callable); - } - - /** - * {@inheritdoc} - */ - public function redirect(string $from, $to, int $status = 302): RouteInterface - { - $responseFactory = $this->responseFactory; - - $handler = function () use ($to, $status, $responseFactory) { - $response = $responseFactory->createResponse($status); - return $response->withHeader('Location', (string) $to); - }; - - return $this->get($from, $handler); - } -} diff --git a/system/vendor/slim/slim/Slim/Routing/RouteContext.php b/system/vendor/slim/slim/Slim/Routing/RouteContext.php deleted file mode 100644 index 3ba5e23..0000000 --- a/system/vendor/slim/slim/Slim/Routing/RouteContext.php +++ /dev/null @@ -1,88 +0,0 @@ -getAttribute(self::ROUTE); - $routeParser = $serverRequest->getAttribute(self::ROUTE_PARSER); - $routingResults = $serverRequest->getAttribute(self::ROUTING_RESULTS); - $basePath = $serverRequest->getAttribute(self::BASE_PATH); - - if ($routeParser === null || $routingResults === null) { - throw new RuntimeException('Cannot create RouteContext before routing has been completed'); - } - - /** @var RouteInterface|null $route */ - /** @var RouteParserInterface $routeParser */ - /** @var RoutingResults $routingResults */ - /** @var string|null $basePath */ - return new self($route, $routeParser, $routingResults, $basePath); - } - - private ?RouteInterface $route; - - private RouteParserInterface $routeParser; - - private RoutingResults $routingResults; - - private ?string $basePath; - - private function __construct( - ?RouteInterface $route, - RouteParserInterface $routeParser, - RoutingResults $routingResults, - ?string $basePath = null - ) { - $this->route = $route; - $this->routeParser = $routeParser; - $this->routingResults = $routingResults; - $this->basePath = $basePath; - } - - public function getRoute(): ?RouteInterface - { - return $this->route; - } - - public function getRouteParser(): RouteParserInterface - { - return $this->routeParser; - } - - public function getRoutingResults(): RoutingResults - { - return $this->routingResults; - } - - public function getBasePath(): string - { - if ($this->basePath === null) { - throw new RuntimeException('No base path defined.'); - } - return $this->basePath; - } -} diff --git a/system/vendor/slim/slim/Slim/Routing/RouteGroup.php b/system/vendor/slim/slim/Slim/Routing/RouteGroup.php deleted file mode 100644 index cd2f4e7..0000000 --- a/system/vendor/slim/slim/Slim/Routing/RouteGroup.php +++ /dev/null @@ -1,104 +0,0 @@ -pattern = $pattern; - $this->callable = $callable; - $this->callableResolver = $callableResolver; - $this->routeCollectorProxy = $routeCollectorProxy; - } - - /** - * {@inheritdoc} - */ - public function collectRoutes(): RouteGroupInterface - { - if ($this->callableResolver instanceof AdvancedCallableResolverInterface) { - $callable = $this->callableResolver->resolveRoute($this->callable); - } else { - $callable = $this->callableResolver->resolve($this->callable); - } - $callable($this->routeCollectorProxy); - return $this; - } - - /** - * {@inheritdoc} - */ - public function add($middleware): RouteGroupInterface - { - $this->middleware[] = $middleware; - return $this; - } - - /** - * {@inheritdoc} - */ - public function addMiddleware(MiddlewareInterface $middleware): RouteGroupInterface - { - $this->middleware[] = $middleware; - return $this; - } - - /** - * {@inheritdoc} - */ - public function appendMiddlewareToDispatcher(MiddlewareDispatcher $dispatcher): RouteGroupInterface - { - foreach ($this->middleware as $middleware) { - $dispatcher->add($middleware); - } - - return $this; - } - - /** - * {@inheritdoc} - */ - public function getPattern(): string - { - return $this->pattern; - } -} diff --git a/system/vendor/slim/slim/Slim/Routing/RouteParser.php b/system/vendor/slim/slim/Slim/Routing/RouteParser.php deleted file mode 100644 index afb533c..0000000 --- a/system/vendor/slim/slim/Slim/Routing/RouteParser.php +++ /dev/null @@ -1,127 +0,0 @@ -routeCollector = $routeCollector; - $this->routeParser = new Std(); - } - - /** - * {@inheritdoc} - */ - public function relativeUrlFor(string $routeName, array $data = [], array $queryParams = []): string - { - $route = $this->routeCollector->getNamedRoute($routeName); - $pattern = $route->getPattern(); - - $segments = []; - $segmentName = ''; - - /* - * $routes is an associative array of expressions representing a route as multiple segments - * There is an expression for each optional parameter plus one without the optional parameters - * The most specific is last, hence why we reverse the array before iterating over it - */ - $expressions = array_reverse($this->routeParser->parse($pattern)); - foreach ($expressions as $expression) { - foreach ($expression as $segment) { - /* - * Each $segment is either a string or an array of strings - * containing optional parameters of an expression - */ - if (is_string($segment)) { - $segments[] = $segment; - continue; - } - - /** @var string[] $segment */ - /* - * If we don't have a data element for this segment in the provided $data - * we cancel testing to move onto the next expression with a less specific item - */ - if (!array_key_exists($segment[0], $data)) { - $segments = []; - $segmentName = $segment[0]; - break; - } - - $segments[] = $data[$segment[0]]; - } - - /* - * If we get to this logic block we have found all the parameters - * for the provided $data which means we don't need to continue testing - * less specific expressions - */ - if (!empty($segments)) { - break; - } - } - - if (empty($segments)) { - throw new InvalidArgumentException('Missing data for URL segment: ' . $segmentName); - } - - $url = implode('', $segments); - if ($queryParams) { - $url .= '?' . http_build_query($queryParams); - } - - return $url; - } - - /** - * {@inheritdoc} - */ - public function urlFor(string $routeName, array $data = [], array $queryParams = []): string - { - $basePath = $this->routeCollector->getBasePath(); - $url = $this->relativeUrlFor($routeName, $data, $queryParams); - - if ($basePath) { - $url = $basePath . $url; - } - - return $url; - } - - /** - * {@inheritdoc} - */ - public function fullUrlFor(UriInterface $uri, string $routeName, array $data = [], array $queryParams = []): string - { - $path = $this->urlFor($routeName, $data, $queryParams); - $scheme = $uri->getScheme(); - $authority = $uri->getAuthority(); - $protocol = ($scheme ? $scheme . ':' : '') . ($authority ? '//' . $authority : ''); - return $protocol . $path; - } -} diff --git a/system/vendor/slim/slim/Slim/Routing/RouteResolver.php b/system/vendor/slim/slim/Slim/Routing/RouteResolver.php deleted file mode 100644 index d4f4eaf..0000000 --- a/system/vendor/slim/slim/Slim/Routing/RouteResolver.php +++ /dev/null @@ -1,56 +0,0 @@ -routeCollector = $routeCollector; - $this->dispatcher = $dispatcher ?? new Dispatcher($routeCollector); - } - - /** - * @param string $uri Should be $request->getUri()->getPath() - */ - public function computeRoutingResults(string $uri, string $method): RoutingResults - { - $uri = rawurldecode($uri); - if ($uri === '' || $uri[0] !== '/') { - $uri = '/' . $uri; - } - return $this->dispatcher->dispatch($method, $uri); - } - - /** - * @throws RuntimeException - */ - public function resolveRoute(string $identifier): RouteInterface - { - return $this->routeCollector->lookupRoute($identifier); - } -} diff --git a/system/vendor/slim/slim/Slim/Routing/RouteRunner.php b/system/vendor/slim/slim/Slim/Routing/RouteRunner.php deleted file mode 100644 index 40946af..0000000 --- a/system/vendor/slim/slim/Slim/Routing/RouteRunner.php +++ /dev/null @@ -1,70 +0,0 @@ -routeResolver = $routeResolver; - $this->routeParser = $routeParser; - $this->routeCollectorProxy = $routeCollectorProxy; - } - - /** - * This request handler is instantiated automatically in App::__construct() - * It is at the very tip of the middleware queue meaning it will be executed - * last and it detects whether or not routing has been performed in the user - * defined middleware stack. In the event that the user did not perform routing - * it is done here - * - * @throws HttpNotFoundException - * @throws HttpMethodNotAllowedException - */ - public function handle(ServerRequestInterface $request): ResponseInterface - { - // If routing hasn't been done, then do it now so we can dispatch - if ($request->getAttribute(RouteContext::ROUTING_RESULTS) === null) { - $routingMiddleware = new RoutingMiddleware($this->routeResolver, $this->routeParser); - $request = $routingMiddleware->performRouting($request); - } - - if ($this->routeCollectorProxy !== null) { - $request = $request->withAttribute( - RouteContext::BASE_PATH, - $this->routeCollectorProxy->getBasePath() - ); - } - - /** @var Route $route */ - $route = $request->getAttribute(RouteContext::ROUTE); - return $route->run($request); - } -} diff --git a/system/vendor/slim/slim/Slim/Routing/RoutingResults.php b/system/vendor/slim/slim/Slim/Routing/RoutingResults.php deleted file mode 100644 index ac2fa64..0000000 --- a/system/vendor/slim/slim/Slim/Routing/RoutingResults.php +++ /dev/null @@ -1,112 +0,0 @@ - - */ - protected array $routeArguments; - - /** - * @param array $routeArguments - */ - public function __construct( - DispatcherInterface $dispatcher, - string $method, - string $uri, - int $routeStatus, - ?string $routeIdentifier = null, - array $routeArguments = [] - ) { - $this->dispatcher = $dispatcher; - $this->method = $method; - $this->uri = $uri; - $this->routeStatus = $routeStatus; - $this->routeIdentifier = $routeIdentifier; - $this->routeArguments = $routeArguments; - } - - public function getDispatcher(): DispatcherInterface - { - return $this->dispatcher; - } - - public function getMethod(): string - { - return $this->method; - } - - public function getUri(): string - { - return $this->uri; - } - - public function getRouteStatus(): int - { - return $this->routeStatus; - } - - public function getRouteIdentifier(): ?string - { - return $this->routeIdentifier; - } - - /** - * @return array - */ - public function getRouteArguments(bool $urlDecode = true): array - { - if (!$urlDecode) { - return $this->routeArguments; - } - - $routeArguments = []; - foreach ($this->routeArguments as $key => $value) { - $routeArguments[$key] = rawurldecode($value); - } - - return $routeArguments; - } - - /** - * @return string[] - */ - public function getAllowedMethods(): array - { - return $this->dispatcher->getAllowedMethods($this->uri); - } -} diff --git a/system/vendor/slim/slim/composer.json b/system/vendor/slim/slim/composer.json deleted file mode 100644 index 36c0c1d..0000000 --- a/system/vendor/slim/slim/composer.json +++ /dev/null @@ -1,102 +0,0 @@ -{ - "name": "slim/slim", - "type": "library", - "description": "Slim is a PHP micro framework that helps you quickly write simple yet powerful web applications and APIs", - "keywords": ["framework","micro","api","router"], - "homepage": "https://www.slimframework.com", - "license": "MIT", - "authors": [ - { - "name": "Josh Lockhart", - "email": "hello@joshlockhart.com", - "homepage": "https://joshlockhart.com" - }, - { - "name": "Andrew Smith", - "email": "a.smith@silentworks.co.uk", - "homepage": "http://silentworks.co.uk" - }, - { - "name": "Rob Allen", - "email": "rob@akrabat.com", - "homepage": "http://akrabat.com" - }, - { - "name": "Pierre Berube", - "email": "pierre@lgse.com", - "homepage": "http://www.lgse.com" - }, - { - "name": "Gabriel Manricks", - "email": "gmanricks@me.com", - "homepage": "http://gabrielmanricks.com" - } - ], - "support": { - "docs": "https://www.slimframework.com/docs/v4/", - "forum": "https://discourse.slimframework.com/", - "irc": "irc://irc.freenode.net:6667/slimphp", - "issues": "https://github.com/slimphp/Slim/issues", - "rss": "https://www.slimframework.com/blog/feed.rss", - "slack": "https://slimphp.slack.com/", - "source": "https://github.com/slimphp/Slim", - "wiki": "https://github.com/slimphp/Slim/wiki" - }, - "require": { - "php": "^7.4 || ^8.0", - "ext-json": "*", - "nikic/fast-route": "^1.3", - "psr/container": "^1.0 || ^2.0", - "psr/http-factory": "^1.0", - "psr/http-message": "^1.1", - "psr/http-server-handler": "^1.0", - "psr/http-server-middleware": "^1.0", - "psr/log": "^1.1 || ^2.0 || ^3.0" - }, - "require-dev": { - "ext-simplexml": "*", - "adriansuter/php-autoload-override": "^1.4", - "guzzlehttp/psr7": "^2.5", - "httpsoft/http-message": "^1.1", - "httpsoft/http-server-request": "^1.1", - "laminas/laminas-diactoros": "^2.17", - "nyholm/psr7": "^1.8", - "nyholm/psr7-server": "^1.0", - "phpspec/prophecy": "^1.17", - "phpspec/prophecy-phpunit": "^2.0", - "phpstan/phpstan": "^1.10", - "phpunit/phpunit": "^9.6", - "slim/http": "^1.3", - "slim/psr7": "^1.6", - "squizlabs/php_codesniffer": "^3.7" - }, - "autoload": { - "psr-4": { - "Slim\\": "Slim" - } - }, - "autoload-dev": { - "psr-4": { - "Slim\\Tests\\": "tests" - } - }, - "scripts": { - "test": [ - "@phpunit", - "@phpcs", - "@phpstan" - ], - "phpunit": "phpunit", - "phpcs": "phpcs", - "phpstan": "phpstan --memory-limit=-1" - }, - "suggest": { - "ext-simplexml": "Needed to support XML format in BodyParsingMiddleware", - "ext-xml": "Needed to support XML format in BodyParsingMiddleware", - "slim/psr7": "Slim PSR-7 implementation. See https://www.slimframework.com/docs/v4/start/installation.html for more information.", - "php-di/php-di": "PHP-DI is the recommended container library to be used with Slim" - }, - "config": { - "sort-packages": true - } -} diff --git a/system/vendor/slim/twig-view/LICENSE.md b/system/vendor/slim/twig-view/LICENSE.md deleted file mode 100644 index 6df4c84..0000000 --- a/system/vendor/slim/twig-view/LICENSE.md +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 Josh Lockhart - -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/system/vendor/slim/twig-view/composer.json b/system/vendor/slim/twig-view/composer.json deleted file mode 100644 index aff9e6e..0000000 --- a/system/vendor/slim/twig-view/composer.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "name": "slim/twig-view", - "type": "library", - "description": "Slim Framework 4 view helper built on top of the Twig 3 templating component", - "keywords": ["slim","framework","view","template","twig"], - "homepage": "https://www.slimframework.com", - "license": "MIT", - "authors": [ - { - "name": "Josh Lockhart", - "email": "hello@joshlockhart.com", - "homepage": "http://joshlockhart.com" - }, - { - "name": "Pierre Berube", - "email": "pierre@lgse.com", - "homepage": "http://www.lgse.com" - } - ], - "require": { - "php": "^7.4 || ^8.0", - "psr/http-message": "^1.0", - "slim/slim": "^4.9", - "twig/twig": "^3.3", - "symfony/polyfill-php81": "^1.23" - }, - "require-dev": { - "phpunit/phpunit": "^9.5", - "phpspec/prophecy-phpunit": "^2.0", - "phpstan/phpstan": "^1.3.0", - "psr/http-factory": "^1.0", - "squizlabs/php_codesniffer": "^3.6" - }, - "autoload": { - "psr-4": { - "Slim\\Views\\": "src" - } - }, - "autoload-dev": { - "psr-4": { - "Slim\\Tests\\": "tests" - } - }, - "scripts": { - "test": [ - "@phpunit", - "@phpcs", - "@phpstan" - ], - "phpunit": "phpunit", - "phpcs": "phpcs", - "phpstan": "phpstan" - } -} diff --git a/system/vendor/slim/twig-view/src/Twig.php b/system/vendor/slim/twig-view/src/Twig.php deleted file mode 100644 index 3b8c3ef..0000000 --- a/system/vendor/slim/twig-view/src/Twig.php +++ /dev/null @@ -1,303 +0,0 @@ - - */ -class Twig implements ArrayAccess -{ - /** - * Twig loader - */ - protected LoaderInterface $loader; - - /** - * Twig environment - */ - protected Environment $environment; - - /** - * Default view variables - * - * @var array - */ - protected array $defaultVariables = []; - - /** - * @param ServerRequestInterface $request - * @param string $attributeName - * - * @return Twig - */ - public static function fromRequest(ServerRequestInterface $request, string $attributeName = 'view'): self - { - $twig = $request->getAttribute($attributeName); - if (!($twig instanceof self)) { - throw new RuntimeException( - 'Twig could not be found in the server request attributes using the key "' . $attributeName . '".' - ); - } - - return $twig; - } - - /** - * @param string|string[] $path Path(s) to templates directory - * @param array $settings Twig environment settings - * - * @throws LoaderError When the template cannot be found - * - * @return Twig - */ - public static function create($path, array $settings = []): self - { - $loader = new FilesystemLoader(); - - $paths = is_array($path) ? $path : [$path]; - foreach ($paths as $namespace => $path) { - if (is_string($namespace)) { - $loader->setPaths($path, $namespace); - } else { - $loader->addPath($path); - } - } - - return new self($loader, $settings); - } - - /** - * @param LoaderInterface $loader Twig loader - * @param array $settings Twig environment settings - */ - public function __construct(LoaderInterface $loader, array $settings = []) - { - $this->loader = $loader; - $this->environment = new Environment($this->loader, $settings); - $extension = new TwigExtension(); - $this->addExtension($extension); - } - - /** - * Proxy method to add an extension to the Twig environment - * - * @param ExtensionInterface $extension A single extension instance or an array of instances - */ - public function addExtension(ExtensionInterface $extension): void - { - $this->environment->addExtension($extension); - } - - /** - * Proxy method to add a runtime loader to the Twig environment - * - * @param RuntimeLoaderInterface $runtimeLoader - */ - public function addRuntimeLoader(RuntimeLoaderInterface $runtimeLoader): void - { - $this->environment->addRuntimeLoader($runtimeLoader); - } - - /** - * Fetch rendered template - * - * @param string $template Template pathname relative to templates directory - * @param array $data Associative array of template variables - * - * @throws LoaderError When the template cannot be found - * @throws SyntaxError When an error occurred during compilation - * @throws RuntimeError When an error occurred during rendering - * - * @return string - */ - public function fetch(string $template, array $data = []): string - { - $data = array_merge($this->defaultVariables, $data); - - return $this->environment->render($template, $data); - } - - /** - * Fetch rendered block - * - * @param string $template Template pathname relative to templates directory - * @param string $block Name of the block within the template - * @param array $data Associative array of template variables - * - * @throws Throwable When an error occurred during rendering - * @throws LoaderError When the template cannot be found - * @throws SyntaxError When an error occurred during compilation - * - * @return string - */ - public function fetchBlock(string $template, string $block, array $data = []): string - { - $data = array_merge($this->defaultVariables, $data); - - return $this->environment->resolveTemplate($template)->renderBlock($block, $data); - } - - /** - * Fetch rendered string - * - * @param string $string String - * @param array $data Associative array of template variables - * - * @throws LoaderError When the template cannot be found - * @throws SyntaxError When an error occurred during compilation - * - * @return string - */ - public function fetchFromString(string $string = '', array $data = []): string - { - $data = array_merge($this->defaultVariables, $data); - - return $this->environment->createTemplate($string)->render($data); - } - - /** - * Output rendered template - * - * @param ResponseInterface $response - * @param string $template Template pathname relative to templates directory - * @param array $data Associative array of template variables - * - * @throws LoaderError When the template cannot be found - * @throws SyntaxError When an error occurred during compilation - * @throws RuntimeError When an error occurred during rendering - * - * @return ResponseInterface - */ - public function render(ResponseInterface $response, string $template, array $data = []): ResponseInterface - { - $response->getBody()->write($this->fetch($template, $data)); - - return $response; - } - - /** - * Return Twig loader - * - * @return LoaderInterface - */ - public function getLoader(): LoaderInterface - { - return $this->loader; - } - - /** - * Return Twig environment - * - * @return Environment - */ - public function getEnvironment(): Environment - { - return $this->environment; - } - - /** - * Does this collection have a given key? - * - * @param string $key The data key - * - * @return bool - */ - public function offsetExists($key): bool - { - return array_key_exists($key, $this->defaultVariables); - } - - /** - * Get collection item for key - * - * @param string $key The data key - * - * @return mixed The key's value, or the default value - */ - #[ReturnTypeWillChange] - public function offsetGet($key) - { - if (!$this->offsetExists($key)) { - return null; - } - return $this->defaultVariables[$key]; - } - - /** - * Set collection item - * - * @param string $key The data key - * @param mixed $value The data value - */ - public function offsetSet($key, $value): void - { - $this->defaultVariables[$key] = $value; - } - - /** - * Remove item from collection - * - * @param string $key The data key - */ - public function offsetUnset($key): void - { - unset($this->defaultVariables[$key]); - } - - /** - * Get number of items in collection - * - * @return int - */ - public function count(): int - { - return count($this->defaultVariables); - } - - /** - * Get collection iterator - * - * @return ArrayIterator - */ - public function getIterator(): ArrayIterator - { - return new ArrayIterator($this->defaultVariables); - } -} diff --git a/system/vendor/slim/twig-view/src/TwigExtension.php b/system/vendor/slim/twig-view/src/TwigExtension.php deleted file mode 100644 index 2c4628c..0000000 --- a/system/vendor/slim/twig-view/src/TwigExtension.php +++ /dev/null @@ -1,40 +0,0 @@ -getContainer(); - if ($container === null) { - throw new RuntimeException('The app does not have a container.'); - } - if (!$container->has($containerKey)) { - throw new RuntimeException( - "The specified container key does not exist: $containerKey" - ); - } - - $twig = $container->get($containerKey); - if (!($twig instanceof Twig)) { - throw new RuntimeException( - "Twig instance could not be resolved via container key: $containerKey" - ); - } - - return new self( - $twig, - $app->getRouteCollector()->getRouteParser(), - $app->getBasePath() - ); - } - - /** - * @param App $app - * @param Twig $twig - * @param string $attributeName - * - * @return TwigMiddleware - */ - public static function create(App $app, Twig $twig, string $attributeName = 'view'): self - { - return new self( - $twig, - $app->getRouteCollector()->getRouteParser(), - $app->getBasePath(), - $attributeName - ); - } - - /** - * @param Twig $twig - * @param RouteParserInterface $routeParser - * @param string $basePath - * @param string|null $attributeName - */ - public function __construct( - Twig $twig, - RouteParserInterface $routeParser, - string $basePath = '', - ?string $attributeName = null - ) { - $this->twig = $twig; - $this->routeParser = $routeParser; - $this->basePath = $basePath; - $this->attributeName = $attributeName; - } - - /** - * Process an incoming server request. - * - * @param ServerRequestInterface $request - * @param RequestHandlerInterface $handler - * - * @return ResponseInterface - */ - public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface - { - $runtimeLoader = new TwigRuntimeLoader($this->routeParser, $request->getUri(), $this->basePath); - $this->twig->addRuntimeLoader($runtimeLoader); - - if ($this->attributeName !== null) { - $request = $request->withAttribute($this->attributeName, $this->twig); - } - - return $handler->handle($request); - } -} diff --git a/system/vendor/slim/twig-view/src/TwigRuntimeExtension.php b/system/vendor/slim/twig-view/src/TwigRuntimeExtension.php deleted file mode 100644 index 13926c8..0000000 --- a/system/vendor/slim/twig-view/src/TwigRuntimeExtension.php +++ /dev/null @@ -1,144 +0,0 @@ -routeParser = $routeParser; - $this->uri = $uri; - $this->basePath = $basePath; - } - - /** - * Get the url for a named route - * - * @param string $routeName Route name - * @param array $data Route placeholders - * @param array $queryParams Query parameters - * - * @return string - */ - public function urlFor(string $routeName, array $data = [], array $queryParams = []): string - { - return $this->routeParser->urlFor($routeName, $data, $queryParams); - } - - /** - * Get the full url for a named route - * - * @param string $routeName Route name - * @param array $data Route placeholders - * @param array $queryParams Query parameters - * - * @return string - */ - public function fullUrlFor(string $routeName, array $data = [], array $queryParams = []): string - { - return $this->routeParser->fullUrlFor($this->uri, $routeName, $data, $queryParams); - } - - /** - * @param string $routeName Route name - * @param array $data Route placeholders - * - * @return bool - */ - public function isCurrentUrl(string $routeName, array $data = []): bool - { - $currentUrl = $this->basePath . $this->uri->getPath(); - $result = $this->routeParser->urlFor($routeName, $data); - - return $result === $currentUrl; - } - - /** - * Get current path on given Uri - * - * @param bool $withQueryString - * - * @return string - */ - public function getCurrentUrl(bool $withQueryString = false): string - { - $currentUrl = $this->basePath . $this->uri->getPath(); - $query = $this->uri->getQuery(); - - if ($withQueryString && !empty($query)) { - $currentUrl .= '?' . $query; - } - - return $currentUrl; - } - - /** - * Get the uri - * - * @return UriInterface - */ - public function getUri(): UriInterface - { - return $this->uri; - } - - /** - * Set the uri - * - * @param UriInterface $uri - * - * @return self - */ - public function setUri(UriInterface $uri): self - { - $this->uri = $uri; - - return $this; - } - - /** - * Get the base path - * - * @return string - */ - public function getBasePath(): string - { - return $this->basePath; - } - - /** - * Set the base path - * - * @param string $basePath - * - * @return self - */ - public function setBasePath(string $basePath): self - { - $this->basePath = $basePath; - - return $this; - } -} diff --git a/system/vendor/slim/twig-view/src/TwigRuntimeLoader.php b/system/vendor/slim/twig-view/src/TwigRuntimeLoader.php deleted file mode 100644 index 2ac9c08..0000000 --- a/system/vendor/slim/twig-view/src/TwigRuntimeLoader.php +++ /dev/null @@ -1,54 +0,0 @@ -routeParser = $routeParser; - $this->uri = $uri; - $this->basePath = $basePath; - } - - /** - * Create the runtime implementation of a Twig element. - * - * @param string $class - * - * @return mixed - */ - public function load(string $class) - { - if (TwigRuntimeExtension::class === $class) { - return new $class($this->routeParser, $this->uri, $this->basePath); - } - - return null; - } -} diff --git a/system/vendor/symfony/deprecation-contracts/.gitignore b/system/vendor/symfony/deprecation-contracts/.gitignore deleted file mode 100644 index c49a5d8..0000000 --- a/system/vendor/symfony/deprecation-contracts/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -vendor/ -composer.lock -phpunit.xml diff --git a/system/vendor/symfony/deprecation-contracts/CHANGELOG.md b/system/vendor/symfony/deprecation-contracts/CHANGELOG.md deleted file mode 100644 index 7932e26..0000000 --- a/system/vendor/symfony/deprecation-contracts/CHANGELOG.md +++ /dev/null @@ -1,5 +0,0 @@ -CHANGELOG -========= - -The changelog is maintained for all Symfony contracts at the following URL: -https://github.com/symfony/contracts/blob/main/CHANGELOG.md diff --git a/system/vendor/symfony/deprecation-contracts/LICENSE b/system/vendor/symfony/deprecation-contracts/LICENSE deleted file mode 100644 index 406242f..0000000 --- a/system/vendor/symfony/deprecation-contracts/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2020-2022 Fabien Potencier - -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/system/vendor/symfony/deprecation-contracts/README.md b/system/vendor/symfony/deprecation-contracts/README.md deleted file mode 100644 index 4957933..0000000 --- a/system/vendor/symfony/deprecation-contracts/README.md +++ /dev/null @@ -1,26 +0,0 @@ -Symfony Deprecation Contracts -============================= - -A generic function and convention to trigger deprecation notices. - -This package provides a single global function named `trigger_deprecation()` that triggers silenced deprecation notices. - -By using a custom PHP error handler such as the one provided by the Symfony ErrorHandler component, -the triggered deprecations can be caught and logged for later discovery, both on dev and prod environments. - -The function requires at least 3 arguments: - - the name of the Composer package that is triggering the deprecation - - the version of the package that introduced the deprecation - - the message of the deprecation - - more arguments can be provided: they will be inserted in the message using `printf()` formatting - -Example: -```php -trigger_deprecation('symfony/blockchain', '8.9', 'Using "%s" is deprecated, use "%s" instead.', 'bitcoin', 'fabcoin'); -``` - -This will generate the following message: -`Since symfony/blockchain 8.9: Using "bitcoin" is deprecated, use "fabcoin" instead.` - -While not necessarily recommended, the deprecation notices can be completely ignored by declaring an empty -`function trigger_deprecation() {}` in your application. diff --git a/system/vendor/symfony/deprecation-contracts/composer.json b/system/vendor/symfony/deprecation-contracts/composer.json deleted file mode 100644 index cc7cc12..0000000 --- a/system/vendor/symfony/deprecation-contracts/composer.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "symfony/deprecation-contracts", - "type": "library", - "description": "A generic function and convention to trigger deprecation notices", - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=7.1" - }, - "autoload": { - "files": [ - "function.php" - ] - }, - "minimum-stability": "dev", - "extra": { - "branch-alias": { - "dev-main": "2.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - } -} diff --git a/system/vendor/symfony/deprecation-contracts/function.php b/system/vendor/symfony/deprecation-contracts/function.php deleted file mode 100644 index d437150..0000000 --- a/system/vendor/symfony/deprecation-contracts/function.php +++ /dev/null @@ -1,27 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -if (!function_exists('trigger_deprecation')) { - /** - * Triggers a silenced deprecation notice. - * - * @param string $package The name of the Composer package that is triggering the deprecation - * @param string $version The version of the package that introduced the deprecation - * @param string $message The message of the deprecation - * @param mixed ...$args Values to insert in the message using printf() formatting - * - * @author Nicolas Grekas - */ - function trigger_deprecation(string $package, string $version, string $message, ...$args): void - { - @trigger_error(($package || $version ? "Since $package $version: " : '').($args ? vsprintf($message, $args) : $message), \E_USER_DEPRECATED); - } -} diff --git a/system/vendor/symfony/event-dispatcher-contracts/.gitignore b/system/vendor/symfony/event-dispatcher-contracts/.gitignore deleted file mode 100644 index c49a5d8..0000000 --- a/system/vendor/symfony/event-dispatcher-contracts/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -vendor/ -composer.lock -phpunit.xml diff --git a/system/vendor/symfony/event-dispatcher-contracts/CHANGELOG.md b/system/vendor/symfony/event-dispatcher-contracts/CHANGELOG.md deleted file mode 100644 index 7932e26..0000000 --- a/system/vendor/symfony/event-dispatcher-contracts/CHANGELOG.md +++ /dev/null @@ -1,5 +0,0 @@ -CHANGELOG -========= - -The changelog is maintained for all Symfony contracts at the following URL: -https://github.com/symfony/contracts/blob/main/CHANGELOG.md diff --git a/system/vendor/symfony/event-dispatcher-contracts/Event.php b/system/vendor/symfony/event-dispatcher-contracts/Event.php deleted file mode 100644 index 46dcb2b..0000000 --- a/system/vendor/symfony/event-dispatcher-contracts/Event.php +++ /dev/null @@ -1,54 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Contracts\EventDispatcher; - -use Psr\EventDispatcher\StoppableEventInterface; - -/** - * Event is the base class for classes containing event data. - * - * This class contains no event data. It is used by events that do not pass - * state information to an event handler when an event is raised. - * - * You can call the method stopPropagation() to abort the execution of - * further listeners in your event listener. - * - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - * @author Bernhard Schussek - * @author Nicolas Grekas - */ -class Event implements StoppableEventInterface -{ - private $propagationStopped = false; - - /** - * {@inheritdoc} - */ - public function isPropagationStopped(): bool - { - return $this->propagationStopped; - } - - /** - * Stops the propagation of the event to further event listeners. - * - * If multiple event listeners are connected to the same event, no - * further event listener will be triggered once any trigger calls - * stopPropagation(). - */ - public function stopPropagation(): void - { - $this->propagationStopped = true; - } -} diff --git a/system/vendor/symfony/event-dispatcher-contracts/EventDispatcherInterface.php b/system/vendor/symfony/event-dispatcher-contracts/EventDispatcherInterface.php deleted file mode 100644 index 351dc51..0000000 --- a/system/vendor/symfony/event-dispatcher-contracts/EventDispatcherInterface.php +++ /dev/null @@ -1,31 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Contracts\EventDispatcher; - -use Psr\EventDispatcher\EventDispatcherInterface as PsrEventDispatcherInterface; - -/** - * Allows providing hooks on domain-specific lifecycles by dispatching events. - */ -interface EventDispatcherInterface extends PsrEventDispatcherInterface -{ - /** - * Dispatches an event to all registered listeners. - * - * @param object $event The event to pass to the event handlers/listeners - * @param string|null $eventName The name of the event to dispatch. If not supplied, - * the class of $event should be used instead. - * - * @return object The passed $event MUST be returned - */ - public function dispatch(object $event, string $eventName = null): object; -} diff --git a/system/vendor/symfony/event-dispatcher-contracts/LICENSE b/system/vendor/symfony/event-dispatcher-contracts/LICENSE deleted file mode 100644 index 74cdc2d..0000000 --- a/system/vendor/symfony/event-dispatcher-contracts/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2018-2022 Fabien Potencier - -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/system/vendor/symfony/event-dispatcher-contracts/README.md b/system/vendor/symfony/event-dispatcher-contracts/README.md deleted file mode 100644 index b1ab4c0..0000000 --- a/system/vendor/symfony/event-dispatcher-contracts/README.md +++ /dev/null @@ -1,9 +0,0 @@ -Symfony EventDispatcher Contracts -================================= - -A set of abstractions extracted out of the Symfony components. - -Can be used to build on semantics that the Symfony components proved useful - and -that already have battle tested implementations. - -See https://github.com/symfony/contracts/blob/main/README.md for more information. diff --git a/system/vendor/symfony/event-dispatcher-contracts/composer.json b/system/vendor/symfony/event-dispatcher-contracts/composer.json deleted file mode 100644 index 660df81..0000000 --- a/system/vendor/symfony/event-dispatcher-contracts/composer.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "name": "symfony/event-dispatcher-contracts", - "type": "library", - "description": "Generic abstractions related to dispatching event", - "keywords": ["abstractions", "contracts", "decoupling", "interfaces", "interoperability", "standards"], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=7.2.5", - "psr/event-dispatcher": "^1" - }, - "suggest": { - "symfony/event-dispatcher-implementation": "" - }, - "autoload": { - "psr-4": { "Symfony\\Contracts\\EventDispatcher\\": "" } - }, - "minimum-stability": "dev", - "extra": { - "branch-alias": { - "dev-main": "2.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - } -} diff --git a/system/vendor/symfony/event-dispatcher/Attribute/AsEventListener.php b/system/vendor/symfony/event-dispatcher/Attribute/AsEventListener.php deleted file mode 100644 index bb931b8..0000000 --- a/system/vendor/symfony/event-dispatcher/Attribute/AsEventListener.php +++ /dev/null @@ -1,29 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\EventDispatcher\Attribute; - -/** - * Service tag to autoconfigure event listeners. - * - * @author Alexander M. Turek - */ -#[\Attribute(\Attribute::TARGET_CLASS | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] -class AsEventListener -{ - public function __construct( - public ?string $event = null, - public ?string $method = null, - public int $priority = 0, - public ?string $dispatcher = null, - ) { - } -} diff --git a/system/vendor/symfony/event-dispatcher/CHANGELOG.md b/system/vendor/symfony/event-dispatcher/CHANGELOG.md deleted file mode 100644 index 0f98598..0000000 --- a/system/vendor/symfony/event-dispatcher/CHANGELOG.md +++ /dev/null @@ -1,91 +0,0 @@ -CHANGELOG -========= - -5.4 ---- - - * Allow `#[AsEventListener]` attribute on methods - -5.3 ---- - - * Add `#[AsEventListener]` attribute for declaring listeners on PHP 8 - -5.1.0 ------ - - * The `LegacyEventDispatcherProxy` class has been deprecated. - * Added an optional `dispatcher` attribute to the listener and subscriber tags in `RegisterListenerPass`. - -5.0.0 ------ - - * The signature of the `EventDispatcherInterface::dispatch()` method has been changed to `dispatch($event, string $eventName = null): object`. - * The `Event` class has been removed in favor of `Symfony\Contracts\EventDispatcher\Event`. - * The `TraceableEventDispatcherInterface` has been removed. - * The `WrappedListener` class is now final. - -4.4.0 ------ - - * `AddEventAliasesPass` has been added, allowing applications and bundles to extend the event alias mapping used by `RegisterListenersPass`. - * Made the `event` attribute of the `kernel.event_listener` tag optional for FQCN events. - -4.3.0 ------ - - * The signature of the `EventDispatcherInterface::dispatch()` method should be updated to `dispatch($event, string $eventName = null)`, not doing so is deprecated - * deprecated the `Event` class, use `Symfony\Contracts\EventDispatcher\Event` instead - -4.1.0 ------ - - * added support for invokable event listeners tagged with `kernel.event_listener` by default - * The `TraceableEventDispatcher::getOrphanedEvents()` method has been added. - * The `TraceableEventDispatcherInterface` has been deprecated. - -4.0.0 ------ - - * removed the `ContainerAwareEventDispatcher` class - * added the `reset()` method to the `TraceableEventDispatcherInterface` - -3.4.0 ------ - - * Implementing `TraceableEventDispatcherInterface` without the `reset()` method has been deprecated. - -3.3.0 ------ - - * The ContainerAwareEventDispatcher class has been deprecated. Use EventDispatcher with closure factories instead. - -3.0.0 ------ - - * The method `getListenerPriority($eventName, $listener)` has been added to the - `EventDispatcherInterface`. - * The methods `Event::setDispatcher()`, `Event::getDispatcher()`, `Event::setName()` - and `Event::getName()` have been removed. - The event dispatcher and the event name are passed to the listener call. - -2.5.0 ------ - - * added Debug\TraceableEventDispatcher (originally in HttpKernel) - * changed Debug\TraceableEventDispatcherInterface to extend EventDispatcherInterface - * added RegisterListenersPass (originally in HttpKernel) - -2.1.0 ------ - - * added TraceableEventDispatcherInterface - * added ContainerAwareEventDispatcher - * added a reference to the EventDispatcher on the Event - * added a reference to the Event name on the event - * added fluid interface to the dispatch() method which now returns the Event - object - * added GenericEvent event class - * added the possibility for subscribers to subscribe several times for the - same event - * added ImmutableEventDispatcher diff --git a/system/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php b/system/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php deleted file mode 100644 index acfbf61..0000000 --- a/system/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php +++ /dev/null @@ -1,366 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\EventDispatcher\Debug; - -use Psr\EventDispatcher\StoppableEventInterface; -use Psr\Log\LoggerInterface; -use Symfony\Component\EventDispatcher\EventDispatcherInterface; -use Symfony\Component\EventDispatcher\EventSubscriberInterface; -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\RequestStack; -use Symfony\Component\Stopwatch\Stopwatch; -use Symfony\Contracts\Service\ResetInterface; - -/** - * Collects some data about event listeners. - * - * This event dispatcher delegates the dispatching to another one. - * - * @author Fabien Potencier - */ -class TraceableEventDispatcher implements EventDispatcherInterface, ResetInterface -{ - protected $logger; - protected $stopwatch; - - /** - * @var \SplObjectStorage - */ - private $callStack; - private $dispatcher; - private $wrappedListeners; - private $orphanedEvents; - private $requestStack; - private $currentRequestHash = ''; - - public function __construct(EventDispatcherInterface $dispatcher, Stopwatch $stopwatch, LoggerInterface $logger = null, RequestStack $requestStack = null) - { - $this->dispatcher = $dispatcher; - $this->stopwatch = $stopwatch; - $this->logger = $logger; - $this->wrappedListeners = []; - $this->orphanedEvents = []; - $this->requestStack = $requestStack; - } - - /** - * {@inheritdoc} - */ - public function addListener(string $eventName, $listener, int $priority = 0) - { - $this->dispatcher->addListener($eventName, $listener, $priority); - } - - /** - * {@inheritdoc} - */ - public function addSubscriber(EventSubscriberInterface $subscriber) - { - $this->dispatcher->addSubscriber($subscriber); - } - - /** - * {@inheritdoc} - */ - public function removeListener(string $eventName, $listener) - { - if (isset($this->wrappedListeners[$eventName])) { - foreach ($this->wrappedListeners[$eventName] as $index => $wrappedListener) { - if ($wrappedListener->getWrappedListener() === $listener || ($listener instanceof \Closure && $wrappedListener->getWrappedListener() == $listener)) { - $listener = $wrappedListener; - unset($this->wrappedListeners[$eventName][$index]); - break; - } - } - } - - return $this->dispatcher->removeListener($eventName, $listener); - } - - /** - * {@inheritdoc} - */ - public function removeSubscriber(EventSubscriberInterface $subscriber) - { - return $this->dispatcher->removeSubscriber($subscriber); - } - - /** - * {@inheritdoc} - */ - public function getListeners(string $eventName = null) - { - return $this->dispatcher->getListeners($eventName); - } - - /** - * {@inheritdoc} - */ - public function getListenerPriority(string $eventName, $listener) - { - // we might have wrapped listeners for the event (if called while dispatching) - // in that case get the priority by wrapper - if (isset($this->wrappedListeners[$eventName])) { - foreach ($this->wrappedListeners[$eventName] as $wrappedListener) { - if ($wrappedListener->getWrappedListener() === $listener || ($listener instanceof \Closure && $wrappedListener->getWrappedListener() == $listener)) { - return $this->dispatcher->getListenerPriority($eventName, $wrappedListener); - } - } - } - - return $this->dispatcher->getListenerPriority($eventName, $listener); - } - - /** - * {@inheritdoc} - */ - public function hasListeners(string $eventName = null) - { - return $this->dispatcher->hasListeners($eventName); - } - - /** - * {@inheritdoc} - */ - public function dispatch(object $event, string $eventName = null): object - { - $eventName = $eventName ?? \get_class($event); - - if (null === $this->callStack) { - $this->callStack = new \SplObjectStorage(); - } - - $currentRequestHash = $this->currentRequestHash = $this->requestStack && ($request = $this->requestStack->getCurrentRequest()) ? spl_object_hash($request) : ''; - - if (null !== $this->logger && $event instanceof StoppableEventInterface && $event->isPropagationStopped()) { - $this->logger->debug(sprintf('The "%s" event is already stopped. No listeners have been called.', $eventName)); - } - - $this->preProcess($eventName); - try { - $this->beforeDispatch($eventName, $event); - try { - $e = $this->stopwatch->start($eventName, 'section'); - try { - $this->dispatcher->dispatch($event, $eventName); - } finally { - if ($e->isStarted()) { - $e->stop(); - } - } - } finally { - $this->afterDispatch($eventName, $event); - } - } finally { - $this->currentRequestHash = $currentRequestHash; - $this->postProcess($eventName); - } - - return $event; - } - - /** - * @return array - */ - public function getCalledListeners(Request $request = null) - { - if (null === $this->callStack) { - return []; - } - - $hash = $request ? spl_object_hash($request) : null; - $called = []; - foreach ($this->callStack as $listener) { - [$eventName, $requestHash] = $this->callStack->getInfo(); - if (null === $hash || $hash === $requestHash) { - $called[] = $listener->getInfo($eventName); - } - } - - return $called; - } - - /** - * @return array - */ - public function getNotCalledListeners(Request $request = null) - { - try { - $allListeners = $this->getListeners(); - } catch (\Exception $e) { - if (null !== $this->logger) { - $this->logger->info('An exception was thrown while getting the uncalled listeners.', ['exception' => $e]); - } - - // unable to retrieve the uncalled listeners - return []; - } - - $hash = $request ? spl_object_hash($request) : null; - $calledListeners = []; - - if (null !== $this->callStack) { - foreach ($this->callStack as $calledListener) { - [, $requestHash] = $this->callStack->getInfo(); - - if (null === $hash || $hash === $requestHash) { - $calledListeners[] = $calledListener->getWrappedListener(); - } - } - } - - $notCalled = []; - foreach ($allListeners as $eventName => $listeners) { - foreach ($listeners as $listener) { - if (!\in_array($listener, $calledListeners, true)) { - if (!$listener instanceof WrappedListener) { - $listener = new WrappedListener($listener, null, $this->stopwatch, $this); - } - $notCalled[] = $listener->getInfo($eventName); - } - } - } - - uasort($notCalled, [$this, 'sortNotCalledListeners']); - - return $notCalled; - } - - public function getOrphanedEvents(Request $request = null): array - { - if ($request) { - return $this->orphanedEvents[spl_object_hash($request)] ?? []; - } - - if (!$this->orphanedEvents) { - return []; - } - - return array_merge(...array_values($this->orphanedEvents)); - } - - public function reset() - { - $this->callStack = null; - $this->orphanedEvents = []; - $this->currentRequestHash = ''; - } - - /** - * Proxies all method calls to the original event dispatcher. - * - * @param string $method The method name - * @param array $arguments The method arguments - * - * @return mixed - */ - public function __call(string $method, array $arguments) - { - return $this->dispatcher->{$method}(...$arguments); - } - - /** - * Called before dispatching the event. - */ - protected function beforeDispatch(string $eventName, object $event) - { - } - - /** - * Called after dispatching the event. - */ - protected function afterDispatch(string $eventName, object $event) - { - } - - private function preProcess(string $eventName): void - { - if (!$this->dispatcher->hasListeners($eventName)) { - $this->orphanedEvents[$this->currentRequestHash][] = $eventName; - - return; - } - - foreach ($this->dispatcher->getListeners($eventName) as $listener) { - $priority = $this->getListenerPriority($eventName, $listener); - $wrappedListener = new WrappedListener($listener instanceof WrappedListener ? $listener->getWrappedListener() : $listener, null, $this->stopwatch, $this); - $this->wrappedListeners[$eventName][] = $wrappedListener; - $this->dispatcher->removeListener($eventName, $listener); - $this->dispatcher->addListener($eventName, $wrappedListener, $priority); - $this->callStack->attach($wrappedListener, [$eventName, $this->currentRequestHash]); - } - } - - private function postProcess(string $eventName): void - { - unset($this->wrappedListeners[$eventName]); - $skipped = false; - foreach ($this->dispatcher->getListeners($eventName) as $listener) { - if (!$listener instanceof WrappedListener) { // #12845: a new listener was added during dispatch. - continue; - } - // Unwrap listener - $priority = $this->getListenerPriority($eventName, $listener); - $this->dispatcher->removeListener($eventName, $listener); - $this->dispatcher->addListener($eventName, $listener->getWrappedListener(), $priority); - - if (null !== $this->logger) { - $context = ['event' => $eventName, 'listener' => $listener->getPretty()]; - } - - if ($listener->wasCalled()) { - if (null !== $this->logger) { - $this->logger->debug('Notified event "{event}" to listener "{listener}".', $context); - } - } else { - $this->callStack->detach($listener); - } - - if (null !== $this->logger && $skipped) { - $this->logger->debug('Listener "{listener}" was not called for event "{event}".', $context); - } - - if ($listener->stoppedPropagation()) { - if (null !== $this->logger) { - $this->logger->debug('Listener "{listener}" stopped propagation of the event "{event}".', $context); - } - - $skipped = true; - } - } - } - - private function sortNotCalledListeners(array $a, array $b) - { - if (0 !== $cmp = strcmp($a['event'], $b['event'])) { - return $cmp; - } - - if (\is_int($a['priority']) && !\is_int($b['priority'])) { - return 1; - } - - if (!\is_int($a['priority']) && \is_int($b['priority'])) { - return -1; - } - - if ($a['priority'] === $b['priority']) { - return 0; - } - - if ($a['priority'] > $b['priority']) { - return -1; - } - - return 1; - } -} diff --git a/system/vendor/symfony/event-dispatcher/Debug/WrappedListener.php b/system/vendor/symfony/event-dispatcher/Debug/WrappedListener.php deleted file mode 100644 index 3c4cc13..0000000 --- a/system/vendor/symfony/event-dispatcher/Debug/WrappedListener.php +++ /dev/null @@ -1,129 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\EventDispatcher\Debug; - -use Psr\EventDispatcher\StoppableEventInterface; -use Symfony\Component\EventDispatcher\EventDispatcherInterface; -use Symfony\Component\Stopwatch\Stopwatch; -use Symfony\Component\VarDumper\Caster\ClassStub; - -/** - * @author Fabien Potencier - */ -final class WrappedListener -{ - private $listener; - private $optimizedListener; - private $name; - private $called; - private $stoppedPropagation; - private $stopwatch; - private $dispatcher; - private $pretty; - private $stub; - private $priority; - private static $hasClassStub; - - public function __construct($listener, ?string $name, Stopwatch $stopwatch, EventDispatcherInterface $dispatcher = null) - { - $this->listener = $listener; - $this->optimizedListener = $listener instanceof \Closure ? $listener : (\is_callable($listener) ? \Closure::fromCallable($listener) : null); - $this->stopwatch = $stopwatch; - $this->dispatcher = $dispatcher; - $this->called = false; - $this->stoppedPropagation = false; - - if (\is_array($listener)) { - $this->name = \is_object($listener[0]) ? get_debug_type($listener[0]) : $listener[0]; - $this->pretty = $this->name.'::'.$listener[1]; - } elseif ($listener instanceof \Closure) { - $r = new \ReflectionFunction($listener); - if (str_contains($r->name, '{closure}')) { - $this->pretty = $this->name = 'closure'; - } elseif ($class = \PHP_VERSION_ID >= 80111 ? $r->getClosureCalledClass() : $r->getClosureScopeClass()) { - $this->name = $class->name; - $this->pretty = $this->name.'::'.$r->name; - } else { - $this->pretty = $this->name = $r->name; - } - } elseif (\is_string($listener)) { - $this->pretty = $this->name = $listener; - } else { - $this->name = get_debug_type($listener); - $this->pretty = $this->name.'::__invoke'; - } - - if (null !== $name) { - $this->name = $name; - } - - if (null === self::$hasClassStub) { - self::$hasClassStub = class_exists(ClassStub::class); - } - } - - public function getWrappedListener() - { - return $this->listener; - } - - public function wasCalled(): bool - { - return $this->called; - } - - public function stoppedPropagation(): bool - { - return $this->stoppedPropagation; - } - - public function getPretty(): string - { - return $this->pretty; - } - - public function getInfo(string $eventName): array - { - if (null === $this->stub) { - $this->stub = self::$hasClassStub ? new ClassStub($this->pretty.'()', $this->listener) : $this->pretty.'()'; - } - - return [ - 'event' => $eventName, - 'priority' => null !== $this->priority ? $this->priority : (null !== $this->dispatcher ? $this->dispatcher->getListenerPriority($eventName, $this->listener) : null), - 'pretty' => $this->pretty, - 'stub' => $this->stub, - ]; - } - - public function __invoke(object $event, string $eventName, EventDispatcherInterface $dispatcher): void - { - $dispatcher = $this->dispatcher ?: $dispatcher; - - $this->called = true; - $this->priority = $dispatcher->getListenerPriority($eventName, $this->listener); - - $e = $this->stopwatch->start($this->name, 'event_listener'); - - try { - ($this->optimizedListener ?? $this->listener)($event, $eventName, $dispatcher); - } finally { - if ($e->isStarted()) { - $e->stop(); - } - } - - if ($event instanceof StoppableEventInterface && $event->isPropagationStopped()) { - $this->stoppedPropagation = true; - } - } -} diff --git a/system/vendor/symfony/event-dispatcher/DependencyInjection/AddEventAliasesPass.php b/system/vendor/symfony/event-dispatcher/DependencyInjection/AddEventAliasesPass.php deleted file mode 100644 index 6e7292b..0000000 --- a/system/vendor/symfony/event-dispatcher/DependencyInjection/AddEventAliasesPass.php +++ /dev/null @@ -1,46 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\EventDispatcher\DependencyInjection; - -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; -use Symfony\Component\DependencyInjection\ContainerBuilder; - -/** - * This pass allows bundles to extend the list of event aliases. - * - * @author Alexander M. Turek - */ -class AddEventAliasesPass implements CompilerPassInterface -{ - private $eventAliases; - private $eventAliasesParameter; - - public function __construct(array $eventAliases, string $eventAliasesParameter = 'event_dispatcher.event_aliases') - { - if (1 < \func_num_args()) { - trigger_deprecation('symfony/event-dispatcher', '5.3', 'Configuring "%s" is deprecated.', __CLASS__); - } - - $this->eventAliases = $eventAliases; - $this->eventAliasesParameter = $eventAliasesParameter; - } - - public function process(ContainerBuilder $container): void - { - $eventAliases = $container->hasParameter($this->eventAliasesParameter) ? $container->getParameter($this->eventAliasesParameter) : []; - - $container->setParameter( - $this->eventAliasesParameter, - array_merge($eventAliases, $this->eventAliases) - ); - } -} diff --git a/system/vendor/symfony/event-dispatcher/DependencyInjection/RegisterListenersPass.php b/system/vendor/symfony/event-dispatcher/DependencyInjection/RegisterListenersPass.php deleted file mode 100644 index 5f44ff0..0000000 --- a/system/vendor/symfony/event-dispatcher/DependencyInjection/RegisterListenersPass.php +++ /dev/null @@ -1,242 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\EventDispatcher\DependencyInjection; - -use Symfony\Component\DependencyInjection\Argument\ServiceClosureArgument; -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\EventDispatcher\EventDispatcher; -use Symfony\Component\EventDispatcher\EventSubscriberInterface; -use Symfony\Contracts\EventDispatcher\Event; - -/** - * Compiler pass to register tagged services for an event dispatcher. - */ -class RegisterListenersPass implements CompilerPassInterface -{ - protected $dispatcherService; - protected $listenerTag; - protected $subscriberTag; - protected $eventAliasesParameter; - - private $hotPathEvents = []; - private $hotPathTagName = 'container.hot_path'; - private $noPreloadEvents = []; - private $noPreloadTagName = 'container.no_preload'; - - public function __construct(string $dispatcherService = 'event_dispatcher', string $listenerTag = 'kernel.event_listener', string $subscriberTag = 'kernel.event_subscriber', string $eventAliasesParameter = 'event_dispatcher.event_aliases') - { - if (0 < \func_num_args()) { - trigger_deprecation('symfony/event-dispatcher', '5.3', 'Configuring "%s" is deprecated.', __CLASS__); - } - - $this->dispatcherService = $dispatcherService; - $this->listenerTag = $listenerTag; - $this->subscriberTag = $subscriberTag; - $this->eventAliasesParameter = $eventAliasesParameter; - } - - /** - * @return $this - */ - public function setHotPathEvents(array $hotPathEvents) - { - $this->hotPathEvents = array_flip($hotPathEvents); - - if (1 < \func_num_args()) { - trigger_deprecation('symfony/event-dispatcher', '5.4', 'Configuring "$tagName" in "%s" is deprecated.', __METHOD__); - $this->hotPathTagName = func_get_arg(1); - } - - return $this; - } - - /** - * @return $this - */ - public function setNoPreloadEvents(array $noPreloadEvents): self - { - $this->noPreloadEvents = array_flip($noPreloadEvents); - - if (1 < \func_num_args()) { - trigger_deprecation('symfony/event-dispatcher', '5.4', 'Configuring "$tagName" in "%s" is deprecated.', __METHOD__); - $this->noPreloadTagName = func_get_arg(1); - } - - return $this; - } - - public function process(ContainerBuilder $container) - { - if (!$container->hasDefinition($this->dispatcherService) && !$container->hasAlias($this->dispatcherService)) { - return; - } - - $aliases = []; - - if ($container->hasParameter($this->eventAliasesParameter)) { - $aliases = $container->getParameter($this->eventAliasesParameter); - } - - $globalDispatcherDefinition = $container->findDefinition($this->dispatcherService); - - foreach ($container->findTaggedServiceIds($this->listenerTag, true) as $id => $events) { - $noPreload = 0; - - foreach ($events as $event) { - $priority = $event['priority'] ?? 0; - - if (!isset($event['event'])) { - if ($container->getDefinition($id)->hasTag($this->subscriberTag)) { - continue; - } - - $event['method'] = $event['method'] ?? '__invoke'; - $event['event'] = $this->getEventFromTypeDeclaration($container, $id, $event['method']); - } - - $event['event'] = $aliases[$event['event']] ?? $event['event']; - - if (!isset($event['method'])) { - $event['method'] = 'on'.preg_replace_callback([ - '/(?<=\b|_)[a-z]/i', - '/[^a-z0-9]/i', - ], function ($matches) { return strtoupper($matches[0]); }, $event['event']); - $event['method'] = preg_replace('/[^a-z0-9]/i', '', $event['method']); - - if (null !== ($class = $container->getDefinition($id)->getClass()) && ($r = $container->getReflectionClass($class, false)) && !$r->hasMethod($event['method'])) { - if (!$r->hasMethod('__invoke')) { - throw new InvalidArgumentException(sprintf('None of the "%s" or "__invoke" methods exist for the service "%s". Please define the "method" attribute on "%s" tags.', $event['method'], $id, $this->listenerTag)); - } - - $event['method'] = '__invoke'; - } - } - - $dispatcherDefinition = $globalDispatcherDefinition; - if (isset($event['dispatcher'])) { - $dispatcherDefinition = $container->findDefinition($event['dispatcher']); - } - - $dispatcherDefinition->addMethodCall('addListener', [$event['event'], [new ServiceClosureArgument(new Reference($id)), $event['method']], $priority]); - - if (isset($this->hotPathEvents[$event['event']])) { - $container->getDefinition($id)->addTag($this->hotPathTagName); - } elseif (isset($this->noPreloadEvents[$event['event']])) { - ++$noPreload; - } - } - - if ($noPreload && \count($events) === $noPreload) { - $container->getDefinition($id)->addTag($this->noPreloadTagName); - } - } - - $extractingDispatcher = new ExtractingEventDispatcher(); - - foreach ($container->findTaggedServiceIds($this->subscriberTag, true) as $id => $tags) { - $def = $container->getDefinition($id); - - // We must assume that the class value has been correctly filled, even if the service is created by a factory - $class = $def->getClass(); - - if (!$r = $container->getReflectionClass($class)) { - throw new InvalidArgumentException(sprintf('Class "%s" used for service "%s" cannot be found.', $class, $id)); - } - if (!$r->isSubclassOf(EventSubscriberInterface::class)) { - throw new InvalidArgumentException(sprintf('Service "%s" must implement interface "%s".', $id, EventSubscriberInterface::class)); - } - $class = $r->name; - - $dispatcherDefinitions = []; - foreach ($tags as $attributes) { - if (!isset($attributes['dispatcher']) || isset($dispatcherDefinitions[$attributes['dispatcher']])) { - continue; - } - - $dispatcherDefinitions[$attributes['dispatcher']] = $container->findDefinition($attributes['dispatcher']); - } - - if (!$dispatcherDefinitions) { - $dispatcherDefinitions = [$globalDispatcherDefinition]; - } - - $noPreload = 0; - ExtractingEventDispatcher::$aliases = $aliases; - ExtractingEventDispatcher::$subscriber = $class; - $extractingDispatcher->addSubscriber($extractingDispatcher); - foreach ($extractingDispatcher->listeners as $args) { - $args[1] = [new ServiceClosureArgument(new Reference($id)), $args[1]]; - foreach ($dispatcherDefinitions as $dispatcherDefinition) { - $dispatcherDefinition->addMethodCall('addListener', $args); - } - - if (isset($this->hotPathEvents[$args[0]])) { - $container->getDefinition($id)->addTag($this->hotPathTagName); - } elseif (isset($this->noPreloadEvents[$args[0]])) { - ++$noPreload; - } - } - if ($noPreload && \count($extractingDispatcher->listeners) === $noPreload) { - $container->getDefinition($id)->addTag($this->noPreloadTagName); - } - $extractingDispatcher->listeners = []; - ExtractingEventDispatcher::$aliases = []; - } - } - - private function getEventFromTypeDeclaration(ContainerBuilder $container, string $id, string $method): string - { - if ( - null === ($class = $container->getDefinition($id)->getClass()) - || !($r = $container->getReflectionClass($class, false)) - || !$r->hasMethod($method) - || 1 > ($m = $r->getMethod($method))->getNumberOfParameters() - || !($type = $m->getParameters()[0]->getType()) instanceof \ReflectionNamedType - || $type->isBuiltin() - || Event::class === ($name = $type->getName()) - ) { - throw new InvalidArgumentException(sprintf('Service "%s" must define the "event" attribute on "%s" tags.', $id, $this->listenerTag)); - } - - return $name; - } -} - -/** - * @internal - */ -class ExtractingEventDispatcher extends EventDispatcher implements EventSubscriberInterface -{ - public $listeners = []; - - public static $aliases = []; - public static $subscriber; - - public function addListener(string $eventName, $listener, int $priority = 0) - { - $this->listeners[] = [$eventName, $listener[1], $priority]; - } - - public static function getSubscribedEvents(): array - { - $events = []; - - foreach ([self::$subscriber, 'getSubscribedEvents']() as $eventName => $params) { - $events[self::$aliases[$eventName] ?? $eventName] = $params; - } - - return $events; - } -} diff --git a/system/vendor/symfony/event-dispatcher/EventDispatcher.php b/system/vendor/symfony/event-dispatcher/EventDispatcher.php deleted file mode 100644 index 8fe8fb5..0000000 --- a/system/vendor/symfony/event-dispatcher/EventDispatcher.php +++ /dev/null @@ -1,280 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\EventDispatcher; - -use Psr\EventDispatcher\StoppableEventInterface; -use Symfony\Component\EventDispatcher\Debug\WrappedListener; - -/** - * The EventDispatcherInterface is the central point of Symfony's event listener system. - * - * Listeners are registered on the manager and events are dispatched through the - * manager. - * - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - * @author Bernhard Schussek - * @author Fabien Potencier - * @author Jordi Boggiano - * @author Jordan Alliot - * @author Nicolas Grekas - */ -class EventDispatcher implements EventDispatcherInterface -{ - private $listeners = []; - private $sorted = []; - private $optimized; - - public function __construct() - { - if (__CLASS__ === static::class) { - $this->optimized = []; - } - } - - /** - * {@inheritdoc} - */ - public function dispatch(object $event, string $eventName = null): object - { - $eventName = $eventName ?? \get_class($event); - - if (null !== $this->optimized) { - $listeners = $this->optimized[$eventName] ?? (empty($this->listeners[$eventName]) ? [] : $this->optimizeListeners($eventName)); - } else { - $listeners = $this->getListeners($eventName); - } - - if ($listeners) { - $this->callListeners($listeners, $eventName, $event); - } - - return $event; - } - - /** - * {@inheritdoc} - */ - public function getListeners(string $eventName = null) - { - if (null !== $eventName) { - if (empty($this->listeners[$eventName])) { - return []; - } - - if (!isset($this->sorted[$eventName])) { - $this->sortListeners($eventName); - } - - return $this->sorted[$eventName]; - } - - foreach ($this->listeners as $eventName => $eventListeners) { - if (!isset($this->sorted[$eventName])) { - $this->sortListeners($eventName); - } - } - - return array_filter($this->sorted); - } - - /** - * {@inheritdoc} - */ - public function getListenerPriority(string $eventName, $listener) - { - if (empty($this->listeners[$eventName])) { - return null; - } - - if (\is_array($listener) && isset($listener[0]) && $listener[0] instanceof \Closure && 2 >= \count($listener)) { - $listener[0] = $listener[0](); - $listener[1] = $listener[1] ?? '__invoke'; - } - - foreach ($this->listeners[$eventName] as $priority => &$listeners) { - foreach ($listeners as &$v) { - if ($v !== $listener && \is_array($v) && isset($v[0]) && $v[0] instanceof \Closure && 2 >= \count($v)) { - $v[0] = $v[0](); - $v[1] = $v[1] ?? '__invoke'; - } - if ($v === $listener || ($listener instanceof \Closure && $v == $listener)) { - return $priority; - } - } - } - - return null; - } - - /** - * {@inheritdoc} - */ - public function hasListeners(string $eventName = null) - { - if (null !== $eventName) { - return !empty($this->listeners[$eventName]); - } - - foreach ($this->listeners as $eventListeners) { - if ($eventListeners) { - return true; - } - } - - return false; - } - - /** - * {@inheritdoc} - */ - public function addListener(string $eventName, $listener, int $priority = 0) - { - $this->listeners[$eventName][$priority][] = $listener; - unset($this->sorted[$eventName], $this->optimized[$eventName]); - } - - /** - * {@inheritdoc} - */ - public function removeListener(string $eventName, $listener) - { - if (empty($this->listeners[$eventName])) { - return; - } - - if (\is_array($listener) && isset($listener[0]) && $listener[0] instanceof \Closure && 2 >= \count($listener)) { - $listener[0] = $listener[0](); - $listener[1] = $listener[1] ?? '__invoke'; - } - - foreach ($this->listeners[$eventName] as $priority => &$listeners) { - foreach ($listeners as $k => &$v) { - if ($v !== $listener && \is_array($v) && isset($v[0]) && $v[0] instanceof \Closure && 2 >= \count($v)) { - $v[0] = $v[0](); - $v[1] = $v[1] ?? '__invoke'; - } - if ($v === $listener || ($listener instanceof \Closure && $v == $listener)) { - unset($listeners[$k], $this->sorted[$eventName], $this->optimized[$eventName]); - } - } - - if (!$listeners) { - unset($this->listeners[$eventName][$priority]); - } - } - } - - /** - * {@inheritdoc} - */ - public function addSubscriber(EventSubscriberInterface $subscriber) - { - foreach ($subscriber->getSubscribedEvents() as $eventName => $params) { - if (\is_string($params)) { - $this->addListener($eventName, [$subscriber, $params]); - } elseif (\is_string($params[0])) { - $this->addListener($eventName, [$subscriber, $params[0]], $params[1] ?? 0); - } else { - foreach ($params as $listener) { - $this->addListener($eventName, [$subscriber, $listener[0]], $listener[1] ?? 0); - } - } - } - } - - /** - * {@inheritdoc} - */ - public function removeSubscriber(EventSubscriberInterface $subscriber) - { - foreach ($subscriber->getSubscribedEvents() as $eventName => $params) { - if (\is_array($params) && \is_array($params[0])) { - foreach ($params as $listener) { - $this->removeListener($eventName, [$subscriber, $listener[0]]); - } - } else { - $this->removeListener($eventName, [$subscriber, \is_string($params) ? $params : $params[0]]); - } - } - } - - /** - * Triggers the listeners of an event. - * - * This method can be overridden to add functionality that is executed - * for each listener. - * - * @param callable[] $listeners The event listeners - * @param string $eventName The name of the event to dispatch - * @param object $event The event object to pass to the event handlers/listeners - */ - protected function callListeners(iterable $listeners, string $eventName, object $event) - { - $stoppable = $event instanceof StoppableEventInterface; - - foreach ($listeners as $listener) { - if ($stoppable && $event->isPropagationStopped()) { - break; - } - $listener($event, $eventName, $this); - } - } - - /** - * Sorts the internal list of listeners for the given event by priority. - */ - private function sortListeners(string $eventName) - { - krsort($this->listeners[$eventName]); - $this->sorted[$eventName] = []; - - foreach ($this->listeners[$eventName] as &$listeners) { - foreach ($listeners as $k => &$listener) { - if (\is_array($listener) && isset($listener[0]) && $listener[0] instanceof \Closure && 2 >= \count($listener)) { - $listener[0] = $listener[0](); - $listener[1] = $listener[1] ?? '__invoke'; - } - $this->sorted[$eventName][] = $listener; - } - } - } - - /** - * Optimizes the internal list of listeners for the given event by priority. - */ - private function optimizeListeners(string $eventName): array - { - krsort($this->listeners[$eventName]); - $this->optimized[$eventName] = []; - - foreach ($this->listeners[$eventName] as &$listeners) { - foreach ($listeners as &$listener) { - $closure = &$this->optimized[$eventName][]; - if (\is_array($listener) && isset($listener[0]) && $listener[0] instanceof \Closure && 2 >= \count($listener)) { - $closure = static function (...$args) use (&$listener, &$closure) { - if ($listener[0] instanceof \Closure) { - $listener[0] = $listener[0](); - $listener[1] = $listener[1] ?? '__invoke'; - } - ($closure = \Closure::fromCallable($listener))(...$args); - }; - } else { - $closure = $listener instanceof \Closure || $listener instanceof WrappedListener ? $listener : \Closure::fromCallable($listener); - } - } - } - - return $this->optimized[$eventName]; - } -} diff --git a/system/vendor/symfony/event-dispatcher/EventDispatcherInterface.php b/system/vendor/symfony/event-dispatcher/EventDispatcherInterface.php deleted file mode 100644 index cc324e1..0000000 --- a/system/vendor/symfony/event-dispatcher/EventDispatcherInterface.php +++ /dev/null @@ -1,70 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\EventDispatcher; - -use Symfony\Contracts\EventDispatcher\EventDispatcherInterface as ContractsEventDispatcherInterface; - -/** - * The EventDispatcherInterface is the central point of Symfony's event listener system. - * Listeners are registered on the manager and events are dispatched through the - * manager. - * - * @author Bernhard Schussek - */ -interface EventDispatcherInterface extends ContractsEventDispatcherInterface -{ - /** - * Adds an event listener that listens on the specified events. - * - * @param int $priority The higher this value, the earlier an event - * listener will be triggered in the chain (defaults to 0) - */ - public function addListener(string $eventName, callable $listener, int $priority = 0); - - /** - * Adds an event subscriber. - * - * The subscriber is asked for all the events it is - * interested in and added as a listener for these events. - */ - public function addSubscriber(EventSubscriberInterface $subscriber); - - /** - * Removes an event listener from the specified events. - */ - public function removeListener(string $eventName, callable $listener); - - public function removeSubscriber(EventSubscriberInterface $subscriber); - - /** - * Gets the listeners of a specific event or all listeners sorted by descending priority. - * - * @return array - */ - public function getListeners(string $eventName = null); - - /** - * Gets the listener priority for a specific event. - * - * Returns null if the event or the listener does not exist. - * - * @return int|null - */ - public function getListenerPriority(string $eventName, callable $listener); - - /** - * Checks whether an event has any registered listeners. - * - * @return bool - */ - public function hasListeners(string $eventName = null); -} diff --git a/system/vendor/symfony/event-dispatcher/EventSubscriberInterface.php b/system/vendor/symfony/event-dispatcher/EventSubscriberInterface.php deleted file mode 100644 index 2085e42..0000000 --- a/system/vendor/symfony/event-dispatcher/EventSubscriberInterface.php +++ /dev/null @@ -1,49 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\EventDispatcher; - -/** - * An EventSubscriber knows itself what events it is interested in. - * If an EventSubscriber is added to an EventDispatcherInterface, the manager invokes - * {@link getSubscribedEvents} and registers the subscriber as a listener for all - * returned events. - * - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - * @author Bernhard Schussek - */ -interface EventSubscriberInterface -{ - /** - * Returns an array of event names this subscriber wants to listen to. - * - * The array keys are event names and the value can be: - * - * * The method name to call (priority defaults to 0) - * * An array composed of the method name to call and the priority - * * An array of arrays composed of the method names to call and respective - * priorities, or 0 if unset - * - * For instance: - * - * * ['eventName' => 'methodName'] - * * ['eventName' => ['methodName', $priority]] - * * ['eventName' => [['methodName1', $priority], ['methodName2']]] - * - * The code must not depend on runtime state as it will only be called at compile time. - * All logic depending on runtime state must be put into the individual methods handling the events. - * - * @return array> - */ - public static function getSubscribedEvents(); -} diff --git a/system/vendor/symfony/event-dispatcher/GenericEvent.php b/system/vendor/symfony/event-dispatcher/GenericEvent.php deleted file mode 100644 index b32a301..0000000 --- a/system/vendor/symfony/event-dispatcher/GenericEvent.php +++ /dev/null @@ -1,182 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\EventDispatcher; - -use Symfony\Contracts\EventDispatcher\Event; - -/** - * Event encapsulation class. - * - * Encapsulates events thus decoupling the observer from the subject they encapsulate. - * - * @author Drak - * - * @implements \ArrayAccess - * @implements \IteratorAggregate - */ -class GenericEvent extends Event implements \ArrayAccess, \IteratorAggregate -{ - protected $subject; - protected $arguments; - - /** - * Encapsulate an event with $subject and $args. - * - * @param mixed $subject The subject of the event, usually an object or a callable - * @param array $arguments Arguments to store in the event - */ - public function __construct($subject = null, array $arguments = []) - { - $this->subject = $subject; - $this->arguments = $arguments; - } - - /** - * Getter for subject property. - * - * @return mixed - */ - public function getSubject() - { - return $this->subject; - } - - /** - * Get argument by key. - * - * @return mixed - * - * @throws \InvalidArgumentException if key is not found - */ - public function getArgument(string $key) - { - if ($this->hasArgument($key)) { - return $this->arguments[$key]; - } - - throw new \InvalidArgumentException(sprintf('Argument "%s" not found.', $key)); - } - - /** - * Add argument to event. - * - * @param mixed $value Value - * - * @return $this - */ - public function setArgument(string $key, $value) - { - $this->arguments[$key] = $value; - - return $this; - } - - /** - * Getter for all arguments. - * - * @return array - */ - public function getArguments() - { - return $this->arguments; - } - - /** - * Set args property. - * - * @return $this - */ - public function setArguments(array $args = []) - { - $this->arguments = $args; - - return $this; - } - - /** - * Has argument. - * - * @return bool - */ - public function hasArgument(string $key) - { - return \array_key_exists($key, $this->arguments); - } - - /** - * ArrayAccess for argument getter. - * - * @param string $key Array key - * - * @return mixed - * - * @throws \InvalidArgumentException if key does not exist in $this->args - */ - #[\ReturnTypeWillChange] - public function offsetGet($key) - { - return $this->getArgument($key); - } - - /** - * ArrayAccess for argument setter. - * - * @param string $key Array key to set - * @param mixed $value Value - * - * @return void - */ - #[\ReturnTypeWillChange] - public function offsetSet($key, $value) - { - $this->setArgument($key, $value); - } - - /** - * ArrayAccess for unset argument. - * - * @param string $key Array key - * - * @return void - */ - #[\ReturnTypeWillChange] - public function offsetUnset($key) - { - if ($this->hasArgument($key)) { - unset($this->arguments[$key]); - } - } - - /** - * ArrayAccess has argument. - * - * @param string $key Array key - * - * @return bool - */ - #[\ReturnTypeWillChange] - public function offsetExists($key) - { - return $this->hasArgument($key); - } - - /** - * IteratorAggregate for iterating over the object like an array. - * - * @return \ArrayIterator - */ - #[\ReturnTypeWillChange] - public function getIterator() - { - return new \ArrayIterator($this->arguments); - } -} diff --git a/system/vendor/symfony/event-dispatcher/ImmutableEventDispatcher.php b/system/vendor/symfony/event-dispatcher/ImmutableEventDispatcher.php deleted file mode 100644 index 568d79c..0000000 --- a/system/vendor/symfony/event-dispatcher/ImmutableEventDispatcher.php +++ /dev/null @@ -1,91 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\EventDispatcher; - -/** - * A read-only proxy for an event dispatcher. - * - * @author Bernhard Schussek - */ -class ImmutableEventDispatcher implements EventDispatcherInterface -{ - private $dispatcher; - - public function __construct(EventDispatcherInterface $dispatcher) - { - $this->dispatcher = $dispatcher; - } - - /** - * {@inheritdoc} - */ - public function dispatch(object $event, string $eventName = null): object - { - return $this->dispatcher->dispatch($event, $eventName); - } - - /** - * {@inheritdoc} - */ - public function addListener(string $eventName, $listener, int $priority = 0) - { - throw new \BadMethodCallException('Unmodifiable event dispatchers must not be modified.'); - } - - /** - * {@inheritdoc} - */ - public function addSubscriber(EventSubscriberInterface $subscriber) - { - throw new \BadMethodCallException('Unmodifiable event dispatchers must not be modified.'); - } - - /** - * {@inheritdoc} - */ - public function removeListener(string $eventName, $listener) - { - throw new \BadMethodCallException('Unmodifiable event dispatchers must not be modified.'); - } - - /** - * {@inheritdoc} - */ - public function removeSubscriber(EventSubscriberInterface $subscriber) - { - throw new \BadMethodCallException('Unmodifiable event dispatchers must not be modified.'); - } - - /** - * {@inheritdoc} - */ - public function getListeners(string $eventName = null) - { - return $this->dispatcher->getListeners($eventName); - } - - /** - * {@inheritdoc} - */ - public function getListenerPriority(string $eventName, $listener) - { - return $this->dispatcher->getListenerPriority($eventName, $listener); - } - - /** - * {@inheritdoc} - */ - public function hasListeners(string $eventName = null) - { - return $this->dispatcher->hasListeners($eventName); - } -} diff --git a/system/vendor/symfony/event-dispatcher/LICENSE b/system/vendor/symfony/event-dispatcher/LICENSE deleted file mode 100644 index 0138f8f..0000000 --- a/system/vendor/symfony/event-dispatcher/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2004-present Fabien Potencier - -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/system/vendor/symfony/event-dispatcher/LegacyEventDispatcherProxy.php b/system/vendor/symfony/event-dispatcher/LegacyEventDispatcherProxy.php deleted file mode 100644 index 6e17c8f..0000000 --- a/system/vendor/symfony/event-dispatcher/LegacyEventDispatcherProxy.php +++ /dev/null @@ -1,31 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\EventDispatcher; - -use Symfony\Contracts\EventDispatcher\EventDispatcherInterface; - -trigger_deprecation('symfony/event-dispatcher', '5.1', '%s is deprecated, use the event dispatcher without the proxy.', LegacyEventDispatcherProxy::class); - -/** - * A helper class to provide BC/FC with the legacy signature of EventDispatcherInterface::dispatch(). - * - * @author Nicolas Grekas - * - * @deprecated since Symfony 5.1 - */ -final class LegacyEventDispatcherProxy -{ - public static function decorate(?EventDispatcherInterface $dispatcher): ?EventDispatcherInterface - { - return $dispatcher; - } -} diff --git a/system/vendor/symfony/event-dispatcher/README.md b/system/vendor/symfony/event-dispatcher/README.md deleted file mode 100644 index dcdb68d..0000000 --- a/system/vendor/symfony/event-dispatcher/README.md +++ /dev/null @@ -1,15 +0,0 @@ -EventDispatcher Component -========================= - -The EventDispatcher component provides tools that allow your application -components to communicate with each other by dispatching events and listening to -them. - -Resources ---------- - - * [Documentation](https://symfony.com/doc/current/components/event_dispatcher.html) - * [Contributing](https://symfony.com/doc/current/contributing/index.html) - * [Report issues](https://github.com/symfony/symfony/issues) and - [send Pull Requests](https://github.com/symfony/symfony/pulls) - in the [main Symfony repository](https://github.com/symfony/symfony) diff --git a/system/vendor/symfony/event-dispatcher/composer.json b/system/vendor/symfony/event-dispatcher/composer.json deleted file mode 100644 index 32b42e4..0000000 --- a/system/vendor/symfony/event-dispatcher/composer.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "name": "symfony/event-dispatcher", - "type": "library", - "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", - "keywords": [], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/event-dispatcher-contracts": "^2|^3", - "symfony/polyfill-php80": "^1.16" - }, - "require-dev": { - "symfony/dependency-injection": "^4.4|^5.0|^6.0", - "symfony/expression-language": "^4.4|^5.0|^6.0", - "symfony/config": "^4.4|^5.0|^6.0", - "symfony/error-handler": "^4.4|^5.0|^6.0", - "symfony/http-foundation": "^4.4|^5.0|^6.0", - "symfony/service-contracts": "^1.1|^2|^3", - "symfony/stopwatch": "^4.4|^5.0|^6.0", - "psr/log": "^1|^2|^3" - }, - "conflict": { - "symfony/dependency-injection": "<4.4" - }, - "provide": { - "psr/event-dispatcher-implementation": "1.0", - "symfony/event-dispatcher-implementation": "2.0" - }, - "suggest": { - "symfony/dependency-injection": "", - "symfony/http-kernel": "" - }, - "autoload": { - "psr-4": { "Symfony\\Component\\EventDispatcher\\": "" }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "minimum-stability": "dev" -} diff --git a/system/vendor/symfony/finder/CHANGELOG.md b/system/vendor/symfony/finder/CHANGELOG.md deleted file mode 100644 index 6a44e87..0000000 --- a/system/vendor/symfony/finder/CHANGELOG.md +++ /dev/null @@ -1,87 +0,0 @@ -CHANGELOG -========= - -5.4.0 ------ - - * Deprecate `Comparator::setTarget()` and `Comparator::setOperator()` - * Add a constructor to `Comparator` that allows setting target and operator - * Finder's iterator has now `Symfony\Component\Finder\SplFileInfo` inner type specified - * Add recursive .gitignore files support - -5.0.0 ------ - - * added `$useNaturalSort` argument to `Finder::sortByName()` - -4.3.0 ------ - - * added Finder::ignoreVCSIgnored() to ignore files based on rules listed in .gitignore - -4.2.0 ------ - - * added $useNaturalSort option to Finder::sortByName() method - * the `Finder::sortByName()` method will have a new `$useNaturalSort` - argument in version 5.0, not defining it is deprecated - * added `Finder::reverseSorting()` to reverse the sorting - -4.0.0 ------ - - * removed `ExceptionInterface` - * removed `Symfony\Component\Finder\Iterator\FilterIterator` - -3.4.0 ------ - - * deprecated `Symfony\Component\Finder\Iterator\FilterIterator` - * added Finder::hasResults() method to check if any results were found - -3.3.0 ------ - - * added double-star matching to Glob::toRegex() - -3.0.0 ------ - - * removed deprecated classes - -2.8.0 ------ - - * deprecated adapters and related classes - -2.5.0 ------ - * added support for GLOB_BRACE in the paths passed to Finder::in() - -2.3.0 ------ - - * added a way to ignore unreadable directories (via Finder::ignoreUnreadableDirs()) - * unified the way subfolders that are not executable are handled by always throwing an AccessDeniedException exception - -2.2.0 ------ - - * added Finder::path() and Finder::notPath() methods - * added finder adapters to improve performance on specific platforms - * added support for wildcard characters (glob patterns) in the paths passed - to Finder::in() - -2.1.0 ------ - - * added Finder::sortByAccessedTime(), Finder::sortByChangedTime(), and - Finder::sortByModifiedTime() - * added Countable to Finder - * added support for an array of directories as an argument to - Finder::exclude() - * added searching based on the file content via Finder::contains() and - Finder::notContains() - * added support for the != operator in the Comparator - * [BC BREAK] filter expressions (used for file name and content) are no more - considered as regexps but glob patterns when they are enclosed in '*' or '?' diff --git a/system/vendor/symfony/finder/Comparator/Comparator.php b/system/vendor/symfony/finder/Comparator/Comparator.php deleted file mode 100644 index 3af551f..0000000 --- a/system/vendor/symfony/finder/Comparator/Comparator.php +++ /dev/null @@ -1,117 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Comparator; - -/** - * @author Fabien Potencier - */ -class Comparator -{ - private $target; - private $operator = '=='; - - public function __construct(string $target = null, string $operator = '==') - { - if (null === $target) { - trigger_deprecation('symfony/finder', '5.4', 'Constructing a "%s" without setting "$target" is deprecated.', __CLASS__); - } - - $this->target = $target; - $this->doSetOperator($operator); - } - - /** - * Gets the target value. - * - * @return string - */ - public function getTarget() - { - if (null === $this->target) { - trigger_deprecation('symfony/finder', '5.4', 'Calling "%s" without initializing the target is deprecated.', __METHOD__); - } - - return $this->target; - } - - /** - * @deprecated set the target via the constructor instead - */ - public function setTarget(string $target) - { - trigger_deprecation('symfony/finder', '5.4', '"%s" is deprecated. Set the target via the constructor instead.', __METHOD__); - - $this->target = $target; - } - - /** - * Gets the comparison operator. - * - * @return string - */ - public function getOperator() - { - return $this->operator; - } - - /** - * Sets the comparison operator. - * - * @throws \InvalidArgumentException - * - * @deprecated set the operator via the constructor instead - */ - public function setOperator(string $operator) - { - trigger_deprecation('symfony/finder', '5.4', '"%s" is deprecated. Set the operator via the constructor instead.', __METHOD__); - - $this->doSetOperator('' === $operator ? '==' : $operator); - } - - /** - * Tests against the target. - * - * @param mixed $test A test value - * - * @return bool - */ - public function test($test) - { - if (null === $this->target) { - trigger_deprecation('symfony/finder', '5.4', 'Calling "%s" without initializing the target is deprecated.', __METHOD__); - } - - switch ($this->operator) { - case '>': - return $test > $this->target; - case '>=': - return $test >= $this->target; - case '<': - return $test < $this->target; - case '<=': - return $test <= $this->target; - case '!=': - return $test != $this->target; - } - - return $test == $this->target; - } - - private function doSetOperator(string $operator): void - { - if (!\in_array($operator, ['>', '<', '>=', '<=', '==', '!='])) { - throw new \InvalidArgumentException(sprintf('Invalid operator "%s".', $operator)); - } - - $this->operator = $operator; - } -} diff --git a/system/vendor/symfony/finder/Comparator/DateComparator.php b/system/vendor/symfony/finder/Comparator/DateComparator.php deleted file mode 100644 index 8f651e1..0000000 --- a/system/vendor/symfony/finder/Comparator/DateComparator.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Comparator; - -/** - * DateCompare compiles date comparisons. - * - * @author Fabien Potencier - */ -class DateComparator extends Comparator -{ - /** - * @param string $test A comparison string - * - * @throws \InvalidArgumentException If the test is not understood - */ - public function __construct(string $test) - { - if (!preg_match('#^\s*(==|!=|[<>]=?|after|since|before|until)?\s*(.+?)\s*$#i', $test, $matches)) { - throw new \InvalidArgumentException(sprintf('Don\'t understand "%s" as a date test.', $test)); - } - - try { - $date = new \DateTime($matches[2]); - $target = $date->format('U'); - } catch (\Exception $e) { - throw new \InvalidArgumentException(sprintf('"%s" is not a valid date.', $matches[2])); - } - - $operator = $matches[1] ?? '=='; - if ('since' === $operator || 'after' === $operator) { - $operator = '>'; - } - - if ('until' === $operator || 'before' === $operator) { - $operator = '<'; - } - - parent::__construct($target, $operator); - } -} diff --git a/system/vendor/symfony/finder/Comparator/NumberComparator.php b/system/vendor/symfony/finder/Comparator/NumberComparator.php deleted file mode 100644 index dd30820..0000000 --- a/system/vendor/symfony/finder/Comparator/NumberComparator.php +++ /dev/null @@ -1,78 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Comparator; - -/** - * NumberComparator compiles a simple comparison to an anonymous - * subroutine, which you can call with a value to be tested again. - * - * Now this would be very pointless, if NumberCompare didn't understand - * magnitudes. - * - * The target value may use magnitudes of kilobytes (k, ki), - * megabytes (m, mi), or gigabytes (g, gi). Those suffixed - * with an i use the appropriate 2**n version in accordance with the - * IEC standard: http://physics.nist.gov/cuu/Units/binary.html - * - * Based on the Perl Number::Compare module. - * - * @author Fabien Potencier PHP port - * @author Richard Clamp Perl version - * @copyright 2004-2005 Fabien Potencier - * @copyright 2002 Richard Clamp - * - * @see http://physics.nist.gov/cuu/Units/binary.html - */ -class NumberComparator extends Comparator -{ - /** - * @param string|null $test A comparison string or null - * - * @throws \InvalidArgumentException If the test is not understood - */ - public function __construct(?string $test) - { - if (null === $test || !preg_match('#^\s*(==|!=|[<>]=?)?\s*([0-9\.]+)\s*([kmg]i?)?\s*$#i', $test, $matches)) { - throw new \InvalidArgumentException(sprintf('Don\'t understand "%s" as a number test.', $test ?? 'null')); - } - - $target = $matches[2]; - if (!is_numeric($target)) { - throw new \InvalidArgumentException(sprintf('Invalid number "%s".', $target)); - } - if (isset($matches[3])) { - // magnitude - switch (strtolower($matches[3])) { - case 'k': - $target *= 1000; - break; - case 'ki': - $target *= 1024; - break; - case 'm': - $target *= 1000000; - break; - case 'mi': - $target *= 1024 * 1024; - break; - case 'g': - $target *= 1000000000; - break; - case 'gi': - $target *= 1024 * 1024 * 1024; - break; - } - } - - parent::__construct($target, $matches[1] ?: '=='); - } -} diff --git a/system/vendor/symfony/finder/Exception/AccessDeniedException.php b/system/vendor/symfony/finder/Exception/AccessDeniedException.php deleted file mode 100644 index ee195ea..0000000 --- a/system/vendor/symfony/finder/Exception/AccessDeniedException.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Exception; - -/** - * @author Jean-François Simon - */ -class AccessDeniedException extends \UnexpectedValueException -{ -} diff --git a/system/vendor/symfony/finder/Exception/DirectoryNotFoundException.php b/system/vendor/symfony/finder/Exception/DirectoryNotFoundException.php deleted file mode 100644 index c6cc0f2..0000000 --- a/system/vendor/symfony/finder/Exception/DirectoryNotFoundException.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Exception; - -/** - * @author Andreas Erhard - */ -class DirectoryNotFoundException extends \InvalidArgumentException -{ -} diff --git a/system/vendor/symfony/finder/Finder.php b/system/vendor/symfony/finder/Finder.php deleted file mode 100644 index 0b56965..0000000 --- a/system/vendor/symfony/finder/Finder.php +++ /dev/null @@ -1,806 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder; - -use Symfony\Component\Finder\Comparator\DateComparator; -use Symfony\Component\Finder\Comparator\NumberComparator; -use Symfony\Component\Finder\Exception\DirectoryNotFoundException; -use Symfony\Component\Finder\Iterator\CustomFilterIterator; -use Symfony\Component\Finder\Iterator\DateRangeFilterIterator; -use Symfony\Component\Finder\Iterator\DepthRangeFilterIterator; -use Symfony\Component\Finder\Iterator\ExcludeDirectoryFilterIterator; -use Symfony\Component\Finder\Iterator\FilecontentFilterIterator; -use Symfony\Component\Finder\Iterator\FilenameFilterIterator; -use Symfony\Component\Finder\Iterator\LazyIterator; -use Symfony\Component\Finder\Iterator\SizeRangeFilterIterator; -use Symfony\Component\Finder\Iterator\SortableIterator; - -/** - * Finder allows to build rules to find files and directories. - * - * It is a thin wrapper around several specialized iterator classes. - * - * All rules may be invoked several times. - * - * All methods return the current Finder object to allow chaining: - * - * $finder = Finder::create()->files()->name('*.php')->in(__DIR__); - * - * @author Fabien Potencier - * - * @implements \IteratorAggregate - */ -class Finder implements \IteratorAggregate, \Countable -{ - public const IGNORE_VCS_FILES = 1; - public const IGNORE_DOT_FILES = 2; - public const IGNORE_VCS_IGNORED_FILES = 4; - - private $mode = 0; - private $names = []; - private $notNames = []; - private $exclude = []; - private $filters = []; - private $depths = []; - private $sizes = []; - private $followLinks = false; - private $reverseSorting = false; - private $sort = false; - private $ignore = 0; - private $dirs = []; - private $dates = []; - private $iterators = []; - private $contains = []; - private $notContains = []; - private $paths = []; - private $notPaths = []; - private $ignoreUnreadableDirs = false; - - private static $vcsPatterns = ['.svn', '_svn', 'CVS', '_darcs', '.arch-params', '.monotone', '.bzr', '.git', '.hg']; - - public function __construct() - { - $this->ignore = static::IGNORE_VCS_FILES | static::IGNORE_DOT_FILES; - } - - /** - * Creates a new Finder. - * - * @return static - */ - public static function create() - { - return new static(); - } - - /** - * Restricts the matching to directories only. - * - * @return $this - */ - public function directories() - { - $this->mode = Iterator\FileTypeFilterIterator::ONLY_DIRECTORIES; - - return $this; - } - - /** - * Restricts the matching to files only. - * - * @return $this - */ - public function files() - { - $this->mode = Iterator\FileTypeFilterIterator::ONLY_FILES; - - return $this; - } - - /** - * Adds tests for the directory depth. - * - * Usage: - * - * $finder->depth('> 1') // the Finder will start matching at level 1. - * $finder->depth('< 3') // the Finder will descend at most 3 levels of directories below the starting point. - * $finder->depth(['>= 1', '< 3']) - * - * @param string|int|string[]|int[] $levels The depth level expression or an array of depth levels - * - * @return $this - * - * @see DepthRangeFilterIterator - * @see NumberComparator - */ - public function depth($levels) - { - foreach ((array) $levels as $level) { - $this->depths[] = new Comparator\NumberComparator($level); - } - - return $this; - } - - /** - * Adds tests for file dates (last modified). - * - * The date must be something that strtotime() is able to parse: - * - * $finder->date('since yesterday'); - * $finder->date('until 2 days ago'); - * $finder->date('> now - 2 hours'); - * $finder->date('>= 2005-10-15'); - * $finder->date(['>= 2005-10-15', '<= 2006-05-27']); - * - * @param string|string[] $dates A date range string or an array of date ranges - * - * @return $this - * - * @see strtotime - * @see DateRangeFilterIterator - * @see DateComparator - */ - public function date($dates) - { - foreach ((array) $dates as $date) { - $this->dates[] = new Comparator\DateComparator($date); - } - - return $this; - } - - /** - * Adds rules that files must match. - * - * You can use patterns (delimited with / sign), globs or simple strings. - * - * $finder->name('/\.php$/') - * $finder->name('*.php') // same as above, without dot files - * $finder->name('test.php') - * $finder->name(['test.py', 'test.php']) - * - * @param string|string[] $patterns A pattern (a regexp, a glob, or a string) or an array of patterns - * - * @return $this - * - * @see FilenameFilterIterator - */ - public function name($patterns) - { - $this->names = array_merge($this->names, (array) $patterns); - - return $this; - } - - /** - * Adds rules that files must not match. - * - * @param string|string[] $patterns A pattern (a regexp, a glob, or a string) or an array of patterns - * - * @return $this - * - * @see FilenameFilterIterator - */ - public function notName($patterns) - { - $this->notNames = array_merge($this->notNames, (array) $patterns); - - return $this; - } - - /** - * Adds tests that file contents must match. - * - * Strings or PCRE patterns can be used: - * - * $finder->contains('Lorem ipsum') - * $finder->contains('/Lorem ipsum/i') - * $finder->contains(['dolor', '/ipsum/i']) - * - * @param string|string[] $patterns A pattern (string or regexp) or an array of patterns - * - * @return $this - * - * @see FilecontentFilterIterator - */ - public function contains($patterns) - { - $this->contains = array_merge($this->contains, (array) $patterns); - - return $this; - } - - /** - * Adds tests that file contents must not match. - * - * Strings or PCRE patterns can be used: - * - * $finder->notContains('Lorem ipsum') - * $finder->notContains('/Lorem ipsum/i') - * $finder->notContains(['lorem', '/dolor/i']) - * - * @param string|string[] $patterns A pattern (string or regexp) or an array of patterns - * - * @return $this - * - * @see FilecontentFilterIterator - */ - public function notContains($patterns) - { - $this->notContains = array_merge($this->notContains, (array) $patterns); - - return $this; - } - - /** - * Adds rules that filenames must match. - * - * You can use patterns (delimited with / sign) or simple strings. - * - * $finder->path('some/special/dir') - * $finder->path('/some\/special\/dir/') // same as above - * $finder->path(['some dir', 'another/dir']) - * - * Use only / as dirname separator. - * - * @param string|string[] $patterns A pattern (a regexp or a string) or an array of patterns - * - * @return $this - * - * @see FilenameFilterIterator - */ - public function path($patterns) - { - $this->paths = array_merge($this->paths, (array) $patterns); - - return $this; - } - - /** - * Adds rules that filenames must not match. - * - * You can use patterns (delimited with / sign) or simple strings. - * - * $finder->notPath('some/special/dir') - * $finder->notPath('/some\/special\/dir/') // same as above - * $finder->notPath(['some/file.txt', 'another/file.log']) - * - * Use only / as dirname separator. - * - * @param string|string[] $patterns A pattern (a regexp or a string) or an array of patterns - * - * @return $this - * - * @see FilenameFilterIterator - */ - public function notPath($patterns) - { - $this->notPaths = array_merge($this->notPaths, (array) $patterns); - - return $this; - } - - /** - * Adds tests for file sizes. - * - * $finder->size('> 10K'); - * $finder->size('<= 1Ki'); - * $finder->size(4); - * $finder->size(['> 10K', '< 20K']) - * - * @param string|int|string[]|int[] $sizes A size range string or an integer or an array of size ranges - * - * @return $this - * - * @see SizeRangeFilterIterator - * @see NumberComparator - */ - public function size($sizes) - { - foreach ((array) $sizes as $size) { - $this->sizes[] = new Comparator\NumberComparator($size); - } - - return $this; - } - - /** - * Excludes directories. - * - * Directories passed as argument must be relative to the ones defined with the `in()` method. For example: - * - * $finder->in(__DIR__)->exclude('ruby'); - * - * @param string|array $dirs A directory path or an array of directories - * - * @return $this - * - * @see ExcludeDirectoryFilterIterator - */ - public function exclude($dirs) - { - $this->exclude = array_merge($this->exclude, (array) $dirs); - - return $this; - } - - /** - * Excludes "hidden" directories and files (starting with a dot). - * - * This option is enabled by default. - * - * @return $this - * - * @see ExcludeDirectoryFilterIterator - */ - public function ignoreDotFiles(bool $ignoreDotFiles) - { - if ($ignoreDotFiles) { - $this->ignore |= static::IGNORE_DOT_FILES; - } else { - $this->ignore &= ~static::IGNORE_DOT_FILES; - } - - return $this; - } - - /** - * Forces the finder to ignore version control directories. - * - * This option is enabled by default. - * - * @return $this - * - * @see ExcludeDirectoryFilterIterator - */ - public function ignoreVCS(bool $ignoreVCS) - { - if ($ignoreVCS) { - $this->ignore |= static::IGNORE_VCS_FILES; - } else { - $this->ignore &= ~static::IGNORE_VCS_FILES; - } - - return $this; - } - - /** - * Forces Finder to obey .gitignore and ignore files based on rules listed there. - * - * This option is disabled by default. - * - * @return $this - */ - public function ignoreVCSIgnored(bool $ignoreVCSIgnored) - { - if ($ignoreVCSIgnored) { - $this->ignore |= static::IGNORE_VCS_IGNORED_FILES; - } else { - $this->ignore &= ~static::IGNORE_VCS_IGNORED_FILES; - } - - return $this; - } - - /** - * Adds VCS patterns. - * - * @see ignoreVCS() - * - * @param string|string[] $pattern VCS patterns to ignore - */ - public static function addVCSPattern($pattern) - { - foreach ((array) $pattern as $p) { - self::$vcsPatterns[] = $p; - } - - self::$vcsPatterns = array_unique(self::$vcsPatterns); - } - - /** - * Sorts files and directories by an anonymous function. - * - * The anonymous function receives two \SplFileInfo instances to compare. - * - * This can be slow as all the matching files and directories must be retrieved for comparison. - * - * @return $this - * - * @see SortableIterator - */ - public function sort(\Closure $closure) - { - $this->sort = $closure; - - return $this; - } - - /** - * Sorts files and directories by name. - * - * This can be slow as all the matching files and directories must be retrieved for comparison. - * - * @return $this - * - * @see SortableIterator - */ - public function sortByName(bool $useNaturalSort = false) - { - $this->sort = $useNaturalSort ? Iterator\SortableIterator::SORT_BY_NAME_NATURAL : Iterator\SortableIterator::SORT_BY_NAME; - - return $this; - } - - /** - * Sorts files and directories by type (directories before files), then by name. - * - * This can be slow as all the matching files and directories must be retrieved for comparison. - * - * @return $this - * - * @see SortableIterator - */ - public function sortByType() - { - $this->sort = Iterator\SortableIterator::SORT_BY_TYPE; - - return $this; - } - - /** - * Sorts files and directories by the last accessed time. - * - * This is the time that the file was last accessed, read or written to. - * - * This can be slow as all the matching files and directories must be retrieved for comparison. - * - * @return $this - * - * @see SortableIterator - */ - public function sortByAccessedTime() - { - $this->sort = Iterator\SortableIterator::SORT_BY_ACCESSED_TIME; - - return $this; - } - - /** - * Reverses the sorting. - * - * @return $this - */ - public function reverseSorting() - { - $this->reverseSorting = true; - - return $this; - } - - /** - * Sorts files and directories by the last inode changed time. - * - * This is the time that the inode information was last modified (permissions, owner, group or other metadata). - * - * On Windows, since inode is not available, changed time is actually the file creation time. - * - * This can be slow as all the matching files and directories must be retrieved for comparison. - * - * @return $this - * - * @see SortableIterator - */ - public function sortByChangedTime() - { - $this->sort = Iterator\SortableIterator::SORT_BY_CHANGED_TIME; - - return $this; - } - - /** - * Sorts files and directories by the last modified time. - * - * This is the last time the actual contents of the file were last modified. - * - * This can be slow as all the matching files and directories must be retrieved for comparison. - * - * @return $this - * - * @see SortableIterator - */ - public function sortByModifiedTime() - { - $this->sort = Iterator\SortableIterator::SORT_BY_MODIFIED_TIME; - - return $this; - } - - /** - * Filters the iterator with an anonymous function. - * - * The anonymous function receives a \SplFileInfo and must return false - * to remove files. - * - * @return $this - * - * @see CustomFilterIterator - */ - public function filter(\Closure $closure) - { - $this->filters[] = $closure; - - return $this; - } - - /** - * Forces the following of symlinks. - * - * @return $this - */ - public function followLinks() - { - $this->followLinks = true; - - return $this; - } - - /** - * Tells finder to ignore unreadable directories. - * - * By default, scanning unreadable directories content throws an AccessDeniedException. - * - * @return $this - */ - public function ignoreUnreadableDirs(bool $ignore = true) - { - $this->ignoreUnreadableDirs = $ignore; - - return $this; - } - - /** - * Searches files and directories which match defined rules. - * - * @param string|string[] $dirs A directory path or an array of directories - * - * @return $this - * - * @throws DirectoryNotFoundException if one of the directories does not exist - */ - public function in($dirs) - { - $resolvedDirs = []; - - foreach ((array) $dirs as $dir) { - if (is_dir($dir)) { - $resolvedDirs[] = [$this->normalizeDir($dir)]; - } elseif ($glob = glob($dir, (\defined('GLOB_BRACE') ? \GLOB_BRACE : 0) | \GLOB_ONLYDIR | \GLOB_NOSORT)) { - sort($glob); - $resolvedDirs[] = array_map([$this, 'normalizeDir'], $glob); - } else { - throw new DirectoryNotFoundException(sprintf('The "%s" directory does not exist.', $dir)); - } - } - - $this->dirs = array_merge($this->dirs, ...$resolvedDirs); - - return $this; - } - - /** - * Returns an Iterator for the current Finder configuration. - * - * This method implements the IteratorAggregate interface. - * - * @return \Iterator - * - * @throws \LogicException if the in() method has not been called - */ - #[\ReturnTypeWillChange] - public function getIterator() - { - if (0 === \count($this->dirs) && 0 === \count($this->iterators)) { - throw new \LogicException('You must call one of in() or append() methods before iterating over a Finder.'); - } - - if (1 === \count($this->dirs) && 0 === \count($this->iterators)) { - $iterator = $this->searchInDirectory($this->dirs[0]); - - if ($this->sort || $this->reverseSorting) { - $iterator = (new Iterator\SortableIterator($iterator, $this->sort, $this->reverseSorting))->getIterator(); - } - - return $iterator; - } - - $iterator = new \AppendIterator(); - foreach ($this->dirs as $dir) { - $iterator->append(new \IteratorIterator(new LazyIterator(function () use ($dir) { - return $this->searchInDirectory($dir); - }))); - } - - foreach ($this->iterators as $it) { - $iterator->append($it); - } - - if ($this->sort || $this->reverseSorting) { - $iterator = (new Iterator\SortableIterator($iterator, $this->sort, $this->reverseSorting))->getIterator(); - } - - return $iterator; - } - - /** - * Appends an existing set of files/directories to the finder. - * - * The set can be another Finder, an Iterator, an IteratorAggregate, or even a plain array. - * - * @return $this - * - * @throws \InvalidArgumentException when the given argument is not iterable - */ - public function append(iterable $iterator) - { - if ($iterator instanceof \IteratorAggregate) { - $this->iterators[] = $iterator->getIterator(); - } elseif ($iterator instanceof \Iterator) { - $this->iterators[] = $iterator; - } elseif (is_iterable($iterator)) { - $it = new \ArrayIterator(); - foreach ($iterator as $file) { - $file = $file instanceof \SplFileInfo ? $file : new \SplFileInfo($file); - $it[$file->getPathname()] = $file; - } - $this->iterators[] = $it; - } else { - throw new \InvalidArgumentException('Finder::append() method wrong argument type.'); - } - - return $this; - } - - /** - * Check if any results were found. - * - * @return bool - */ - public function hasResults() - { - foreach ($this->getIterator() as $_) { - return true; - } - - return false; - } - - /** - * Counts all the results collected by the iterators. - * - * @return int - */ - #[\ReturnTypeWillChange] - public function count() - { - return iterator_count($this->getIterator()); - } - - private function searchInDirectory(string $dir): \Iterator - { - $exclude = $this->exclude; - $notPaths = $this->notPaths; - - if (static::IGNORE_VCS_FILES === (static::IGNORE_VCS_FILES & $this->ignore)) { - $exclude = array_merge($exclude, self::$vcsPatterns); - } - - if (static::IGNORE_DOT_FILES === (static::IGNORE_DOT_FILES & $this->ignore)) { - $notPaths[] = '#(^|/)\..+(/|$)#'; - } - - $minDepth = 0; - $maxDepth = \PHP_INT_MAX; - - foreach ($this->depths as $comparator) { - switch ($comparator->getOperator()) { - case '>': - $minDepth = $comparator->getTarget() + 1; - break; - case '>=': - $minDepth = $comparator->getTarget(); - break; - case '<': - $maxDepth = $comparator->getTarget() - 1; - break; - case '<=': - $maxDepth = $comparator->getTarget(); - break; - default: - $minDepth = $maxDepth = $comparator->getTarget(); - } - } - - $flags = \RecursiveDirectoryIterator::SKIP_DOTS; - - if ($this->followLinks) { - $flags |= \RecursiveDirectoryIterator::FOLLOW_SYMLINKS; - } - - $iterator = new Iterator\RecursiveDirectoryIterator($dir, $flags, $this->ignoreUnreadableDirs); - - if ($exclude) { - $iterator = new Iterator\ExcludeDirectoryFilterIterator($iterator, $exclude); - } - - $iterator = new \RecursiveIteratorIterator($iterator, \RecursiveIteratorIterator::SELF_FIRST); - - if ($minDepth > 0 || $maxDepth < \PHP_INT_MAX) { - $iterator = new Iterator\DepthRangeFilterIterator($iterator, $minDepth, $maxDepth); - } - - if ($this->mode) { - $iterator = new Iterator\FileTypeFilterIterator($iterator, $this->mode); - } - - if ($this->names || $this->notNames) { - $iterator = new Iterator\FilenameFilterIterator($iterator, $this->names, $this->notNames); - } - - if ($this->contains || $this->notContains) { - $iterator = new Iterator\FilecontentFilterIterator($iterator, $this->contains, $this->notContains); - } - - if ($this->sizes) { - $iterator = new Iterator\SizeRangeFilterIterator($iterator, $this->sizes); - } - - if ($this->dates) { - $iterator = new Iterator\DateRangeFilterIterator($iterator, $this->dates); - } - - if ($this->filters) { - $iterator = new Iterator\CustomFilterIterator($iterator, $this->filters); - } - - if ($this->paths || $notPaths) { - $iterator = new Iterator\PathFilterIterator($iterator, $this->paths, $notPaths); - } - - if (static::IGNORE_VCS_IGNORED_FILES === (static::IGNORE_VCS_IGNORED_FILES & $this->ignore)) { - $iterator = new Iterator\VcsIgnoredFilterIterator($iterator, $dir); - } - - return $iterator; - } - - /** - * Normalizes given directory names by removing trailing slashes. - * - * Excluding: (s)ftp:// or ssh2.(s)ftp:// wrapper - */ - private function normalizeDir(string $dir): string - { - if ('/' === $dir) { - return $dir; - } - - $dir = rtrim($dir, '/'.\DIRECTORY_SEPARATOR); - - if (preg_match('#^(ssh2\.)?s?ftp://#', $dir)) { - $dir .= '/'; - } - - return $dir; - } -} diff --git a/system/vendor/symfony/finder/Gitignore.php b/system/vendor/symfony/finder/Gitignore.php deleted file mode 100644 index d42cca1..0000000 --- a/system/vendor/symfony/finder/Gitignore.php +++ /dev/null @@ -1,93 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder; - -/** - * Gitignore matches against text. - * - * @author Michael Voříšek - * @author Ahmed Abdou - */ -class Gitignore -{ - /** - * Returns a regexp which is the equivalent of the gitignore pattern. - * - * Format specification: https://git-scm.com/docs/gitignore#_pattern_format - */ - public static function toRegex(string $gitignoreFileContent): string - { - return self::buildRegex($gitignoreFileContent, false); - } - - public static function toRegexMatchingNegatedPatterns(string $gitignoreFileContent): string - { - return self::buildRegex($gitignoreFileContent, true); - } - - private static function buildRegex(string $gitignoreFileContent, bool $inverted): string - { - $gitignoreFileContent = preg_replace('~(? - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder; - -/** - * Glob matches globbing patterns against text. - * - * if match_glob("foo.*", "foo.bar") echo "matched\n"; - * - * // prints foo.bar and foo.baz - * $regex = glob_to_regex("foo.*"); - * for (['foo.bar', 'foo.baz', 'foo', 'bar'] as $t) - * { - * if (/$regex/) echo "matched: $car\n"; - * } - * - * Glob implements glob(3) style matching that can be used to match - * against text, rather than fetching names from a filesystem. - * - * Based on the Perl Text::Glob module. - * - * @author Fabien Potencier PHP port - * @author Richard Clamp Perl version - * @copyright 2004-2005 Fabien Potencier - * @copyright 2002 Richard Clamp - */ -class Glob -{ - /** - * Returns a regexp which is the equivalent of the glob pattern. - * - * @return string - */ - public static function toRegex(string $glob, bool $strictLeadingDot = true, bool $strictWildcardSlash = true, string $delimiter = '#') - { - $firstByte = true; - $escaping = false; - $inCurlies = 0; - $regex = ''; - $sizeGlob = \strlen($glob); - for ($i = 0; $i < $sizeGlob; ++$i) { - $car = $glob[$i]; - if ($firstByte && $strictLeadingDot && '.' !== $car) { - $regex .= '(?=[^\.])'; - } - - $firstByte = '/' === $car; - - if ($firstByte && $strictWildcardSlash && isset($glob[$i + 2]) && '**' === $glob[$i + 1].$glob[$i + 2] && (!isset($glob[$i + 3]) || '/' === $glob[$i + 3])) { - $car = '[^/]++/'; - if (!isset($glob[$i + 3])) { - $car .= '?'; - } - - if ($strictLeadingDot) { - $car = '(?=[^\.])'.$car; - } - - $car = '/(?:'.$car.')*'; - $i += 2 + isset($glob[$i + 3]); - - if ('/' === $delimiter) { - $car = str_replace('/', '\\/', $car); - } - } - - if ($delimiter === $car || '.' === $car || '(' === $car || ')' === $car || '|' === $car || '+' === $car || '^' === $car || '$' === $car) { - $regex .= "\\$car"; - } elseif ('*' === $car) { - $regex .= $escaping ? '\\*' : ($strictWildcardSlash ? '[^/]*' : '.*'); - } elseif ('?' === $car) { - $regex .= $escaping ? '\\?' : ($strictWildcardSlash ? '[^/]' : '.'); - } elseif ('{' === $car) { - $regex .= $escaping ? '\\{' : '('; - if (!$escaping) { - ++$inCurlies; - } - } elseif ('}' === $car && $inCurlies) { - $regex .= $escaping ? '}' : ')'; - if (!$escaping) { - --$inCurlies; - } - } elseif (',' === $car && $inCurlies) { - $regex .= $escaping ? ',' : '|'; - } elseif ('\\' === $car) { - if ($escaping) { - $regex .= '\\\\'; - $escaping = false; - } else { - $escaping = true; - } - - continue; - } else { - $regex .= $car; - } - $escaping = false; - } - - return $delimiter.'^'.$regex.'$'.$delimiter; - } -} diff --git a/system/vendor/symfony/finder/Iterator/CustomFilterIterator.php b/system/vendor/symfony/finder/Iterator/CustomFilterIterator.php deleted file mode 100644 index f7bf19b..0000000 --- a/system/vendor/symfony/finder/Iterator/CustomFilterIterator.php +++ /dev/null @@ -1,64 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -/** - * CustomFilterIterator filters files by applying anonymous functions. - * - * The anonymous function receives a \SplFileInfo and must return false - * to remove files. - * - * @author Fabien Potencier - * - * @extends \FilterIterator - */ -class CustomFilterIterator extends \FilterIterator -{ - private $filters = []; - - /** - * @param \Iterator $iterator The Iterator to filter - * @param callable[] $filters An array of PHP callbacks - * - * @throws \InvalidArgumentException - */ - public function __construct(\Iterator $iterator, array $filters) - { - foreach ($filters as $filter) { - if (!\is_callable($filter)) { - throw new \InvalidArgumentException('Invalid PHP callback.'); - } - } - $this->filters = $filters; - - parent::__construct($iterator); - } - - /** - * Filters the iterator values. - * - * @return bool - */ - #[\ReturnTypeWillChange] - public function accept() - { - $fileinfo = $this->current(); - - foreach ($this->filters as $filter) { - if (false === $filter($fileinfo)) { - return false; - } - } - - return true; - } -} diff --git a/system/vendor/symfony/finder/Iterator/DateRangeFilterIterator.php b/system/vendor/symfony/finder/Iterator/DateRangeFilterIterator.php deleted file mode 100644 index f592e19..0000000 --- a/system/vendor/symfony/finder/Iterator/DateRangeFilterIterator.php +++ /dev/null @@ -1,61 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -use Symfony\Component\Finder\Comparator\DateComparator; - -/** - * DateRangeFilterIterator filters out files that are not in the given date range (last modified dates). - * - * @author Fabien Potencier - * - * @extends \FilterIterator - */ -class DateRangeFilterIterator extends \FilterIterator -{ - private $comparators = []; - - /** - * @param \Iterator $iterator - * @param DateComparator[] $comparators - */ - public function __construct(\Iterator $iterator, array $comparators) - { - $this->comparators = $comparators; - - parent::__construct($iterator); - } - - /** - * Filters the iterator values. - * - * @return bool - */ - #[\ReturnTypeWillChange] - public function accept() - { - $fileinfo = $this->current(); - - if (!file_exists($fileinfo->getPathname())) { - return false; - } - - $filedate = $fileinfo->getMTime(); - foreach ($this->comparators as $compare) { - if (!$compare->test($filedate)) { - return false; - } - } - - return true; - } -} diff --git a/system/vendor/symfony/finder/Iterator/DepthRangeFilterIterator.php b/system/vendor/symfony/finder/Iterator/DepthRangeFilterIterator.php deleted file mode 100644 index f593a3f..0000000 --- a/system/vendor/symfony/finder/Iterator/DepthRangeFilterIterator.php +++ /dev/null @@ -1,51 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -/** - * DepthRangeFilterIterator limits the directory depth. - * - * @author Fabien Potencier - * - * @template-covariant TKey - * @template-covariant TValue - * - * @extends \FilterIterator - */ -class DepthRangeFilterIterator extends \FilterIterator -{ - private $minDepth = 0; - - /** - * @param \RecursiveIteratorIterator<\RecursiveIterator> $iterator The Iterator to filter - * @param int $minDepth The min depth - * @param int $maxDepth The max depth - */ - public function __construct(\RecursiveIteratorIterator $iterator, int $minDepth = 0, int $maxDepth = \PHP_INT_MAX) - { - $this->minDepth = $minDepth; - $iterator->setMaxDepth(\PHP_INT_MAX === $maxDepth ? -1 : $maxDepth); - - parent::__construct($iterator); - } - - /** - * Filters the iterator values. - * - * @return bool - */ - #[\ReturnTypeWillChange] - public function accept() - { - return $this->getInnerIterator()->getDepth() >= $this->minDepth; - } -} diff --git a/system/vendor/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.php b/system/vendor/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.php deleted file mode 100644 index 39797c8..0000000 --- a/system/vendor/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.php +++ /dev/null @@ -1,97 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -/** - * ExcludeDirectoryFilterIterator filters out directories. - * - * @author Fabien Potencier - * - * @extends \FilterIterator - * - * @implements \RecursiveIterator - */ -class ExcludeDirectoryFilterIterator extends \FilterIterator implements \RecursiveIterator -{ - private $iterator; - private $isRecursive; - private $excludedDirs = []; - private $excludedPattern; - - /** - * @param \Iterator $iterator The Iterator to filter - * @param string[] $directories An array of directories to exclude - */ - public function __construct(\Iterator $iterator, array $directories) - { - $this->iterator = $iterator; - $this->isRecursive = $iterator instanceof \RecursiveIterator; - $patterns = []; - foreach ($directories as $directory) { - $directory = rtrim($directory, '/'); - if (!$this->isRecursive || str_contains($directory, '/')) { - $patterns[] = preg_quote($directory, '#'); - } else { - $this->excludedDirs[$directory] = true; - } - } - if ($patterns) { - $this->excludedPattern = '#(?:^|/)(?:'.implode('|', $patterns).')(?:/|$)#'; - } - - parent::__construct($iterator); - } - - /** - * Filters the iterator values. - * - * @return bool - */ - #[\ReturnTypeWillChange] - public function accept() - { - if ($this->isRecursive && isset($this->excludedDirs[$this->getFilename()]) && $this->isDir()) { - return false; - } - - if ($this->excludedPattern) { - $path = $this->isDir() ? $this->current()->getRelativePathname() : $this->current()->getRelativePath(); - $path = str_replace('\\', '/', $path); - - return !preg_match($this->excludedPattern, $path); - } - - return true; - } - - /** - * @return bool - */ - #[\ReturnTypeWillChange] - public function hasChildren() - { - return $this->isRecursive && $this->iterator->hasChildren(); - } - - /** - * @return self - */ - #[\ReturnTypeWillChange] - public function getChildren() - { - $children = new self($this->iterator->getChildren(), []); - $children->excludedDirs = $this->excludedDirs; - $children->excludedPattern = $this->excludedPattern; - - return $children; - } -} diff --git a/system/vendor/symfony/finder/Iterator/FileTypeFilterIterator.php b/system/vendor/symfony/finder/Iterator/FileTypeFilterIterator.php deleted file mode 100644 index 793ae35..0000000 --- a/system/vendor/symfony/finder/Iterator/FileTypeFilterIterator.php +++ /dev/null @@ -1,56 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -/** - * FileTypeFilterIterator only keeps files, directories, or both. - * - * @author Fabien Potencier - * - * @extends \FilterIterator - */ -class FileTypeFilterIterator extends \FilterIterator -{ - public const ONLY_FILES = 1; - public const ONLY_DIRECTORIES = 2; - - private $mode; - - /** - * @param \Iterator $iterator The Iterator to filter - * @param int $mode The mode (self::ONLY_FILES or self::ONLY_DIRECTORIES) - */ - public function __construct(\Iterator $iterator, int $mode) - { - $this->mode = $mode; - - parent::__construct($iterator); - } - - /** - * Filters the iterator values. - * - * @return bool - */ - #[\ReturnTypeWillChange] - public function accept() - { - $fileinfo = $this->current(); - if (self::ONLY_DIRECTORIES === (self::ONLY_DIRECTORIES & $this->mode) && $fileinfo->isFile()) { - return false; - } elseif (self::ONLY_FILES === (self::ONLY_FILES & $this->mode) && $fileinfo->isDir()) { - return false; - } - - return true; - } -} diff --git a/system/vendor/symfony/finder/Iterator/FilecontentFilterIterator.php b/system/vendor/symfony/finder/Iterator/FilecontentFilterIterator.php deleted file mode 100644 index 79f8c29..0000000 --- a/system/vendor/symfony/finder/Iterator/FilecontentFilterIterator.php +++ /dev/null @@ -1,61 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -/** - * FilecontentFilterIterator filters files by their contents using patterns (regexps or strings). - * - * @author Fabien Potencier - * @author Włodzimierz Gajda - * - * @extends MultiplePcreFilterIterator - */ -class FilecontentFilterIterator extends MultiplePcreFilterIterator -{ - /** - * Filters the iterator values. - * - * @return bool - */ - #[\ReturnTypeWillChange] - public function accept() - { - if (!$this->matchRegexps && !$this->noMatchRegexps) { - return true; - } - - $fileinfo = $this->current(); - - if ($fileinfo->isDir() || !$fileinfo->isReadable()) { - return false; - } - - $content = $fileinfo->getContents(); - if (!$content) { - return false; - } - - return $this->isAccepted($content); - } - - /** - * Converts string to regexp if necessary. - * - * @param string $str Pattern: string or regexp - * - * @return string - */ - protected function toRegex(string $str) - { - return $this->isRegex($str) ? $str : '/'.preg_quote($str, '/').'/'; - } -} diff --git a/system/vendor/symfony/finder/Iterator/FilenameFilterIterator.php b/system/vendor/symfony/finder/Iterator/FilenameFilterIterator.php deleted file mode 100644 index 77b3b24..0000000 --- a/system/vendor/symfony/finder/Iterator/FilenameFilterIterator.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -use Symfony\Component\Finder\Glob; - -/** - * FilenameFilterIterator filters files by patterns (a regexp, a glob, or a string). - * - * @author Fabien Potencier - * - * @extends MultiplePcreFilterIterator - */ -class FilenameFilterIterator extends MultiplePcreFilterIterator -{ - /** - * Filters the iterator values. - * - * @return bool - */ - #[\ReturnTypeWillChange] - public function accept() - { - return $this->isAccepted($this->current()->getFilename()); - } - - /** - * Converts glob to regexp. - * - * PCRE patterns are left unchanged. - * Glob strings are transformed with Glob::toRegex(). - * - * @param string $str Pattern: glob or regexp - * - * @return string - */ - protected function toRegex(string $str) - { - return $this->isRegex($str) ? $str : Glob::toRegex($str); - } -} diff --git a/system/vendor/symfony/finder/Iterator/LazyIterator.php b/system/vendor/symfony/finder/Iterator/LazyIterator.php deleted file mode 100644 index 32cc37f..0000000 --- a/system/vendor/symfony/finder/Iterator/LazyIterator.php +++ /dev/null @@ -1,32 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -/** - * @author Jérémy Derussé - * - * @internal - */ -class LazyIterator implements \IteratorAggregate -{ - private $iteratorFactory; - - public function __construct(callable $iteratorFactory) - { - $this->iteratorFactory = $iteratorFactory; - } - - public function getIterator(): \Traversable - { - yield from ($this->iteratorFactory)(); - } -} diff --git a/system/vendor/symfony/finder/Iterator/MultiplePcreFilterIterator.php b/system/vendor/symfony/finder/Iterator/MultiplePcreFilterIterator.php deleted file mode 100644 index 564765d..0000000 --- a/system/vendor/symfony/finder/Iterator/MultiplePcreFilterIterator.php +++ /dev/null @@ -1,117 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -/** - * MultiplePcreFilterIterator filters files using patterns (regexps, globs or strings). - * - * @author Fabien Potencier - * - * @template-covariant TKey - * @template-covariant TValue - * - * @extends \FilterIterator - */ -abstract class MultiplePcreFilterIterator extends \FilterIterator -{ - protected $matchRegexps = []; - protected $noMatchRegexps = []; - - /** - * @param \Iterator $iterator The Iterator to filter - * @param string[] $matchPatterns An array of patterns that need to match - * @param string[] $noMatchPatterns An array of patterns that need to not match - */ - public function __construct(\Iterator $iterator, array $matchPatterns, array $noMatchPatterns) - { - foreach ($matchPatterns as $pattern) { - $this->matchRegexps[] = $this->toRegex($pattern); - } - - foreach ($noMatchPatterns as $pattern) { - $this->noMatchRegexps[] = $this->toRegex($pattern); - } - - parent::__construct($iterator); - } - - /** - * Checks whether the string is accepted by the regex filters. - * - * If there is no regexps defined in the class, this method will accept the string. - * Such case can be handled by child classes before calling the method if they want to - * apply a different behavior. - * - * @return bool - */ - protected function isAccepted(string $string) - { - // should at least not match one rule to exclude - foreach ($this->noMatchRegexps as $regex) { - if (preg_match($regex, $string)) { - return false; - } - } - - // should at least match one rule - if ($this->matchRegexps) { - foreach ($this->matchRegexps as $regex) { - if (preg_match($regex, $string)) { - return true; - } - } - - return false; - } - - // If there is no match rules, the file is accepted - return true; - } - - /** - * Checks whether the string is a regex. - * - * @return bool - */ - protected function isRegex(string $str) - { - $availableModifiers = 'imsxuADU'; - - if (\PHP_VERSION_ID >= 80200) { - $availableModifiers .= 'n'; - } - - if (preg_match('/^(.{3,}?)['.$availableModifiers.']*$/', $str, $m)) { - $start = substr($m[1], 0, 1); - $end = substr($m[1], -1); - - if ($start === $end) { - return !preg_match('/[*?[:alnum:] \\\\]/', $start); - } - - foreach ([['{', '}'], ['(', ')'], ['[', ']'], ['<', '>']] as $delimiters) { - if ($start === $delimiters[0] && $end === $delimiters[1]) { - return true; - } - } - } - - return false; - } - - /** - * Converts string into regexp. - * - * @return string - */ - abstract protected function toRegex(string $str); -} diff --git a/system/vendor/symfony/finder/Iterator/PathFilterIterator.php b/system/vendor/symfony/finder/Iterator/PathFilterIterator.php deleted file mode 100644 index 7974c4e..0000000 --- a/system/vendor/symfony/finder/Iterator/PathFilterIterator.php +++ /dev/null @@ -1,59 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -/** - * PathFilterIterator filters files by path patterns (e.g. some/special/dir). - * - * @author Fabien Potencier - * @author Włodzimierz Gajda - * - * @extends MultiplePcreFilterIterator - */ -class PathFilterIterator extends MultiplePcreFilterIterator -{ - /** - * Filters the iterator values. - * - * @return bool - */ - #[\ReturnTypeWillChange] - public function accept() - { - $filename = $this->current()->getRelativePathname(); - - if ('\\' === \DIRECTORY_SEPARATOR) { - $filename = str_replace('\\', '/', $filename); - } - - return $this->isAccepted($filename); - } - - /** - * Converts strings to regexp. - * - * PCRE patterns are left unchanged. - * - * Default conversion: - * 'lorem/ipsum/dolor' ==> 'lorem\/ipsum\/dolor/' - * - * Use only / as directory separator (on Windows also). - * - * @param string $str Pattern: regexp or dirname - * - * @return string - */ - protected function toRegex(string $str) - { - return $this->isRegex($str) ? $str : '/'.preg_quote($str, '/').'/'; - } -} diff --git a/system/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php b/system/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php deleted file mode 100644 index 886dae5..0000000 --- a/system/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php +++ /dev/null @@ -1,157 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -use Symfony\Component\Finder\Exception\AccessDeniedException; -use Symfony\Component\Finder\SplFileInfo; - -/** - * Extends the \RecursiveDirectoryIterator to support relative paths. - * - * @author Victor Berchet - */ -class RecursiveDirectoryIterator extends \RecursiveDirectoryIterator -{ - /** - * @var bool - */ - private $ignoreUnreadableDirs; - - /** - * @var bool - */ - private $ignoreFirstRewind = true; - - // these 3 properties take part of the performance optimization to avoid redoing the same work in all iterations - private $rootPath; - private $subPath; - private $directorySeparator = '/'; - - /** - * @throws \RuntimeException - */ - public function __construct(string $path, int $flags, bool $ignoreUnreadableDirs = false) - { - if ($flags & (self::CURRENT_AS_PATHNAME | self::CURRENT_AS_SELF)) { - throw new \RuntimeException('This iterator only support returning current as fileinfo.'); - } - - parent::__construct($path, $flags); - $this->ignoreUnreadableDirs = $ignoreUnreadableDirs; - $this->rootPath = $path; - if ('/' !== \DIRECTORY_SEPARATOR && !($flags & self::UNIX_PATHS)) { - $this->directorySeparator = \DIRECTORY_SEPARATOR; - } - } - - /** - * Return an instance of SplFileInfo with support for relative paths. - * - * @return SplFileInfo - */ - #[\ReturnTypeWillChange] - public function current() - { - // the logic here avoids redoing the same work in all iterations - - if (null === $subPathname = $this->subPath) { - $subPathname = $this->subPath = $this->getSubPath(); - } - if ('' !== $subPathname) { - $subPathname .= $this->directorySeparator; - } - $subPathname .= $this->getFilename(); - - if ('/' !== $basePath = $this->rootPath) { - $basePath .= $this->directorySeparator; - } - - return new SplFileInfo($basePath.$subPathname, $this->subPath, $subPathname); - } - - /** - * @param bool $allowLinks - * - * @return bool - */ - #[\ReturnTypeWillChange] - public function hasChildren($allowLinks = false) - { - $hasChildren = parent::hasChildren($allowLinks); - - if (!$hasChildren || !$this->ignoreUnreadableDirs) { - return $hasChildren; - } - - try { - parent::getChildren(); - - return true; - } catch (\UnexpectedValueException $e) { - // If directory is unreadable and finder is set to ignore it, skip children - return false; - } - } - - /** - * @return \RecursiveDirectoryIterator - * - * @throws AccessDeniedException - */ - #[\ReturnTypeWillChange] - public function getChildren() - { - try { - $children = parent::getChildren(); - - if ($children instanceof self) { - // parent method will call the constructor with default arguments, so unreadable dirs won't be ignored anymore - $children->ignoreUnreadableDirs = $this->ignoreUnreadableDirs; - - // performance optimization to avoid redoing the same work in all children - $children->rootPath = $this->rootPath; - } - - return $children; - } catch (\UnexpectedValueException $e) { - throw new AccessDeniedException($e->getMessage(), $e->getCode(), $e); - } - } - - /** - * @return void - */ - #[\ReturnTypeWillChange] - public function next() - { - $this->ignoreFirstRewind = false; - - parent::next(); - } - - /** - * @return void - */ - #[\ReturnTypeWillChange] - public function rewind() - { - // some streams like FTP are not rewindable, ignore the first rewind after creation, - // as newly created DirectoryIterator does not need to be rewound - if ($this->ignoreFirstRewind) { - $this->ignoreFirstRewind = false; - - return; - } - - parent::rewind(); - } -} diff --git a/system/vendor/symfony/finder/Iterator/SizeRangeFilterIterator.php b/system/vendor/symfony/finder/Iterator/SizeRangeFilterIterator.php deleted file mode 100644 index 575bf29..0000000 --- a/system/vendor/symfony/finder/Iterator/SizeRangeFilterIterator.php +++ /dev/null @@ -1,60 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -use Symfony\Component\Finder\Comparator\NumberComparator; - -/** - * SizeRangeFilterIterator filters out files that are not in the given size range. - * - * @author Fabien Potencier - * - * @extends \FilterIterator - */ -class SizeRangeFilterIterator extends \FilterIterator -{ - private $comparators = []; - - /** - * @param \Iterator $iterator - * @param NumberComparator[] $comparators - */ - public function __construct(\Iterator $iterator, array $comparators) - { - $this->comparators = $comparators; - - parent::__construct($iterator); - } - - /** - * Filters the iterator values. - * - * @return bool - */ - #[\ReturnTypeWillChange] - public function accept() - { - $fileinfo = $this->current(); - if (!$fileinfo->isFile()) { - return true; - } - - $filesize = $fileinfo->getSize(); - foreach ($this->comparators as $compare) { - if (!$compare->test($filesize)) { - return false; - } - } - - return true; - } -} diff --git a/system/vendor/symfony/finder/Iterator/SortableIterator.php b/system/vendor/symfony/finder/Iterator/SortableIterator.php deleted file mode 100644 index 9afde5c..0000000 --- a/system/vendor/symfony/finder/Iterator/SortableIterator.php +++ /dev/null @@ -1,104 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -/** - * SortableIterator applies a sort on a given Iterator. - * - * @author Fabien Potencier - * - * @implements \IteratorAggregate - */ -class SortableIterator implements \IteratorAggregate -{ - public const SORT_BY_NONE = 0; - public const SORT_BY_NAME = 1; - public const SORT_BY_TYPE = 2; - public const SORT_BY_ACCESSED_TIME = 3; - public const SORT_BY_CHANGED_TIME = 4; - public const SORT_BY_MODIFIED_TIME = 5; - public const SORT_BY_NAME_NATURAL = 6; - - private $iterator; - private $sort; - - /** - * @param \Traversable $iterator - * @param int|callable $sort The sort type (SORT_BY_NAME, SORT_BY_TYPE, or a PHP callback) - * - * @throws \InvalidArgumentException - */ - public function __construct(\Traversable $iterator, $sort, bool $reverseOrder = false) - { - $this->iterator = $iterator; - $order = $reverseOrder ? -1 : 1; - - if (self::SORT_BY_NAME === $sort) { - $this->sort = static function (\SplFileInfo $a, \SplFileInfo $b) use ($order) { - return $order * strcmp($a->getRealPath() ?: $a->getPathname(), $b->getRealPath() ?: $b->getPathname()); - }; - } elseif (self::SORT_BY_NAME_NATURAL === $sort) { - $this->sort = static function (\SplFileInfo $a, \SplFileInfo $b) use ($order) { - return $order * strnatcmp($a->getRealPath() ?: $a->getPathname(), $b->getRealPath() ?: $b->getPathname()); - }; - } elseif (self::SORT_BY_TYPE === $sort) { - $this->sort = static function (\SplFileInfo $a, \SplFileInfo $b) use ($order) { - if ($a->isDir() && $b->isFile()) { - return -$order; - } elseif ($a->isFile() && $b->isDir()) { - return $order; - } - - return $order * strcmp($a->getRealPath() ?: $a->getPathname(), $b->getRealPath() ?: $b->getPathname()); - }; - } elseif (self::SORT_BY_ACCESSED_TIME === $sort) { - $this->sort = static function (\SplFileInfo $a, \SplFileInfo $b) use ($order) { - return $order * ($a->getATime() - $b->getATime()); - }; - } elseif (self::SORT_BY_CHANGED_TIME === $sort) { - $this->sort = static function (\SplFileInfo $a, \SplFileInfo $b) use ($order) { - return $order * ($a->getCTime() - $b->getCTime()); - }; - } elseif (self::SORT_BY_MODIFIED_TIME === $sort) { - $this->sort = static function (\SplFileInfo $a, \SplFileInfo $b) use ($order) { - return $order * ($a->getMTime() - $b->getMTime()); - }; - } elseif (self::SORT_BY_NONE === $sort) { - $this->sort = $order; - } elseif (\is_callable($sort)) { - $this->sort = $reverseOrder ? static function (\SplFileInfo $a, \SplFileInfo $b) use ($sort) { return -$sort($a, $b); } : $sort; - } else { - throw new \InvalidArgumentException('The SortableIterator takes a PHP callable or a valid built-in sort algorithm as an argument.'); - } - } - - /** - * @return \Traversable - */ - #[\ReturnTypeWillChange] - public function getIterator() - { - if (1 === $this->sort) { - return $this->iterator; - } - - $array = iterator_to_array($this->iterator, true); - - if (-1 === $this->sort) { - $array = array_reverse($array); - } else { - uasort($array, $this->sort); - } - - return new \ArrayIterator($array); - } -} diff --git a/system/vendor/symfony/finder/Iterator/VcsIgnoredFilterIterator.php b/system/vendor/symfony/finder/Iterator/VcsIgnoredFilterIterator.php deleted file mode 100644 index e27158c..0000000 --- a/system/vendor/symfony/finder/Iterator/VcsIgnoredFilterIterator.php +++ /dev/null @@ -1,151 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -use Symfony\Component\Finder\Gitignore; - -final class VcsIgnoredFilterIterator extends \FilterIterator -{ - /** - * @var string - */ - private $baseDir; - - /** - * @var array - */ - private $gitignoreFilesCache = []; - - /** - * @var array - */ - private $ignoredPathsCache = []; - - public function __construct(\Iterator $iterator, string $baseDir) - { - $this->baseDir = $this->normalizePath($baseDir); - - parent::__construct($iterator); - } - - public function accept(): bool - { - $file = $this->current(); - - $fileRealPath = $this->normalizePath($file->getRealPath()); - - return !$this->isIgnored($fileRealPath); - } - - private function isIgnored(string $fileRealPath): bool - { - if (is_dir($fileRealPath) && !str_ends_with($fileRealPath, '/')) { - $fileRealPath .= '/'; - } - - if (isset($this->ignoredPathsCache[$fileRealPath])) { - return $this->ignoredPathsCache[$fileRealPath]; - } - - $ignored = false; - - foreach ($this->parentsDirectoryDownward($fileRealPath) as $parentDirectory) { - if ($this->isIgnored($parentDirectory)) { - // rules in ignored directories are ignored, no need to check further. - break; - } - - $fileRelativePath = substr($fileRealPath, \strlen($parentDirectory) + 1); - - if (null === $regexps = $this->readGitignoreFile("{$parentDirectory}/.gitignore")) { - continue; - } - - [$exclusionRegex, $inclusionRegex] = $regexps; - - if (preg_match($exclusionRegex, $fileRelativePath)) { - $ignored = true; - - continue; - } - - if (preg_match($inclusionRegex, $fileRelativePath)) { - $ignored = false; - } - } - - return $this->ignoredPathsCache[$fileRealPath] = $ignored; - } - - /** - * @return list - */ - private function parentsDirectoryDownward(string $fileRealPath): array - { - $parentDirectories = []; - - $parentDirectory = $fileRealPath; - - while (true) { - $newParentDirectory = \dirname($parentDirectory); - - // dirname('/') = '/' - if ($newParentDirectory === $parentDirectory) { - break; - } - - $parentDirectory = $newParentDirectory; - - if (0 !== strpos($parentDirectory, $this->baseDir)) { - break; - } - - $parentDirectories[] = $parentDirectory; - } - - return array_reverse($parentDirectories); - } - - /** - * @return array{0: string, 1: string}|null - */ - private function readGitignoreFile(string $path): ?array - { - if (\array_key_exists($path, $this->gitignoreFilesCache)) { - return $this->gitignoreFilesCache[$path]; - } - - if (!file_exists($path)) { - return $this->gitignoreFilesCache[$path] = null; - } - - if (!is_file($path) || !is_readable($path)) { - throw new \RuntimeException("The \"ignoreVCSIgnored\" option cannot be used by the Finder as the \"{$path}\" file is not readable."); - } - - $gitignoreFileContent = file_get_contents($path); - - return $this->gitignoreFilesCache[$path] = [ - Gitignore::toRegex($gitignoreFileContent), - Gitignore::toRegexMatchingNegatedPatterns($gitignoreFileContent), - ]; - } - - private function normalizePath(string $path): string - { - if ('\\' === \DIRECTORY_SEPARATOR) { - return str_replace('\\', '/', $path); - } - - return $path; - } -} diff --git a/system/vendor/symfony/finder/LICENSE b/system/vendor/symfony/finder/LICENSE deleted file mode 100644 index 0138f8f..0000000 --- a/system/vendor/symfony/finder/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2004-present Fabien Potencier - -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/system/vendor/symfony/finder/README.md b/system/vendor/symfony/finder/README.md deleted file mode 100644 index 22bdeb9..0000000 --- a/system/vendor/symfony/finder/README.md +++ /dev/null @@ -1,14 +0,0 @@ -Finder Component -================ - -The Finder component finds files and directories via an intuitive fluent -interface. - -Resources ---------- - - * [Documentation](https://symfony.com/doc/current/components/finder.html) - * [Contributing](https://symfony.com/doc/current/contributing/index.html) - * [Report issues](https://github.com/symfony/symfony/issues) and - [send Pull Requests](https://github.com/symfony/symfony/pulls) - in the [main Symfony repository](https://github.com/symfony/symfony) diff --git a/system/vendor/symfony/finder/SplFileInfo.php b/system/vendor/symfony/finder/SplFileInfo.php deleted file mode 100644 index 11604a2..0000000 --- a/system/vendor/symfony/finder/SplFileInfo.php +++ /dev/null @@ -1,88 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder; - -/** - * Extends \SplFileInfo to support relative paths. - * - * @author Fabien Potencier - */ -class SplFileInfo extends \SplFileInfo -{ - private $relativePath; - private $relativePathname; - - /** - * @param string $file The file name - * @param string $relativePath The relative path - * @param string $relativePathname The relative path name - */ - public function __construct(string $file, string $relativePath, string $relativePathname) - { - parent::__construct($file); - $this->relativePath = $relativePath; - $this->relativePathname = $relativePathname; - } - - /** - * Returns the relative path. - * - * This path does not contain the file name. - * - * @return string - */ - public function getRelativePath() - { - return $this->relativePath; - } - - /** - * Returns the relative path name. - * - * This path contains the file name. - * - * @return string - */ - public function getRelativePathname() - { - return $this->relativePathname; - } - - public function getFilenameWithoutExtension(): string - { - $filename = $this->getFilename(); - - return pathinfo($filename, \PATHINFO_FILENAME); - } - - /** - * Returns the contents of the file. - * - * @return string - * - * @throws \RuntimeException - */ - public function getContents() - { - set_error_handler(function ($type, $msg) use (&$error) { $error = $msg; }); - try { - $content = file_get_contents($this->getPathname()); - } finally { - restore_error_handler(); - } - if (false === $content) { - throw new \RuntimeException($error); - } - - return $content; - } -} diff --git a/system/vendor/symfony/finder/composer.json b/system/vendor/symfony/finder/composer.json deleted file mode 100644 index ef19911..0000000 --- a/system/vendor/symfony/finder/composer.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "name": "symfony/finder", - "type": "library", - "description": "Finds files and directories via an intuitive fluent interface", - "keywords": [], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-php80": "^1.16" - }, - "autoload": { - "psr-4": { "Symfony\\Component\\Finder\\": "" }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "minimum-stability": "dev" -} diff --git a/system/vendor/symfony/polyfill-ctype/Ctype.php b/system/vendor/symfony/polyfill-ctype/Ctype.php deleted file mode 100644 index ba75a2c..0000000 --- a/system/vendor/symfony/polyfill-ctype/Ctype.php +++ /dev/null @@ -1,232 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Polyfill\Ctype; - -/** - * Ctype implementation through regex. - * - * @internal - * - * @author Gert de Pagter - */ -final class Ctype -{ - /** - * Returns TRUE if every character in text is either a letter or a digit, FALSE otherwise. - * - * @see https://php.net/ctype-alnum - * - * @param mixed $text - * - * @return bool - */ - public static function ctype_alnum($text) - { - $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); - - return \is_string($text) && '' !== $text && !preg_match('/[^A-Za-z0-9]/', $text); - } - - /** - * Returns TRUE if every character in text is a letter, FALSE otherwise. - * - * @see https://php.net/ctype-alpha - * - * @param mixed $text - * - * @return bool - */ - public static function ctype_alpha($text) - { - $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); - - return \is_string($text) && '' !== $text && !preg_match('/[^A-Za-z]/', $text); - } - - /** - * Returns TRUE if every character in text is a control character from the current locale, FALSE otherwise. - * - * @see https://php.net/ctype-cntrl - * - * @param mixed $text - * - * @return bool - */ - public static function ctype_cntrl($text) - { - $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); - - return \is_string($text) && '' !== $text && !preg_match('/[^\x00-\x1f\x7f]/', $text); - } - - /** - * Returns TRUE if every character in the string text is a decimal digit, FALSE otherwise. - * - * @see https://php.net/ctype-digit - * - * @param mixed $text - * - * @return bool - */ - public static function ctype_digit($text) - { - $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); - - return \is_string($text) && '' !== $text && !preg_match('/[^0-9]/', $text); - } - - /** - * Returns TRUE if every character in text is printable and actually creates visible output (no white space), FALSE otherwise. - * - * @see https://php.net/ctype-graph - * - * @param mixed $text - * - * @return bool - */ - public static function ctype_graph($text) - { - $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); - - return \is_string($text) && '' !== $text && !preg_match('/[^!-~]/', $text); - } - - /** - * Returns TRUE if every character in text is a lowercase letter. - * - * @see https://php.net/ctype-lower - * - * @param mixed $text - * - * @return bool - */ - public static function ctype_lower($text) - { - $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); - - return \is_string($text) && '' !== $text && !preg_match('/[^a-z]/', $text); - } - - /** - * Returns TRUE if every character in text will actually create output (including blanks). Returns FALSE if text contains control characters or characters that do not have any output or control function at all. - * - * @see https://php.net/ctype-print - * - * @param mixed $text - * - * @return bool - */ - public static function ctype_print($text) - { - $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); - - return \is_string($text) && '' !== $text && !preg_match('/[^ -~]/', $text); - } - - /** - * Returns TRUE if every character in text is printable, but neither letter, digit or blank, FALSE otherwise. - * - * @see https://php.net/ctype-punct - * - * @param mixed $text - * - * @return bool - */ - public static function ctype_punct($text) - { - $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); - - return \is_string($text) && '' !== $text && !preg_match('/[^!-\/\:-@\[-`\{-~]/', $text); - } - - /** - * Returns TRUE if every character in text creates some sort of white space, FALSE otherwise. Besides the blank character this also includes tab, vertical tab, line feed, carriage return and form feed characters. - * - * @see https://php.net/ctype-space - * - * @param mixed $text - * - * @return bool - */ - public static function ctype_space($text) - { - $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); - - return \is_string($text) && '' !== $text && !preg_match('/[^\s]/', $text); - } - - /** - * Returns TRUE if every character in text is an uppercase letter. - * - * @see https://php.net/ctype-upper - * - * @param mixed $text - * - * @return bool - */ - public static function ctype_upper($text) - { - $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); - - return \is_string($text) && '' !== $text && !preg_match('/[^A-Z]/', $text); - } - - /** - * Returns TRUE if every character in text is a hexadecimal 'digit', that is a decimal digit or a character from [A-Fa-f] , FALSE otherwise. - * - * @see https://php.net/ctype-xdigit - * - * @param mixed $text - * - * @return bool - */ - public static function ctype_xdigit($text) - { - $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); - - return \is_string($text) && '' !== $text && !preg_match('/[^A-Fa-f0-9]/', $text); - } - - /** - * Converts integers to their char versions according to normal ctype behaviour, if needed. - * - * If an integer between -128 and 255 inclusive is provided, - * it is interpreted as the ASCII value of a single character - * (negative values have 256 added in order to allow characters in the Extended ASCII range). - * Any other integer is interpreted as a string containing the decimal digits of the integer. - * - * @param mixed $int - * @param string $function - * - * @return mixed - */ - private static function convert_int_to_char_for_ctype($int, $function) - { - if (!\is_int($int)) { - return $int; - } - - if ($int < -128 || $int > 255) { - return (string) $int; - } - - if (\PHP_VERSION_ID >= 80100) { - @trigger_error($function.'(): Argument of type int will be interpreted as string in the future', \E_USER_DEPRECATED); - } - - if ($int < 0) { - $int += 256; - } - - return \chr($int); - } -} diff --git a/system/vendor/symfony/polyfill-ctype/LICENSE b/system/vendor/symfony/polyfill-ctype/LICENSE deleted file mode 100644 index 7536cae..0000000 --- a/system/vendor/symfony/polyfill-ctype/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2018-present Fabien Potencier - -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/system/vendor/symfony/polyfill-ctype/README.md b/system/vendor/symfony/polyfill-ctype/README.md deleted file mode 100644 index b144d03..0000000 --- a/system/vendor/symfony/polyfill-ctype/README.md +++ /dev/null @@ -1,12 +0,0 @@ -Symfony Polyfill / Ctype -======================== - -This component provides `ctype_*` functions to users who run php versions without the ctype extension. - -More information can be found in the -[main Polyfill README](https://github.com/symfony/polyfill/blob/main/README.md). - -License -======= - -This library is released under the [MIT license](LICENSE). diff --git a/system/vendor/symfony/polyfill-ctype/bootstrap.php b/system/vendor/symfony/polyfill-ctype/bootstrap.php deleted file mode 100644 index d54524b..0000000 --- a/system/vendor/symfony/polyfill-ctype/bootstrap.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Ctype as p; - -if (\PHP_VERSION_ID >= 80000) { - return require __DIR__.'/bootstrap80.php'; -} - -if (!function_exists('ctype_alnum')) { - function ctype_alnum($text) { return p\Ctype::ctype_alnum($text); } -} -if (!function_exists('ctype_alpha')) { - function ctype_alpha($text) { return p\Ctype::ctype_alpha($text); } -} -if (!function_exists('ctype_cntrl')) { - function ctype_cntrl($text) { return p\Ctype::ctype_cntrl($text); } -} -if (!function_exists('ctype_digit')) { - function ctype_digit($text) { return p\Ctype::ctype_digit($text); } -} -if (!function_exists('ctype_graph')) { - function ctype_graph($text) { return p\Ctype::ctype_graph($text); } -} -if (!function_exists('ctype_lower')) { - function ctype_lower($text) { return p\Ctype::ctype_lower($text); } -} -if (!function_exists('ctype_print')) { - function ctype_print($text) { return p\Ctype::ctype_print($text); } -} -if (!function_exists('ctype_punct')) { - function ctype_punct($text) { return p\Ctype::ctype_punct($text); } -} -if (!function_exists('ctype_space')) { - function ctype_space($text) { return p\Ctype::ctype_space($text); } -} -if (!function_exists('ctype_upper')) { - function ctype_upper($text) { return p\Ctype::ctype_upper($text); } -} -if (!function_exists('ctype_xdigit')) { - function ctype_xdigit($text) { return p\Ctype::ctype_xdigit($text); } -} diff --git a/system/vendor/symfony/polyfill-ctype/bootstrap80.php b/system/vendor/symfony/polyfill-ctype/bootstrap80.php deleted file mode 100644 index ab2f861..0000000 --- a/system/vendor/symfony/polyfill-ctype/bootstrap80.php +++ /dev/null @@ -1,46 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Ctype as p; - -if (!function_exists('ctype_alnum')) { - function ctype_alnum(mixed $text): bool { return p\Ctype::ctype_alnum($text); } -} -if (!function_exists('ctype_alpha')) { - function ctype_alpha(mixed $text): bool { return p\Ctype::ctype_alpha($text); } -} -if (!function_exists('ctype_cntrl')) { - function ctype_cntrl(mixed $text): bool { return p\Ctype::ctype_cntrl($text); } -} -if (!function_exists('ctype_digit')) { - function ctype_digit(mixed $text): bool { return p\Ctype::ctype_digit($text); } -} -if (!function_exists('ctype_graph')) { - function ctype_graph(mixed $text): bool { return p\Ctype::ctype_graph($text); } -} -if (!function_exists('ctype_lower')) { - function ctype_lower(mixed $text): bool { return p\Ctype::ctype_lower($text); } -} -if (!function_exists('ctype_print')) { - function ctype_print(mixed $text): bool { return p\Ctype::ctype_print($text); } -} -if (!function_exists('ctype_punct')) { - function ctype_punct(mixed $text): bool { return p\Ctype::ctype_punct($text); } -} -if (!function_exists('ctype_space')) { - function ctype_space(mixed $text): bool { return p\Ctype::ctype_space($text); } -} -if (!function_exists('ctype_upper')) { - function ctype_upper(mixed $text): bool { return p\Ctype::ctype_upper($text); } -} -if (!function_exists('ctype_xdigit')) { - function ctype_xdigit(mixed $text): bool { return p\Ctype::ctype_xdigit($text); } -} diff --git a/system/vendor/symfony/polyfill-ctype/composer.json b/system/vendor/symfony/polyfill-ctype/composer.json deleted file mode 100644 index e5c978f..0000000 --- a/system/vendor/symfony/polyfill-ctype/composer.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "symfony/polyfill-ctype", - "type": "library", - "description": "Symfony polyfill for ctype functions", - "keywords": ["polyfill", "compatibility", "portable", "ctype"], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=7.1" - }, - "provide": { - "ext-ctype": "*" - }, - "autoload": { - "psr-4": { "Symfony\\Polyfill\\Ctype\\": "" }, - "files": [ "bootstrap.php" ] - }, - "suggest": { - "ext-ctype": "For best performance" - }, - "minimum-stability": "dev", - "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - } -} diff --git a/system/vendor/symfony/polyfill-mbstring/LICENSE b/system/vendor/symfony/polyfill-mbstring/LICENSE deleted file mode 100644 index 6e3afce..0000000 --- a/system/vendor/symfony/polyfill-mbstring/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2015-present Fabien Potencier - -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/system/vendor/symfony/polyfill-mbstring/Mbstring.php b/system/vendor/symfony/polyfill-mbstring/Mbstring.php deleted file mode 100644 index 2e0b969..0000000 --- a/system/vendor/symfony/polyfill-mbstring/Mbstring.php +++ /dev/null @@ -1,947 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Polyfill\Mbstring; - -/** - * Partial mbstring implementation in PHP, iconv based, UTF-8 centric. - * - * Implemented: - * - mb_chr - Returns a specific character from its Unicode code point - * - mb_convert_encoding - Convert character encoding - * - mb_convert_variables - Convert character code in variable(s) - * - mb_decode_mimeheader - Decode string in MIME header field - * - mb_encode_mimeheader - Encode string for MIME header XXX NATIVE IMPLEMENTATION IS REALLY BUGGED - * - mb_decode_numericentity - Decode HTML numeric string reference to character - * - mb_encode_numericentity - Encode character to HTML numeric string reference - * - mb_convert_case - Perform case folding on a string - * - mb_detect_encoding - Detect character encoding - * - mb_get_info - Get internal settings of mbstring - * - mb_http_input - Detect HTTP input character encoding - * - mb_http_output - Set/Get HTTP output character encoding - * - mb_internal_encoding - Set/Get internal character encoding - * - mb_list_encodings - Returns an array of all supported encodings - * - mb_ord - Returns the Unicode code point of a character - * - mb_output_handler - Callback function converts character encoding in output buffer - * - mb_scrub - Replaces ill-formed byte sequences with substitute characters - * - mb_strlen - Get string length - * - mb_strpos - Find position of first occurrence of string in a string - * - mb_strrpos - Find position of last occurrence of a string in a string - * - mb_str_split - Convert a string to an array - * - mb_strtolower - Make a string lowercase - * - mb_strtoupper - Make a string uppercase - * - mb_substitute_character - Set/Get substitution character - * - mb_substr - Get part of string - * - mb_stripos - Finds position of first occurrence of a string within another, case insensitive - * - mb_stristr - Finds first occurrence of a string within another, case insensitive - * - mb_strrchr - Finds the last occurrence of a character in a string within another - * - mb_strrichr - Finds the last occurrence of a character in a string within another, case insensitive - * - mb_strripos - Finds position of last occurrence of a string within another, case insensitive - * - mb_strstr - Finds first occurrence of a string within another - * - mb_strwidth - Return width of string - * - mb_substr_count - Count the number of substring occurrences - * - * Not implemented: - * - mb_convert_kana - Convert "kana" one from another ("zen-kaku", "han-kaku" and more) - * - mb_ereg_* - Regular expression with multibyte support - * - mb_parse_str - Parse GET/POST/COOKIE data and set global variable - * - mb_preferred_mime_name - Get MIME charset string - * - mb_regex_encoding - Returns current encoding for multibyte regex as string - * - mb_regex_set_options - Set/Get the default options for mbregex functions - * - mb_send_mail - Send encoded mail - * - mb_split - Split multibyte string using regular expression - * - mb_strcut - Get part of string - * - mb_strimwidth - Get truncated string with specified width - * - * @author Nicolas Grekas - * - * @internal - */ -final class Mbstring -{ - public const MB_CASE_FOLD = \PHP_INT_MAX; - - private const SIMPLE_CASE_FOLD = [ - ['µ', 'ſ', "\xCD\x85", 'ς', "\xCF\x90", "\xCF\x91", "\xCF\x95", "\xCF\x96", "\xCF\xB0", "\xCF\xB1", "\xCF\xB5", "\xE1\xBA\x9B", "\xE1\xBE\xBE"], - ['μ', 's', 'ι', 'σ', 'β', 'θ', 'φ', 'π', 'κ', 'ρ', 'ε', "\xE1\xB9\xA1", 'ι'], - ]; - - private static $encodingList = ['ASCII', 'UTF-8']; - private static $language = 'neutral'; - private static $internalEncoding = 'UTF-8'; - - public static function mb_convert_encoding($s, $toEncoding, $fromEncoding = null) - { - if (\is_array($fromEncoding) || (null !== $fromEncoding && false !== strpos($fromEncoding, ','))) { - $fromEncoding = self::mb_detect_encoding($s, $fromEncoding); - } else { - $fromEncoding = self::getEncoding($fromEncoding); - } - - $toEncoding = self::getEncoding($toEncoding); - - if ('BASE64' === $fromEncoding) { - $s = base64_decode($s); - $fromEncoding = $toEncoding; - } - - if ('BASE64' === $toEncoding) { - return base64_encode($s); - } - - if ('HTML-ENTITIES' === $toEncoding || 'HTML' === $toEncoding) { - if ('HTML-ENTITIES' === $fromEncoding || 'HTML' === $fromEncoding) { - $fromEncoding = 'Windows-1252'; - } - if ('UTF-8' !== $fromEncoding) { - $s = iconv($fromEncoding, 'UTF-8//IGNORE', $s); - } - - return preg_replace_callback('/[\x80-\xFF]+/', [__CLASS__, 'html_encoding_callback'], $s); - } - - if ('HTML-ENTITIES' === $fromEncoding) { - $s = html_entity_decode($s, \ENT_COMPAT, 'UTF-8'); - $fromEncoding = 'UTF-8'; - } - - return iconv($fromEncoding, $toEncoding.'//IGNORE', $s); - } - - public static function mb_convert_variables($toEncoding, $fromEncoding, &...$vars) - { - $ok = true; - array_walk_recursive($vars, function (&$v) use (&$ok, $toEncoding, $fromEncoding) { - if (false === $v = self::mb_convert_encoding($v, $toEncoding, $fromEncoding)) { - $ok = false; - } - }); - - return $ok ? $fromEncoding : false; - } - - public static function mb_decode_mimeheader($s) - { - return iconv_mime_decode($s, 2, self::$internalEncoding); - } - - public static function mb_encode_mimeheader($s, $charset = null, $transferEncoding = null, $linefeed = null, $indent = null) - { - trigger_error('mb_encode_mimeheader() is bugged. Please use iconv_mime_encode() instead', \E_USER_WARNING); - } - - public static function mb_decode_numericentity($s, $convmap, $encoding = null) - { - if (null !== $s && !\is_scalar($s) && !(\is_object($s) && method_exists($s, '__toString'))) { - trigger_error('mb_decode_numericentity() expects parameter 1 to be string, '.\gettype($s).' given', \E_USER_WARNING); - - return null; - } - - if (!\is_array($convmap) || (80000 > \PHP_VERSION_ID && !$convmap)) { - return false; - } - - if (null !== $encoding && !\is_scalar($encoding)) { - trigger_error('mb_decode_numericentity() expects parameter 3 to be string, '.\gettype($s).' given', \E_USER_WARNING); - - return ''; // Instead of null (cf. mb_encode_numericentity). - } - - $s = (string) $s; - if ('' === $s) { - return ''; - } - - $encoding = self::getEncoding($encoding); - - if ('UTF-8' === $encoding) { - $encoding = null; - if (!preg_match('//u', $s)) { - $s = @iconv('UTF-8', 'UTF-8//IGNORE', $s); - } - } else { - $s = iconv($encoding, 'UTF-8//IGNORE', $s); - } - - $cnt = floor(\count($convmap) / 4) * 4; - - for ($i = 0; $i < $cnt; $i += 4) { - // collector_decode_htmlnumericentity ignores $convmap[$i + 3] - $convmap[$i] += $convmap[$i + 2]; - $convmap[$i + 1] += $convmap[$i + 2]; - } - - $s = preg_replace_callback('/&#(?:0*([0-9]+)|x0*([0-9a-fA-F]+))(?!&);?/', function (array $m) use ($cnt, $convmap) { - $c = isset($m[2]) ? (int) hexdec($m[2]) : $m[1]; - for ($i = 0; $i < $cnt; $i += 4) { - if ($c >= $convmap[$i] && $c <= $convmap[$i + 1]) { - return self::mb_chr($c - $convmap[$i + 2]); - } - } - - return $m[0]; - }, $s); - - if (null === $encoding) { - return $s; - } - - return iconv('UTF-8', $encoding.'//IGNORE', $s); - } - - public static function mb_encode_numericentity($s, $convmap, $encoding = null, $is_hex = false) - { - if (null !== $s && !\is_scalar($s) && !(\is_object($s) && method_exists($s, '__toString'))) { - trigger_error('mb_encode_numericentity() expects parameter 1 to be string, '.\gettype($s).' given', \E_USER_WARNING); - - return null; - } - - if (!\is_array($convmap) || (80000 > \PHP_VERSION_ID && !$convmap)) { - return false; - } - - if (null !== $encoding && !\is_scalar($encoding)) { - trigger_error('mb_encode_numericentity() expects parameter 3 to be string, '.\gettype($s).' given', \E_USER_WARNING); - - return null; // Instead of '' (cf. mb_decode_numericentity). - } - - if (null !== $is_hex && !\is_scalar($is_hex)) { - trigger_error('mb_encode_numericentity() expects parameter 4 to be boolean, '.\gettype($s).' given', \E_USER_WARNING); - - return null; - } - - $s = (string) $s; - if ('' === $s) { - return ''; - } - - $encoding = self::getEncoding($encoding); - - if ('UTF-8' === $encoding) { - $encoding = null; - if (!preg_match('//u', $s)) { - $s = @iconv('UTF-8', 'UTF-8//IGNORE', $s); - } - } else { - $s = iconv($encoding, 'UTF-8//IGNORE', $s); - } - - static $ulenMask = ["\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4]; - - $cnt = floor(\count($convmap) / 4) * 4; - $i = 0; - $len = \strlen($s); - $result = ''; - - while ($i < $len) { - $ulen = $s[$i] < "\x80" ? 1 : $ulenMask[$s[$i] & "\xF0"]; - $uchr = substr($s, $i, $ulen); - $i += $ulen; - $c = self::mb_ord($uchr); - - for ($j = 0; $j < $cnt; $j += 4) { - if ($c >= $convmap[$j] && $c <= $convmap[$j + 1]) { - $cOffset = ($c + $convmap[$j + 2]) & $convmap[$j + 3]; - $result .= $is_hex ? sprintf('&#x%X;', $cOffset) : '&#'.$cOffset.';'; - continue 2; - } - } - $result .= $uchr; - } - - if (null === $encoding) { - return $result; - } - - return iconv('UTF-8', $encoding.'//IGNORE', $result); - } - - public static function mb_convert_case($s, $mode, $encoding = null) - { - $s = (string) $s; - if ('' === $s) { - return ''; - } - - $encoding = self::getEncoding($encoding); - - if ('UTF-8' === $encoding) { - $encoding = null; - if (!preg_match('//u', $s)) { - $s = @iconv('UTF-8', 'UTF-8//IGNORE', $s); - } - } else { - $s = iconv($encoding, 'UTF-8//IGNORE', $s); - } - - if (\MB_CASE_TITLE == $mode) { - static $titleRegexp = null; - if (null === $titleRegexp) { - $titleRegexp = self::getData('titleCaseRegexp'); - } - $s = preg_replace_callback($titleRegexp, [__CLASS__, 'title_case'], $s); - } else { - if (\MB_CASE_UPPER == $mode) { - static $upper = null; - if (null === $upper) { - $upper = self::getData('upperCase'); - } - $map = $upper; - } else { - if (self::MB_CASE_FOLD === $mode) { - static $caseFolding = null; - if (null === $caseFolding) { - $caseFolding = self::getData('caseFolding'); - } - $s = strtr($s, $caseFolding); - } - - static $lower = null; - if (null === $lower) { - $lower = self::getData('lowerCase'); - } - $map = $lower; - } - - static $ulenMask = ["\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4]; - - $i = 0; - $len = \strlen($s); - - while ($i < $len) { - $ulen = $s[$i] < "\x80" ? 1 : $ulenMask[$s[$i] & "\xF0"]; - $uchr = substr($s, $i, $ulen); - $i += $ulen; - - if (isset($map[$uchr])) { - $uchr = $map[$uchr]; - $nlen = \strlen($uchr); - - if ($nlen == $ulen) { - $nlen = $i; - do { - $s[--$nlen] = $uchr[--$ulen]; - } while ($ulen); - } else { - $s = substr_replace($s, $uchr, $i - $ulen, $ulen); - $len += $nlen - $ulen; - $i += $nlen - $ulen; - } - } - } - } - - if (null === $encoding) { - return $s; - } - - return iconv('UTF-8', $encoding.'//IGNORE', $s); - } - - public static function mb_internal_encoding($encoding = null) - { - if (null === $encoding) { - return self::$internalEncoding; - } - - $normalizedEncoding = self::getEncoding($encoding); - - if ('UTF-8' === $normalizedEncoding || false !== @iconv($normalizedEncoding, $normalizedEncoding, ' ')) { - self::$internalEncoding = $normalizedEncoding; - - return true; - } - - if (80000 > \PHP_VERSION_ID) { - return false; - } - - throw new \ValueError(sprintf('Argument #1 ($encoding) must be a valid encoding, "%s" given', $encoding)); - } - - public static function mb_language($lang = null) - { - if (null === $lang) { - return self::$language; - } - - switch ($normalizedLang = strtolower($lang)) { - case 'uni': - case 'neutral': - self::$language = $normalizedLang; - - return true; - } - - if (80000 > \PHP_VERSION_ID) { - return false; - } - - throw new \ValueError(sprintf('Argument #1 ($language) must be a valid language, "%s" given', $lang)); - } - - public static function mb_list_encodings() - { - return ['UTF-8']; - } - - public static function mb_encoding_aliases($encoding) - { - switch (strtoupper($encoding)) { - case 'UTF8': - case 'UTF-8': - return ['utf8']; - } - - return false; - } - - public static function mb_check_encoding($var = null, $encoding = null) - { - if (PHP_VERSION_ID < 70200 && \is_array($var)) { - trigger_error('mb_check_encoding() expects parameter 1 to be string, array given', \E_USER_WARNING); - - return null; - } - - if (null === $encoding) { - if (null === $var) { - return false; - } - $encoding = self::$internalEncoding; - } - - if (!\is_array($var)) { - return self::mb_detect_encoding($var, [$encoding]) || false !== @iconv($encoding, $encoding, $var); - } - - foreach ($var as $key => $value) { - if (!self::mb_check_encoding($key, $encoding)) { - return false; - } - if (!self::mb_check_encoding($value, $encoding)) { - return false; - } - } - - return true; - - } - - public static function mb_detect_encoding($str, $encodingList = null, $strict = false) - { - if (null === $encodingList) { - $encodingList = self::$encodingList; - } else { - if (!\is_array($encodingList)) { - $encodingList = array_map('trim', explode(',', $encodingList)); - } - $encodingList = array_map('strtoupper', $encodingList); - } - - foreach ($encodingList as $enc) { - switch ($enc) { - case 'ASCII': - if (!preg_match('/[\x80-\xFF]/', $str)) { - return $enc; - } - break; - - case 'UTF8': - case 'UTF-8': - if (preg_match('//u', $str)) { - return 'UTF-8'; - } - break; - - default: - if (0 === strncmp($enc, 'ISO-8859-', 9)) { - return $enc; - } - } - } - - return false; - } - - public static function mb_detect_order($encodingList = null) - { - if (null === $encodingList) { - return self::$encodingList; - } - - if (!\is_array($encodingList)) { - $encodingList = array_map('trim', explode(',', $encodingList)); - } - $encodingList = array_map('strtoupper', $encodingList); - - foreach ($encodingList as $enc) { - switch ($enc) { - default: - if (strncmp($enc, 'ISO-8859-', 9)) { - return false; - } - // no break - case 'ASCII': - case 'UTF8': - case 'UTF-8': - } - } - - self::$encodingList = $encodingList; - - return true; - } - - public static function mb_strlen($s, $encoding = null) - { - $encoding = self::getEncoding($encoding); - if ('CP850' === $encoding || 'ASCII' === $encoding) { - return \strlen($s); - } - - return @iconv_strlen($s, $encoding); - } - - public static function mb_strpos($haystack, $needle, $offset = 0, $encoding = null) - { - $encoding = self::getEncoding($encoding); - if ('CP850' === $encoding || 'ASCII' === $encoding) { - return strpos($haystack, $needle, $offset); - } - - $needle = (string) $needle; - if ('' === $needle) { - if (80000 > \PHP_VERSION_ID) { - trigger_error(__METHOD__.': Empty delimiter', \E_USER_WARNING); - - return false; - } - - return 0; - } - - return iconv_strpos($haystack, $needle, $offset, $encoding); - } - - public static function mb_strrpos($haystack, $needle, $offset = 0, $encoding = null) - { - $encoding = self::getEncoding($encoding); - if ('CP850' === $encoding || 'ASCII' === $encoding) { - return strrpos($haystack, $needle, $offset); - } - - if ($offset != (int) $offset) { - $offset = 0; - } elseif ($offset = (int) $offset) { - if ($offset < 0) { - if (0 > $offset += self::mb_strlen($needle)) { - $haystack = self::mb_substr($haystack, 0, $offset, $encoding); - } - $offset = 0; - } else { - $haystack = self::mb_substr($haystack, $offset, 2147483647, $encoding); - } - } - - $pos = '' !== $needle || 80000 > \PHP_VERSION_ID - ? iconv_strrpos($haystack, $needle, $encoding) - : self::mb_strlen($haystack, $encoding); - - return false !== $pos ? $offset + $pos : false; - } - - public static function mb_str_split($string, $split_length = 1, $encoding = null) - { - if (null !== $string && !\is_scalar($string) && !(\is_object($string) && method_exists($string, '__toString'))) { - trigger_error('mb_str_split() expects parameter 1 to be string, '.\gettype($string).' given', \E_USER_WARNING); - - return null; - } - - if (1 > $split_length = (int) $split_length) { - if (80000 > \PHP_VERSION_ID) { - trigger_error('The length of each segment must be greater than zero', \E_USER_WARNING); - - return false; - } - - throw new \ValueError('Argument #2 ($length) must be greater than 0'); - } - - if (null === $encoding) { - $encoding = mb_internal_encoding(); - } - - if ('UTF-8' === $encoding = self::getEncoding($encoding)) { - $rx = '/('; - while (65535 < $split_length) { - $rx .= '.{65535}'; - $split_length -= 65535; - } - $rx .= '.{'.$split_length.'})/us'; - - return preg_split($rx, $string, -1, \PREG_SPLIT_DELIM_CAPTURE | \PREG_SPLIT_NO_EMPTY); - } - - $result = []; - $length = mb_strlen($string, $encoding); - - for ($i = 0; $i < $length; $i += $split_length) { - $result[] = mb_substr($string, $i, $split_length, $encoding); - } - - return $result; - } - - public static function mb_strtolower($s, $encoding = null) - { - return self::mb_convert_case($s, \MB_CASE_LOWER, $encoding); - } - - public static function mb_strtoupper($s, $encoding = null) - { - return self::mb_convert_case($s, \MB_CASE_UPPER, $encoding); - } - - public static function mb_substitute_character($c = null) - { - if (null === $c) { - return 'none'; - } - if (0 === strcasecmp($c, 'none')) { - return true; - } - if (80000 > \PHP_VERSION_ID) { - return false; - } - if (\is_int($c) || 'long' === $c || 'entity' === $c) { - return false; - } - - throw new \ValueError('Argument #1 ($substitute_character) must be "none", "long", "entity" or a valid codepoint'); - } - - public static function mb_substr($s, $start, $length = null, $encoding = null) - { - $encoding = self::getEncoding($encoding); - if ('CP850' === $encoding || 'ASCII' === $encoding) { - return (string) substr($s, $start, null === $length ? 2147483647 : $length); - } - - if ($start < 0) { - $start = iconv_strlen($s, $encoding) + $start; - if ($start < 0) { - $start = 0; - } - } - - if (null === $length) { - $length = 2147483647; - } elseif ($length < 0) { - $length = iconv_strlen($s, $encoding) + $length - $start; - if ($length < 0) { - return ''; - } - } - - return (string) iconv_substr($s, $start, $length, $encoding); - } - - public static function mb_stripos($haystack, $needle, $offset = 0, $encoding = null) - { - [$haystack, $needle] = str_replace(self::SIMPLE_CASE_FOLD[0], self::SIMPLE_CASE_FOLD[1], [ - self::mb_convert_case($haystack, \MB_CASE_LOWER, $encoding), - self::mb_convert_case($needle, \MB_CASE_LOWER, $encoding), - ]); - - return self::mb_strpos($haystack, $needle, $offset, $encoding); - } - - public static function mb_stristr($haystack, $needle, $part = false, $encoding = null) - { - $pos = self::mb_stripos($haystack, $needle, 0, $encoding); - - return self::getSubpart($pos, $part, $haystack, $encoding); - } - - public static function mb_strrchr($haystack, $needle, $part = false, $encoding = null) - { - $encoding = self::getEncoding($encoding); - if ('CP850' === $encoding || 'ASCII' === $encoding) { - $pos = strrpos($haystack, $needle); - } else { - $needle = self::mb_substr($needle, 0, 1, $encoding); - $pos = iconv_strrpos($haystack, $needle, $encoding); - } - - return self::getSubpart($pos, $part, $haystack, $encoding); - } - - public static function mb_strrichr($haystack, $needle, $part = false, $encoding = null) - { - $needle = self::mb_substr($needle, 0, 1, $encoding); - $pos = self::mb_strripos($haystack, $needle, $encoding); - - return self::getSubpart($pos, $part, $haystack, $encoding); - } - - public static function mb_strripos($haystack, $needle, $offset = 0, $encoding = null) - { - $haystack = self::mb_convert_case($haystack, \MB_CASE_LOWER, $encoding); - $needle = self::mb_convert_case($needle, \MB_CASE_LOWER, $encoding); - - $haystack = str_replace(self::SIMPLE_CASE_FOLD[0], self::SIMPLE_CASE_FOLD[1], $haystack); - $needle = str_replace(self::SIMPLE_CASE_FOLD[0], self::SIMPLE_CASE_FOLD[1], $needle); - - return self::mb_strrpos($haystack, $needle, $offset, $encoding); - } - - public static function mb_strstr($haystack, $needle, $part = false, $encoding = null) - { - $pos = strpos($haystack, $needle); - if (false === $pos) { - return false; - } - if ($part) { - return substr($haystack, 0, $pos); - } - - return substr($haystack, $pos); - } - - public static function mb_get_info($type = 'all') - { - $info = [ - 'internal_encoding' => self::$internalEncoding, - 'http_output' => 'pass', - 'http_output_conv_mimetypes' => '^(text/|application/xhtml\+xml)', - 'func_overload' => 0, - 'func_overload_list' => 'no overload', - 'mail_charset' => 'UTF-8', - 'mail_header_encoding' => 'BASE64', - 'mail_body_encoding' => 'BASE64', - 'illegal_chars' => 0, - 'encoding_translation' => 'Off', - 'language' => self::$language, - 'detect_order' => self::$encodingList, - 'substitute_character' => 'none', - 'strict_detection' => 'Off', - ]; - - if ('all' === $type) { - return $info; - } - if (isset($info[$type])) { - return $info[$type]; - } - - return false; - } - - public static function mb_http_input($type = '') - { - return false; - } - - public static function mb_http_output($encoding = null) - { - return null !== $encoding ? 'pass' === $encoding : 'pass'; - } - - public static function mb_strwidth($s, $encoding = null) - { - $encoding = self::getEncoding($encoding); - - if ('UTF-8' !== $encoding) { - $s = iconv($encoding, 'UTF-8//IGNORE', $s); - } - - $s = preg_replace('/[\x{1100}-\x{115F}\x{2329}\x{232A}\x{2E80}-\x{303E}\x{3040}-\x{A4CF}\x{AC00}-\x{D7A3}\x{F900}-\x{FAFF}\x{FE10}-\x{FE19}\x{FE30}-\x{FE6F}\x{FF00}-\x{FF60}\x{FFE0}-\x{FFE6}\x{20000}-\x{2FFFD}\x{30000}-\x{3FFFD}]/u', '', $s, -1, $wide); - - return ($wide << 1) + iconv_strlen($s, 'UTF-8'); - } - - public static function mb_substr_count($haystack, $needle, $encoding = null) - { - return substr_count($haystack, $needle); - } - - public static function mb_output_handler($contents, $status) - { - return $contents; - } - - public static function mb_chr($code, $encoding = null) - { - if (0x80 > $code %= 0x200000) { - $s = \chr($code); - } elseif (0x800 > $code) { - $s = \chr(0xC0 | $code >> 6).\chr(0x80 | $code & 0x3F); - } elseif (0x10000 > $code) { - $s = \chr(0xE0 | $code >> 12).\chr(0x80 | $code >> 6 & 0x3F).\chr(0x80 | $code & 0x3F); - } else { - $s = \chr(0xF0 | $code >> 18).\chr(0x80 | $code >> 12 & 0x3F).\chr(0x80 | $code >> 6 & 0x3F).\chr(0x80 | $code & 0x3F); - } - - if ('UTF-8' !== $encoding = self::getEncoding($encoding)) { - $s = mb_convert_encoding($s, $encoding, 'UTF-8'); - } - - return $s; - } - - public static function mb_ord($s, $encoding = null) - { - if ('UTF-8' !== $encoding = self::getEncoding($encoding)) { - $s = mb_convert_encoding($s, 'UTF-8', $encoding); - } - - if (1 === \strlen($s)) { - return \ord($s); - } - - $code = ($s = unpack('C*', substr($s, 0, 4))) ? $s[1] : 0; - if (0xF0 <= $code) { - return (($code - 0xF0) << 18) + (($s[2] - 0x80) << 12) + (($s[3] - 0x80) << 6) + $s[4] - 0x80; - } - if (0xE0 <= $code) { - return (($code - 0xE0) << 12) + (($s[2] - 0x80) << 6) + $s[3] - 0x80; - } - if (0xC0 <= $code) { - return (($code - 0xC0) << 6) + $s[2] - 0x80; - } - - return $code; - } - - public static function mb_str_pad(string $string, int $length, string $pad_string = ' ', int $pad_type = \STR_PAD_RIGHT, string $encoding = null): string - { - if (!\in_array($pad_type, [\STR_PAD_RIGHT, \STR_PAD_LEFT, \STR_PAD_BOTH], true)) { - throw new \ValueError('mb_str_pad(): Argument #4 ($pad_type) must be STR_PAD_LEFT, STR_PAD_RIGHT, or STR_PAD_BOTH'); - } - - if (null === $encoding) { - $encoding = self::mb_internal_encoding(); - } - - try { - $validEncoding = @self::mb_check_encoding('', $encoding); - } catch (\ValueError $e) { - throw new \ValueError(sprintf('mb_str_pad(): Argument #5 ($encoding) must be a valid encoding, "%s" given', $encoding)); - } - - // BC for PHP 7.3 and lower - if (!$validEncoding) { - throw new \ValueError(sprintf('mb_str_pad(): Argument #5 ($encoding) must be a valid encoding, "%s" given', $encoding)); - } - - if (self::mb_strlen($pad_string, $encoding) <= 0) { - throw new \ValueError('mb_str_pad(): Argument #3 ($pad_string) must be a non-empty string'); - } - - $paddingRequired = $length - self::mb_strlen($string, $encoding); - - if ($paddingRequired < 1) { - return $string; - } - - switch ($pad_type) { - case \STR_PAD_LEFT: - return self::mb_substr(str_repeat($pad_string, $paddingRequired), 0, $paddingRequired, $encoding).$string; - case \STR_PAD_RIGHT: - return $string.self::mb_substr(str_repeat($pad_string, $paddingRequired), 0, $paddingRequired, $encoding); - default: - $leftPaddingLength = floor($paddingRequired / 2); - $rightPaddingLength = $paddingRequired - $leftPaddingLength; - - return self::mb_substr(str_repeat($pad_string, $leftPaddingLength), 0, $leftPaddingLength, $encoding).$string.self::mb_substr(str_repeat($pad_string, $rightPaddingLength), 0, $rightPaddingLength, $encoding); - } - } - - private static function getSubpart($pos, $part, $haystack, $encoding) - { - if (false === $pos) { - return false; - } - if ($part) { - return self::mb_substr($haystack, 0, $pos, $encoding); - } - - return self::mb_substr($haystack, $pos, null, $encoding); - } - - private static function html_encoding_callback(array $m) - { - $i = 1; - $entities = ''; - $m = unpack('C*', htmlentities($m[0], \ENT_COMPAT, 'UTF-8')); - - while (isset($m[$i])) { - if (0x80 > $m[$i]) { - $entities .= \chr($m[$i++]); - continue; - } - if (0xF0 <= $m[$i]) { - $c = (($m[$i++] - 0xF0) << 18) + (($m[$i++] - 0x80) << 12) + (($m[$i++] - 0x80) << 6) + $m[$i++] - 0x80; - } elseif (0xE0 <= $m[$i]) { - $c = (($m[$i++] - 0xE0) << 12) + (($m[$i++] - 0x80) << 6) + $m[$i++] - 0x80; - } else { - $c = (($m[$i++] - 0xC0) << 6) + $m[$i++] - 0x80; - } - - $entities .= '&#'.$c.';'; - } - - return $entities; - } - - private static function title_case(array $s) - { - return self::mb_convert_case($s[1], \MB_CASE_UPPER, 'UTF-8').self::mb_convert_case($s[2], \MB_CASE_LOWER, 'UTF-8'); - } - - private static function getData($file) - { - if (file_exists($file = __DIR__.'/Resources/unidata/'.$file.'.php')) { - return require $file; - } - - return false; - } - - private static function getEncoding($encoding) - { - if (null === $encoding) { - return self::$internalEncoding; - } - - if ('UTF-8' === $encoding) { - return 'UTF-8'; - } - - $encoding = strtoupper($encoding); - - if ('8BIT' === $encoding || 'BINARY' === $encoding) { - return 'CP850'; - } - - if ('UTF8' === $encoding) { - return 'UTF-8'; - } - - return $encoding; - } -} diff --git a/system/vendor/symfony/polyfill-mbstring/README.md b/system/vendor/symfony/polyfill-mbstring/README.md deleted file mode 100644 index 478b40d..0000000 --- a/system/vendor/symfony/polyfill-mbstring/README.md +++ /dev/null @@ -1,13 +0,0 @@ -Symfony Polyfill / Mbstring -=========================== - -This component provides a partial, native PHP implementation for the -[Mbstring](https://php.net/mbstring) extension. - -More information can be found in the -[main Polyfill README](https://github.com/symfony/polyfill/blob/main/README.md). - -License -======= - -This library is released under the [MIT license](LICENSE). diff --git a/system/vendor/symfony/polyfill-mbstring/Resources/unidata/caseFolding.php b/system/vendor/symfony/polyfill-mbstring/Resources/unidata/caseFolding.php deleted file mode 100644 index 512bba0..0000000 --- a/system/vendor/symfony/polyfill-mbstring/Resources/unidata/caseFolding.php +++ /dev/null @@ -1,119 +0,0 @@ - 'i̇', - 'µ' => 'μ', - 'ſ' => 's', - 'ͅ' => 'ι', - 'ς' => 'σ', - 'ϐ' => 'β', - 'ϑ' => 'θ', - 'ϕ' => 'φ', - 'ϖ' => 'π', - 'ϰ' => 'κ', - 'ϱ' => 'ρ', - 'ϵ' => 'ε', - 'ẛ' => 'ṡ', - 'ι' => 'ι', - 'ß' => 'ss', - 'ʼn' => 'ʼn', - 'ǰ' => 'ǰ', - 'ΐ' => 'ΐ', - 'ΰ' => 'ΰ', - 'և' => 'եւ', - 'ẖ' => 'ẖ', - 'ẗ' => 'ẗ', - 'ẘ' => 'ẘ', - 'ẙ' => 'ẙ', - 'ẚ' => 'aʾ', - 'ẞ' => 'ss', - 'ὐ' => 'ὐ', - 'ὒ' => 'ὒ', - 'ὔ' => 'ὔ', - 'ὖ' => 'ὖ', - 'ᾀ' => 'ἀι', - 'ᾁ' => 'ἁι', - 'ᾂ' => 'ἂι', - 'ᾃ' => 'ἃι', - 'ᾄ' => 'ἄι', - 'ᾅ' => 'ἅι', - 'ᾆ' => 'ἆι', - 'ᾇ' => 'ἇι', - 'ᾈ' => 'ἀι', - 'ᾉ' => 'ἁι', - 'ᾊ' => 'ἂι', - 'ᾋ' => 'ἃι', - 'ᾌ' => 'ἄι', - 'ᾍ' => 'ἅι', - 'ᾎ' => 'ἆι', - 'ᾏ' => 'ἇι', - 'ᾐ' => 'ἠι', - 'ᾑ' => 'ἡι', - 'ᾒ' => 'ἢι', - 'ᾓ' => 'ἣι', - 'ᾔ' => 'ἤι', - 'ᾕ' => 'ἥι', - 'ᾖ' => 'ἦι', - 'ᾗ' => 'ἧι', - 'ᾘ' => 'ἠι', - 'ᾙ' => 'ἡι', - 'ᾚ' => 'ἢι', - 'ᾛ' => 'ἣι', - 'ᾜ' => 'ἤι', - 'ᾝ' => 'ἥι', - 'ᾞ' => 'ἦι', - 'ᾟ' => 'ἧι', - 'ᾠ' => 'ὠι', - 'ᾡ' => 'ὡι', - 'ᾢ' => 'ὢι', - 'ᾣ' => 'ὣι', - 'ᾤ' => 'ὤι', - 'ᾥ' => 'ὥι', - 'ᾦ' => 'ὦι', - 'ᾧ' => 'ὧι', - 'ᾨ' => 'ὠι', - 'ᾩ' => 'ὡι', - 'ᾪ' => 'ὢι', - 'ᾫ' => 'ὣι', - 'ᾬ' => 'ὤι', - 'ᾭ' => 'ὥι', - 'ᾮ' => 'ὦι', - 'ᾯ' => 'ὧι', - 'ᾲ' => 'ὰι', - 'ᾳ' => 'αι', - 'ᾴ' => 'άι', - 'ᾶ' => 'ᾶ', - 'ᾷ' => 'ᾶι', - 'ᾼ' => 'αι', - 'ῂ' => 'ὴι', - 'ῃ' => 'ηι', - 'ῄ' => 'ήι', - 'ῆ' => 'ῆ', - 'ῇ' => 'ῆι', - 'ῌ' => 'ηι', - 'ῒ' => 'ῒ', - 'ῖ' => 'ῖ', - 'ῗ' => 'ῗ', - 'ῢ' => 'ῢ', - 'ῤ' => 'ῤ', - 'ῦ' => 'ῦ', - 'ῧ' => 'ῧ', - 'ῲ' => 'ὼι', - 'ῳ' => 'ωι', - 'ῴ' => 'ώι', - 'ῶ' => 'ῶ', - 'ῷ' => 'ῶι', - 'ῼ' => 'ωι', - 'ff' => 'ff', - 'fi' => 'fi', - 'fl' => 'fl', - 'ffi' => 'ffi', - 'ffl' => 'ffl', - 'ſt' => 'st', - 'st' => 'st', - 'ﬓ' => 'մն', - 'ﬔ' => 'մե', - 'ﬕ' => 'մի', - 'ﬖ' => 'վն', - 'ﬗ' => 'մխ', -]; diff --git a/system/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php b/system/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php deleted file mode 100644 index fac60b0..0000000 --- a/system/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php +++ /dev/null @@ -1,1397 +0,0 @@ - 'a', - 'B' => 'b', - 'C' => 'c', - 'D' => 'd', - 'E' => 'e', - 'F' => 'f', - 'G' => 'g', - 'H' => 'h', - 'I' => 'i', - 'J' => 'j', - 'K' => 'k', - 'L' => 'l', - 'M' => 'm', - 'N' => 'n', - 'O' => 'o', - 'P' => 'p', - 'Q' => 'q', - 'R' => 'r', - 'S' => 's', - 'T' => 't', - 'U' => 'u', - 'V' => 'v', - 'W' => 'w', - 'X' => 'x', - 'Y' => 'y', - 'Z' => 'z', - 'À' => 'à', - 'Á' => 'á', - 'Â' => 'â', - 'Ã' => 'ã', - 'Ä' => 'ä', - 'Å' => 'å', - 'Æ' => 'æ', - 'Ç' => 'ç', - 'È' => 'è', - 'É' => 'é', - 'Ê' => 'ê', - 'Ë' => 'ë', - 'Ì' => 'ì', - 'Í' => 'í', - 'Î' => 'î', - 'Ï' => 'ï', - 'Ð' => 'ð', - 'Ñ' => 'ñ', - 'Ò' => 'ò', - 'Ó' => 'ó', - 'Ô' => 'ô', - 'Õ' => 'õ', - 'Ö' => 'ö', - 'Ø' => 'ø', - 'Ù' => 'ù', - 'Ú' => 'ú', - 'Û' => 'û', - 'Ü' => 'ü', - 'Ý' => 'ý', - 'Þ' => 'þ', - 'Ā' => 'ā', - 'Ă' => 'ă', - 'Ą' => 'ą', - 'Ć' => 'ć', - 'Ĉ' => 'ĉ', - 'Ċ' => 'ċ', - 'Č' => 'č', - 'Ď' => 'ď', - 'Đ' => 'đ', - 'Ē' => 'ē', - 'Ĕ' => 'ĕ', - 'Ė' => 'ė', - 'Ę' => 'ę', - 'Ě' => 'ě', - 'Ĝ' => 'ĝ', - 'Ğ' => 'ğ', - 'Ġ' => 'ġ', - 'Ģ' => 'ģ', - 'Ĥ' => 'ĥ', - 'Ħ' => 'ħ', - 'Ĩ' => 'ĩ', - 'Ī' => 'ī', - 'Ĭ' => 'ĭ', - 'Į' => 'į', - 'İ' => 'i̇', - 'IJ' => 'ij', - 'Ĵ' => 'ĵ', - 'Ķ' => 'ķ', - 'Ĺ' => 'ĺ', - 'Ļ' => 'ļ', - 'Ľ' => 'ľ', - 'Ŀ' => 'ŀ', - 'Ł' => 'ł', - 'Ń' => 'ń', - 'Ņ' => 'ņ', - 'Ň' => 'ň', - 'Ŋ' => 'ŋ', - 'Ō' => 'ō', - 'Ŏ' => 'ŏ', - 'Ő' => 'ő', - 'Œ' => 'œ', - 'Ŕ' => 'ŕ', - 'Ŗ' => 'ŗ', - 'Ř' => 'ř', - 'Ś' => 'ś', - 'Ŝ' => 'ŝ', - 'Ş' => 'ş', - 'Š' => 'š', - 'Ţ' => 'ţ', - 'Ť' => 'ť', - 'Ŧ' => 'ŧ', - 'Ũ' => 'ũ', - 'Ū' => 'ū', - 'Ŭ' => 'ŭ', - 'Ů' => 'ů', - 'Ű' => 'ű', - 'Ų' => 'ų', - 'Ŵ' => 'ŵ', - 'Ŷ' => 'ŷ', - 'Ÿ' => 'ÿ', - 'Ź' => 'ź', - 'Ż' => 'ż', - 'Ž' => 'ž', - 'Ɓ' => 'ɓ', - 'Ƃ' => 'ƃ', - 'Ƅ' => 'ƅ', - 'Ɔ' => 'ɔ', - 'Ƈ' => 'ƈ', - 'Ɖ' => 'ɖ', - 'Ɗ' => 'ɗ', - 'Ƌ' => 'ƌ', - 'Ǝ' => 'ǝ', - 'Ə' => 'ə', - 'Ɛ' => 'ɛ', - 'Ƒ' => 'ƒ', - 'Ɠ' => 'ɠ', - 'Ɣ' => 'ɣ', - 'Ɩ' => 'ɩ', - 'Ɨ' => 'ɨ', - 'Ƙ' => 'ƙ', - 'Ɯ' => 'ɯ', - 'Ɲ' => 'ɲ', - 'Ɵ' => 'ɵ', - 'Ơ' => 'ơ', - 'Ƣ' => 'ƣ', - 'Ƥ' => 'ƥ', - 'Ʀ' => 'ʀ', - 'Ƨ' => 'ƨ', - 'Ʃ' => 'ʃ', - 'Ƭ' => 'ƭ', - 'Ʈ' => 'ʈ', - 'Ư' => 'ư', - 'Ʊ' => 'ʊ', - 'Ʋ' => 'ʋ', - 'Ƴ' => 'ƴ', - 'Ƶ' => 'ƶ', - 'Ʒ' => 'ʒ', - 'Ƹ' => 'ƹ', - 'Ƽ' => 'ƽ', - 'DŽ' => 'dž', - 'Dž' => 'dž', - 'LJ' => 'lj', - 'Lj' => 'lj', - 'NJ' => 'nj', - 'Nj' => 'nj', - 'Ǎ' => 'ǎ', - 'Ǐ' => 'ǐ', - 'Ǒ' => 'ǒ', - 'Ǔ' => 'ǔ', - 'Ǖ' => 'ǖ', - 'Ǘ' => 'ǘ', - 'Ǚ' => 'ǚ', - 'Ǜ' => 'ǜ', - 'Ǟ' => 'ǟ', - 'Ǡ' => 'ǡ', - 'Ǣ' => 'ǣ', - 'Ǥ' => 'ǥ', - 'Ǧ' => 'ǧ', - 'Ǩ' => 'ǩ', - 'Ǫ' => 'ǫ', - 'Ǭ' => 'ǭ', - 'Ǯ' => 'ǯ', - 'DZ' => 'dz', - 'Dz' => 'dz', - 'Ǵ' => 'ǵ', - 'Ƕ' => 'ƕ', - 'Ƿ' => 'ƿ', - 'Ǹ' => 'ǹ', - 'Ǻ' => 'ǻ', - 'Ǽ' => 'ǽ', - 'Ǿ' => 'ǿ', - 'Ȁ' => 'ȁ', - 'Ȃ' => 'ȃ', - 'Ȅ' => 'ȅ', - 'Ȇ' => 'ȇ', - 'Ȉ' => 'ȉ', - 'Ȋ' => 'ȋ', - 'Ȍ' => 'ȍ', - 'Ȏ' => 'ȏ', - 'Ȑ' => 'ȑ', - 'Ȓ' => 'ȓ', - 'Ȕ' => 'ȕ', - 'Ȗ' => 'ȗ', - 'Ș' => 'ș', - 'Ț' => 'ț', - 'Ȝ' => 'ȝ', - 'Ȟ' => 'ȟ', - 'Ƞ' => 'ƞ', - 'Ȣ' => 'ȣ', - 'Ȥ' => 'ȥ', - 'Ȧ' => 'ȧ', - 'Ȩ' => 'ȩ', - 'Ȫ' => 'ȫ', - 'Ȭ' => 'ȭ', - 'Ȯ' => 'ȯ', - 'Ȱ' => 'ȱ', - 'Ȳ' => 'ȳ', - 'Ⱥ' => 'ⱥ', - 'Ȼ' => 'ȼ', - 'Ƚ' => 'ƚ', - 'Ⱦ' => 'ⱦ', - 'Ɂ' => 'ɂ', - 'Ƀ' => 'ƀ', - 'Ʉ' => 'ʉ', - 'Ʌ' => 'ʌ', - 'Ɇ' => 'ɇ', - 'Ɉ' => 'ɉ', - 'Ɋ' => 'ɋ', - 'Ɍ' => 'ɍ', - 'Ɏ' => 'ɏ', - 'Ͱ' => 'ͱ', - 'Ͳ' => 'ͳ', - 'Ͷ' => 'ͷ', - 'Ϳ' => 'ϳ', - 'Ά' => 'ά', - 'Έ' => 'έ', - 'Ή' => 'ή', - 'Ί' => 'ί', - 'Ό' => 'ό', - 'Ύ' => 'ύ', - 'Ώ' => 'ώ', - 'Α' => 'α', - 'Β' => 'β', - 'Γ' => 'γ', - 'Δ' => 'δ', - 'Ε' => 'ε', - 'Ζ' => 'ζ', - 'Η' => 'η', - 'Θ' => 'θ', - 'Ι' => 'ι', - 'Κ' => 'κ', - 'Λ' => 'λ', - 'Μ' => 'μ', - 'Ν' => 'ν', - 'Ξ' => 'ξ', - 'Ο' => 'ο', - 'Π' => 'π', - 'Ρ' => 'ρ', - 'Σ' => 'σ', - 'Τ' => 'τ', - 'Υ' => 'υ', - 'Φ' => 'φ', - 'Χ' => 'χ', - 'Ψ' => 'ψ', - 'Ω' => 'ω', - 'Ϊ' => 'ϊ', - 'Ϋ' => 'ϋ', - 'Ϗ' => 'ϗ', - 'Ϙ' => 'ϙ', - 'Ϛ' => 'ϛ', - 'Ϝ' => 'ϝ', - 'Ϟ' => 'ϟ', - 'Ϡ' => 'ϡ', - 'Ϣ' => 'ϣ', - 'Ϥ' => 'ϥ', - 'Ϧ' => 'ϧ', - 'Ϩ' => 'ϩ', - 'Ϫ' => 'ϫ', - 'Ϭ' => 'ϭ', - 'Ϯ' => 'ϯ', - 'ϴ' => 'θ', - 'Ϸ' => 'ϸ', - 'Ϲ' => 'ϲ', - 'Ϻ' => 'ϻ', - 'Ͻ' => 'ͻ', - 'Ͼ' => 'ͼ', - 'Ͽ' => 'ͽ', - 'Ѐ' => 'ѐ', - 'Ё' => 'ё', - 'Ђ' => 'ђ', - 'Ѓ' => 'ѓ', - 'Є' => 'є', - 'Ѕ' => 'ѕ', - 'І' => 'і', - 'Ї' => 'ї', - 'Ј' => 'ј', - 'Љ' => 'љ', - 'Њ' => 'њ', - 'Ћ' => 'ћ', - 'Ќ' => 'ќ', - 'Ѝ' => 'ѝ', - 'Ў' => 'ў', - 'Џ' => 'џ', - 'А' => 'а', - 'Б' => 'б', - 'В' => 'в', - 'Г' => 'г', - 'Д' => 'д', - 'Е' => 'е', - 'Ж' => 'ж', - 'З' => 'з', - 'И' => 'и', - 'Й' => 'й', - 'К' => 'к', - 'Л' => 'л', - 'М' => 'м', - 'Н' => 'н', - 'О' => 'о', - 'П' => 'п', - 'Р' => 'р', - 'С' => 'с', - 'Т' => 'т', - 'У' => 'у', - 'Ф' => 'ф', - 'Х' => 'х', - 'Ц' => 'ц', - 'Ч' => 'ч', - 'Ш' => 'ш', - 'Щ' => 'щ', - 'Ъ' => 'ъ', - 'Ы' => 'ы', - 'Ь' => 'ь', - 'Э' => 'э', - 'Ю' => 'ю', - 'Я' => 'я', - 'Ѡ' => 'ѡ', - 'Ѣ' => 'ѣ', - 'Ѥ' => 'ѥ', - 'Ѧ' => 'ѧ', - 'Ѩ' => 'ѩ', - 'Ѫ' => 'ѫ', - 'Ѭ' => 'ѭ', - 'Ѯ' => 'ѯ', - 'Ѱ' => 'ѱ', - 'Ѳ' => 'ѳ', - 'Ѵ' => 'ѵ', - 'Ѷ' => 'ѷ', - 'Ѹ' => 'ѹ', - 'Ѻ' => 'ѻ', - 'Ѽ' => 'ѽ', - 'Ѿ' => 'ѿ', - 'Ҁ' => 'ҁ', - 'Ҋ' => 'ҋ', - 'Ҍ' => 'ҍ', - 'Ҏ' => 'ҏ', - 'Ґ' => 'ґ', - 'Ғ' => 'ғ', - 'Ҕ' => 'ҕ', - 'Җ' => 'җ', - 'Ҙ' => 'ҙ', - 'Қ' => 'қ', - 'Ҝ' => 'ҝ', - 'Ҟ' => 'ҟ', - 'Ҡ' => 'ҡ', - 'Ң' => 'ң', - 'Ҥ' => 'ҥ', - 'Ҧ' => 'ҧ', - 'Ҩ' => 'ҩ', - 'Ҫ' => 'ҫ', - 'Ҭ' => 'ҭ', - 'Ү' => 'ү', - 'Ұ' => 'ұ', - 'Ҳ' => 'ҳ', - 'Ҵ' => 'ҵ', - 'Ҷ' => 'ҷ', - 'Ҹ' => 'ҹ', - 'Һ' => 'һ', - 'Ҽ' => 'ҽ', - 'Ҿ' => 'ҿ', - 'Ӏ' => 'ӏ', - 'Ӂ' => 'ӂ', - 'Ӄ' => 'ӄ', - 'Ӆ' => 'ӆ', - 'Ӈ' => 'ӈ', - 'Ӊ' => 'ӊ', - 'Ӌ' => 'ӌ', - 'Ӎ' => 'ӎ', - 'Ӑ' => 'ӑ', - 'Ӓ' => 'ӓ', - 'Ӕ' => 'ӕ', - 'Ӗ' => 'ӗ', - 'Ә' => 'ә', - 'Ӛ' => 'ӛ', - 'Ӝ' => 'ӝ', - 'Ӟ' => 'ӟ', - 'Ӡ' => 'ӡ', - 'Ӣ' => 'ӣ', - 'Ӥ' => 'ӥ', - 'Ӧ' => 'ӧ', - 'Ө' => 'ө', - 'Ӫ' => 'ӫ', - 'Ӭ' => 'ӭ', - 'Ӯ' => 'ӯ', - 'Ӱ' => 'ӱ', - 'Ӳ' => 'ӳ', - 'Ӵ' => 'ӵ', - 'Ӷ' => 'ӷ', - 'Ӹ' => 'ӹ', - 'Ӻ' => 'ӻ', - 'Ӽ' => 'ӽ', - 'Ӿ' => 'ӿ', - 'Ԁ' => 'ԁ', - 'Ԃ' => 'ԃ', - 'Ԅ' => 'ԅ', - 'Ԇ' => 'ԇ', - 'Ԉ' => 'ԉ', - 'Ԋ' => 'ԋ', - 'Ԍ' => 'ԍ', - 'Ԏ' => 'ԏ', - 'Ԑ' => 'ԑ', - 'Ԓ' => 'ԓ', - 'Ԕ' => 'ԕ', - 'Ԗ' => 'ԗ', - 'Ԙ' => 'ԙ', - 'Ԛ' => 'ԛ', - 'Ԝ' => 'ԝ', - 'Ԟ' => 'ԟ', - 'Ԡ' => 'ԡ', - 'Ԣ' => 'ԣ', - 'Ԥ' => 'ԥ', - 'Ԧ' => 'ԧ', - 'Ԩ' => 'ԩ', - 'Ԫ' => 'ԫ', - 'Ԭ' => 'ԭ', - 'Ԯ' => 'ԯ', - 'Ա' => 'ա', - 'Բ' => 'բ', - 'Գ' => 'գ', - 'Դ' => 'դ', - 'Ե' => 'ե', - 'Զ' => 'զ', - 'Է' => 'է', - 'Ը' => 'ը', - 'Թ' => 'թ', - 'Ժ' => 'ժ', - 'Ի' => 'ի', - 'Լ' => 'լ', - 'Խ' => 'խ', - 'Ծ' => 'ծ', - 'Կ' => 'կ', - 'Հ' => 'հ', - 'Ձ' => 'ձ', - 'Ղ' => 'ղ', - 'Ճ' => 'ճ', - 'Մ' => 'մ', - 'Յ' => 'յ', - 'Ն' => 'ն', - 'Շ' => 'շ', - 'Ո' => 'ո', - 'Չ' => 'չ', - 'Պ' => 'պ', - 'Ջ' => 'ջ', - 'Ռ' => 'ռ', - 'Ս' => 'ս', - 'Վ' => 'վ', - 'Տ' => 'տ', - 'Ր' => 'ր', - 'Ց' => 'ց', - 'Ւ' => 'ւ', - 'Փ' => 'փ', - 'Ք' => 'ք', - 'Օ' => 'օ', - 'Ֆ' => 'ֆ', - 'Ⴀ' => 'ⴀ', - 'Ⴁ' => 'ⴁ', - 'Ⴂ' => 'ⴂ', - 'Ⴃ' => 'ⴃ', - 'Ⴄ' => 'ⴄ', - 'Ⴅ' => 'ⴅ', - 'Ⴆ' => 'ⴆ', - 'Ⴇ' => 'ⴇ', - 'Ⴈ' => 'ⴈ', - 'Ⴉ' => 'ⴉ', - 'Ⴊ' => 'ⴊ', - 'Ⴋ' => 'ⴋ', - 'Ⴌ' => 'ⴌ', - 'Ⴍ' => 'ⴍ', - 'Ⴎ' => 'ⴎ', - 'Ⴏ' => 'ⴏ', - 'Ⴐ' => 'ⴐ', - 'Ⴑ' => 'ⴑ', - 'Ⴒ' => 'ⴒ', - 'Ⴓ' => 'ⴓ', - 'Ⴔ' => 'ⴔ', - 'Ⴕ' => 'ⴕ', - 'Ⴖ' => 'ⴖ', - 'Ⴗ' => 'ⴗ', - 'Ⴘ' => 'ⴘ', - 'Ⴙ' => 'ⴙ', - 'Ⴚ' => 'ⴚ', - 'Ⴛ' => 'ⴛ', - 'Ⴜ' => 'ⴜ', - 'Ⴝ' => 'ⴝ', - 'Ⴞ' => 'ⴞ', - 'Ⴟ' => 'ⴟ', - 'Ⴠ' => 'ⴠ', - 'Ⴡ' => 'ⴡ', - 'Ⴢ' => 'ⴢ', - 'Ⴣ' => 'ⴣ', - 'Ⴤ' => 'ⴤ', - 'Ⴥ' => 'ⴥ', - 'Ⴧ' => 'ⴧ', - 'Ⴭ' => 'ⴭ', - 'Ꭰ' => 'ꭰ', - 'Ꭱ' => 'ꭱ', - 'Ꭲ' => 'ꭲ', - 'Ꭳ' => 'ꭳ', - 'Ꭴ' => 'ꭴ', - 'Ꭵ' => 'ꭵ', - 'Ꭶ' => 'ꭶ', - 'Ꭷ' => 'ꭷ', - 'Ꭸ' => 'ꭸ', - 'Ꭹ' => 'ꭹ', - 'Ꭺ' => 'ꭺ', - 'Ꭻ' => 'ꭻ', - 'Ꭼ' => 'ꭼ', - 'Ꭽ' => 'ꭽ', - 'Ꭾ' => 'ꭾ', - 'Ꭿ' => 'ꭿ', - 'Ꮀ' => 'ꮀ', - 'Ꮁ' => 'ꮁ', - 'Ꮂ' => 'ꮂ', - 'Ꮃ' => 'ꮃ', - 'Ꮄ' => 'ꮄ', - 'Ꮅ' => 'ꮅ', - 'Ꮆ' => 'ꮆ', - 'Ꮇ' => 'ꮇ', - 'Ꮈ' => 'ꮈ', - 'Ꮉ' => 'ꮉ', - 'Ꮊ' => 'ꮊ', - 'Ꮋ' => 'ꮋ', - 'Ꮌ' => 'ꮌ', - 'Ꮍ' => 'ꮍ', - 'Ꮎ' => 'ꮎ', - 'Ꮏ' => 'ꮏ', - 'Ꮐ' => 'ꮐ', - 'Ꮑ' => 'ꮑ', - 'Ꮒ' => 'ꮒ', - 'Ꮓ' => 'ꮓ', - 'Ꮔ' => 'ꮔ', - 'Ꮕ' => 'ꮕ', - 'Ꮖ' => 'ꮖ', - 'Ꮗ' => 'ꮗ', - 'Ꮘ' => 'ꮘ', - 'Ꮙ' => 'ꮙ', - 'Ꮚ' => 'ꮚ', - 'Ꮛ' => 'ꮛ', - 'Ꮜ' => 'ꮜ', - 'Ꮝ' => 'ꮝ', - 'Ꮞ' => 'ꮞ', - 'Ꮟ' => 'ꮟ', - 'Ꮠ' => 'ꮠ', - 'Ꮡ' => 'ꮡ', - 'Ꮢ' => 'ꮢ', - 'Ꮣ' => 'ꮣ', - 'Ꮤ' => 'ꮤ', - 'Ꮥ' => 'ꮥ', - 'Ꮦ' => 'ꮦ', - 'Ꮧ' => 'ꮧ', - 'Ꮨ' => 'ꮨ', - 'Ꮩ' => 'ꮩ', - 'Ꮪ' => 'ꮪ', - 'Ꮫ' => 'ꮫ', - 'Ꮬ' => 'ꮬ', - 'Ꮭ' => 'ꮭ', - 'Ꮮ' => 'ꮮ', - 'Ꮯ' => 'ꮯ', - 'Ꮰ' => 'ꮰ', - 'Ꮱ' => 'ꮱ', - 'Ꮲ' => 'ꮲ', - 'Ꮳ' => 'ꮳ', - 'Ꮴ' => 'ꮴ', - 'Ꮵ' => 'ꮵ', - 'Ꮶ' => 'ꮶ', - 'Ꮷ' => 'ꮷ', - 'Ꮸ' => 'ꮸ', - 'Ꮹ' => 'ꮹ', - 'Ꮺ' => 'ꮺ', - 'Ꮻ' => 'ꮻ', - 'Ꮼ' => 'ꮼ', - 'Ꮽ' => 'ꮽ', - 'Ꮾ' => 'ꮾ', - 'Ꮿ' => 'ꮿ', - 'Ᏸ' => 'ᏸ', - 'Ᏹ' => 'ᏹ', - 'Ᏺ' => 'ᏺ', - 'Ᏻ' => 'ᏻ', - 'Ᏼ' => 'ᏼ', - 'Ᏽ' => 'ᏽ', - 'Ა' => 'ა', - 'Ბ' => 'ბ', - 'Გ' => 'გ', - 'Დ' => 'დ', - 'Ე' => 'ე', - 'Ვ' => 'ვ', - 'Ზ' => 'ზ', - 'Თ' => 'თ', - 'Ი' => 'ი', - 'Კ' => 'კ', - 'Ლ' => 'ლ', - 'Მ' => 'მ', - 'Ნ' => 'ნ', - 'Ო' => 'ო', - 'Პ' => 'პ', - 'Ჟ' => 'ჟ', - 'Რ' => 'რ', - 'Ს' => 'ს', - 'Ტ' => 'ტ', - 'Უ' => 'უ', - 'Ფ' => 'ფ', - 'Ქ' => 'ქ', - 'Ღ' => 'ღ', - 'Ყ' => 'ყ', - 'Შ' => 'შ', - 'Ჩ' => 'ჩ', - 'Ც' => 'ც', - 'Ძ' => 'ძ', - 'Წ' => 'წ', - 'Ჭ' => 'ჭ', - 'Ხ' => 'ხ', - 'Ჯ' => 'ჯ', - 'Ჰ' => 'ჰ', - 'Ჱ' => 'ჱ', - 'Ჲ' => 'ჲ', - 'Ჳ' => 'ჳ', - 'Ჴ' => 'ჴ', - 'Ჵ' => 'ჵ', - 'Ჶ' => 'ჶ', - 'Ჷ' => 'ჷ', - 'Ჸ' => 'ჸ', - 'Ჹ' => 'ჹ', - 'Ჺ' => 'ჺ', - 'Ჽ' => 'ჽ', - 'Ჾ' => 'ჾ', - 'Ჿ' => 'ჿ', - 'Ḁ' => 'ḁ', - 'Ḃ' => 'ḃ', - 'Ḅ' => 'ḅ', - 'Ḇ' => 'ḇ', - 'Ḉ' => 'ḉ', - 'Ḋ' => 'ḋ', - 'Ḍ' => 'ḍ', - 'Ḏ' => 'ḏ', - 'Ḑ' => 'ḑ', - 'Ḓ' => 'ḓ', - 'Ḕ' => 'ḕ', - 'Ḗ' => 'ḗ', - 'Ḙ' => 'ḙ', - 'Ḛ' => 'ḛ', - 'Ḝ' => 'ḝ', - 'Ḟ' => 'ḟ', - 'Ḡ' => 'ḡ', - 'Ḣ' => 'ḣ', - 'Ḥ' => 'ḥ', - 'Ḧ' => 'ḧ', - 'Ḩ' => 'ḩ', - 'Ḫ' => 'ḫ', - 'Ḭ' => 'ḭ', - 'Ḯ' => 'ḯ', - 'Ḱ' => 'ḱ', - 'Ḳ' => 'ḳ', - 'Ḵ' => 'ḵ', - 'Ḷ' => 'ḷ', - 'Ḹ' => 'ḹ', - 'Ḻ' => 'ḻ', - 'Ḽ' => 'ḽ', - 'Ḿ' => 'ḿ', - 'Ṁ' => 'ṁ', - 'Ṃ' => 'ṃ', - 'Ṅ' => 'ṅ', - 'Ṇ' => 'ṇ', - 'Ṉ' => 'ṉ', - 'Ṋ' => 'ṋ', - 'Ṍ' => 'ṍ', - 'Ṏ' => 'ṏ', - 'Ṑ' => 'ṑ', - 'Ṓ' => 'ṓ', - 'Ṕ' => 'ṕ', - 'Ṗ' => 'ṗ', - 'Ṙ' => 'ṙ', - 'Ṛ' => 'ṛ', - 'Ṝ' => 'ṝ', - 'Ṟ' => 'ṟ', - 'Ṡ' => 'ṡ', - 'Ṣ' => 'ṣ', - 'Ṥ' => 'ṥ', - 'Ṧ' => 'ṧ', - 'Ṩ' => 'ṩ', - 'Ṫ' => 'ṫ', - 'Ṭ' => 'ṭ', - 'Ṯ' => 'ṯ', - 'Ṱ' => 'ṱ', - 'Ṳ' => 'ṳ', - 'Ṵ' => 'ṵ', - 'Ṷ' => 'ṷ', - 'Ṹ' => 'ṹ', - 'Ṻ' => 'ṻ', - 'Ṽ' => 'ṽ', - 'Ṿ' => 'ṿ', - 'Ẁ' => 'ẁ', - 'Ẃ' => 'ẃ', - 'Ẅ' => 'ẅ', - 'Ẇ' => 'ẇ', - 'Ẉ' => 'ẉ', - 'Ẋ' => 'ẋ', - 'Ẍ' => 'ẍ', - 'Ẏ' => 'ẏ', - 'Ẑ' => 'ẑ', - 'Ẓ' => 'ẓ', - 'Ẕ' => 'ẕ', - 'ẞ' => 'ß', - 'Ạ' => 'ạ', - 'Ả' => 'ả', - 'Ấ' => 'ấ', - 'Ầ' => 'ầ', - 'Ẩ' => 'ẩ', - 'Ẫ' => 'ẫ', - 'Ậ' => 'ậ', - 'Ắ' => 'ắ', - 'Ằ' => 'ằ', - 'Ẳ' => 'ẳ', - 'Ẵ' => 'ẵ', - 'Ặ' => 'ặ', - 'Ẹ' => 'ẹ', - 'Ẻ' => 'ẻ', - 'Ẽ' => 'ẽ', - 'Ế' => 'ế', - 'Ề' => 'ề', - 'Ể' => 'ể', - 'Ễ' => 'ễ', - 'Ệ' => 'ệ', - 'Ỉ' => 'ỉ', - 'Ị' => 'ị', - 'Ọ' => 'ọ', - 'Ỏ' => 'ỏ', - 'Ố' => 'ố', - 'Ồ' => 'ồ', - 'Ổ' => 'ổ', - 'Ỗ' => 'ỗ', - 'Ộ' => 'ộ', - 'Ớ' => 'ớ', - 'Ờ' => 'ờ', - 'Ở' => 'ở', - 'Ỡ' => 'ỡ', - 'Ợ' => 'ợ', - 'Ụ' => 'ụ', - 'Ủ' => 'ủ', - 'Ứ' => 'ứ', - 'Ừ' => 'ừ', - 'Ử' => 'ử', - 'Ữ' => 'ữ', - 'Ự' => 'ự', - 'Ỳ' => 'ỳ', - 'Ỵ' => 'ỵ', - 'Ỷ' => 'ỷ', - 'Ỹ' => 'ỹ', - 'Ỻ' => 'ỻ', - 'Ỽ' => 'ỽ', - 'Ỿ' => 'ỿ', - 'Ἀ' => 'ἀ', - 'Ἁ' => 'ἁ', - 'Ἂ' => 'ἂ', - 'Ἃ' => 'ἃ', - 'Ἄ' => 'ἄ', - 'Ἅ' => 'ἅ', - 'Ἆ' => 'ἆ', - 'Ἇ' => 'ἇ', - 'Ἐ' => 'ἐ', - 'Ἑ' => 'ἑ', - 'Ἒ' => 'ἒ', - 'Ἓ' => 'ἓ', - 'Ἔ' => 'ἔ', - 'Ἕ' => 'ἕ', - 'Ἠ' => 'ἠ', - 'Ἡ' => 'ἡ', - 'Ἢ' => 'ἢ', - 'Ἣ' => 'ἣ', - 'Ἤ' => 'ἤ', - 'Ἥ' => 'ἥ', - 'Ἦ' => 'ἦ', - 'Ἧ' => 'ἧ', - 'Ἰ' => 'ἰ', - 'Ἱ' => 'ἱ', - 'Ἲ' => 'ἲ', - 'Ἳ' => 'ἳ', - 'Ἴ' => 'ἴ', - 'Ἵ' => 'ἵ', - 'Ἶ' => 'ἶ', - 'Ἷ' => 'ἷ', - 'Ὀ' => 'ὀ', - 'Ὁ' => 'ὁ', - 'Ὂ' => 'ὂ', - 'Ὃ' => 'ὃ', - 'Ὄ' => 'ὄ', - 'Ὅ' => 'ὅ', - 'Ὑ' => 'ὑ', - 'Ὓ' => 'ὓ', - 'Ὕ' => 'ὕ', - 'Ὗ' => 'ὗ', - 'Ὠ' => 'ὠ', - 'Ὡ' => 'ὡ', - 'Ὢ' => 'ὢ', - 'Ὣ' => 'ὣ', - 'Ὤ' => 'ὤ', - 'Ὥ' => 'ὥ', - 'Ὦ' => 'ὦ', - 'Ὧ' => 'ὧ', - 'ᾈ' => 'ᾀ', - 'ᾉ' => 'ᾁ', - 'ᾊ' => 'ᾂ', - 'ᾋ' => 'ᾃ', - 'ᾌ' => 'ᾄ', - 'ᾍ' => 'ᾅ', - 'ᾎ' => 'ᾆ', - 'ᾏ' => 'ᾇ', - 'ᾘ' => 'ᾐ', - 'ᾙ' => 'ᾑ', - 'ᾚ' => 'ᾒ', - 'ᾛ' => 'ᾓ', - 'ᾜ' => 'ᾔ', - 'ᾝ' => 'ᾕ', - 'ᾞ' => 'ᾖ', - 'ᾟ' => 'ᾗ', - 'ᾨ' => 'ᾠ', - 'ᾩ' => 'ᾡ', - 'ᾪ' => 'ᾢ', - 'ᾫ' => 'ᾣ', - 'ᾬ' => 'ᾤ', - 'ᾭ' => 'ᾥ', - 'ᾮ' => 'ᾦ', - 'ᾯ' => 'ᾧ', - 'Ᾰ' => 'ᾰ', - 'Ᾱ' => 'ᾱ', - 'Ὰ' => 'ὰ', - 'Ά' => 'ά', - 'ᾼ' => 'ᾳ', - 'Ὲ' => 'ὲ', - 'Έ' => 'έ', - 'Ὴ' => 'ὴ', - 'Ή' => 'ή', - 'ῌ' => 'ῃ', - 'Ῐ' => 'ῐ', - 'Ῑ' => 'ῑ', - 'Ὶ' => 'ὶ', - 'Ί' => 'ί', - 'Ῠ' => 'ῠ', - 'Ῡ' => 'ῡ', - 'Ὺ' => 'ὺ', - 'Ύ' => 'ύ', - 'Ῥ' => 'ῥ', - 'Ὸ' => 'ὸ', - 'Ό' => 'ό', - 'Ὼ' => 'ὼ', - 'Ώ' => 'ώ', - 'ῼ' => 'ῳ', - 'Ω' => 'ω', - 'K' => 'k', - 'Å' => 'å', - 'Ⅎ' => 'ⅎ', - 'Ⅰ' => 'ⅰ', - 'Ⅱ' => 'ⅱ', - 'Ⅲ' => 'ⅲ', - 'Ⅳ' => 'ⅳ', - 'Ⅴ' => 'ⅴ', - 'Ⅵ' => 'ⅵ', - 'Ⅶ' => 'ⅶ', - 'Ⅷ' => 'ⅷ', - 'Ⅸ' => 'ⅸ', - 'Ⅹ' => 'ⅹ', - 'Ⅺ' => 'ⅺ', - 'Ⅻ' => 'ⅻ', - 'Ⅼ' => 'ⅼ', - 'Ⅽ' => 'ⅽ', - 'Ⅾ' => 'ⅾ', - 'Ⅿ' => 'ⅿ', - 'Ↄ' => 'ↄ', - 'Ⓐ' => 'ⓐ', - 'Ⓑ' => 'ⓑ', - 'Ⓒ' => 'ⓒ', - 'Ⓓ' => 'ⓓ', - 'Ⓔ' => 'ⓔ', - 'Ⓕ' => 'ⓕ', - 'Ⓖ' => 'ⓖ', - 'Ⓗ' => 'ⓗ', - 'Ⓘ' => 'ⓘ', - 'Ⓙ' => 'ⓙ', - 'Ⓚ' => 'ⓚ', - 'Ⓛ' => 'ⓛ', - 'Ⓜ' => 'ⓜ', - 'Ⓝ' => 'ⓝ', - 'Ⓞ' => 'ⓞ', - 'Ⓟ' => 'ⓟ', - 'Ⓠ' => 'ⓠ', - 'Ⓡ' => 'ⓡ', - 'Ⓢ' => 'ⓢ', - 'Ⓣ' => 'ⓣ', - 'Ⓤ' => 'ⓤ', - 'Ⓥ' => 'ⓥ', - 'Ⓦ' => 'ⓦ', - 'Ⓧ' => 'ⓧ', - 'Ⓨ' => 'ⓨ', - 'Ⓩ' => 'ⓩ', - 'Ⰰ' => 'ⰰ', - 'Ⰱ' => 'ⰱ', - 'Ⰲ' => 'ⰲ', - 'Ⰳ' => 'ⰳ', - 'Ⰴ' => 'ⰴ', - 'Ⰵ' => 'ⰵ', - 'Ⰶ' => 'ⰶ', - 'Ⰷ' => 'ⰷ', - 'Ⰸ' => 'ⰸ', - 'Ⰹ' => 'ⰹ', - 'Ⰺ' => 'ⰺ', - 'Ⰻ' => 'ⰻ', - 'Ⰼ' => 'ⰼ', - 'Ⰽ' => 'ⰽ', - 'Ⰾ' => 'ⰾ', - 'Ⰿ' => 'ⰿ', - 'Ⱀ' => 'ⱀ', - 'Ⱁ' => 'ⱁ', - 'Ⱂ' => 'ⱂ', - 'Ⱃ' => 'ⱃ', - 'Ⱄ' => 'ⱄ', - 'Ⱅ' => 'ⱅ', - 'Ⱆ' => 'ⱆ', - 'Ⱇ' => 'ⱇ', - 'Ⱈ' => 'ⱈ', - 'Ⱉ' => 'ⱉ', - 'Ⱊ' => 'ⱊ', - 'Ⱋ' => 'ⱋ', - 'Ⱌ' => 'ⱌ', - 'Ⱍ' => 'ⱍ', - 'Ⱎ' => 'ⱎ', - 'Ⱏ' => 'ⱏ', - 'Ⱐ' => 'ⱐ', - 'Ⱑ' => 'ⱑ', - 'Ⱒ' => 'ⱒ', - 'Ⱓ' => 'ⱓ', - 'Ⱔ' => 'ⱔ', - 'Ⱕ' => 'ⱕ', - 'Ⱖ' => 'ⱖ', - 'Ⱗ' => 'ⱗ', - 'Ⱘ' => 'ⱘ', - 'Ⱙ' => 'ⱙ', - 'Ⱚ' => 'ⱚ', - 'Ⱛ' => 'ⱛ', - 'Ⱜ' => 'ⱜ', - 'Ⱝ' => 'ⱝ', - 'Ⱞ' => 'ⱞ', - 'Ⱡ' => 'ⱡ', - 'Ɫ' => 'ɫ', - 'Ᵽ' => 'ᵽ', - 'Ɽ' => 'ɽ', - 'Ⱨ' => 'ⱨ', - 'Ⱪ' => 'ⱪ', - 'Ⱬ' => 'ⱬ', - 'Ɑ' => 'ɑ', - 'Ɱ' => 'ɱ', - 'Ɐ' => 'ɐ', - 'Ɒ' => 'ɒ', - 'Ⱳ' => 'ⱳ', - 'Ⱶ' => 'ⱶ', - 'Ȿ' => 'ȿ', - 'Ɀ' => 'ɀ', - 'Ⲁ' => 'ⲁ', - 'Ⲃ' => 'ⲃ', - 'Ⲅ' => 'ⲅ', - 'Ⲇ' => 'ⲇ', - 'Ⲉ' => 'ⲉ', - 'Ⲋ' => 'ⲋ', - 'Ⲍ' => 'ⲍ', - 'Ⲏ' => 'ⲏ', - 'Ⲑ' => 'ⲑ', - 'Ⲓ' => 'ⲓ', - 'Ⲕ' => 'ⲕ', - 'Ⲗ' => 'ⲗ', - 'Ⲙ' => 'ⲙ', - 'Ⲛ' => 'ⲛ', - 'Ⲝ' => 'ⲝ', - 'Ⲟ' => 'ⲟ', - 'Ⲡ' => 'ⲡ', - 'Ⲣ' => 'ⲣ', - 'Ⲥ' => 'ⲥ', - 'Ⲧ' => 'ⲧ', - 'Ⲩ' => 'ⲩ', - 'Ⲫ' => 'ⲫ', - 'Ⲭ' => 'ⲭ', - 'Ⲯ' => 'ⲯ', - 'Ⲱ' => 'ⲱ', - 'Ⲳ' => 'ⲳ', - 'Ⲵ' => 'ⲵ', - 'Ⲷ' => 'ⲷ', - 'Ⲹ' => 'ⲹ', - 'Ⲻ' => 'ⲻ', - 'Ⲽ' => 'ⲽ', - 'Ⲿ' => 'ⲿ', - 'Ⳁ' => 'ⳁ', - 'Ⳃ' => 'ⳃ', - 'Ⳅ' => 'ⳅ', - 'Ⳇ' => 'ⳇ', - 'Ⳉ' => 'ⳉ', - 'Ⳋ' => 'ⳋ', - 'Ⳍ' => 'ⳍ', - 'Ⳏ' => 'ⳏ', - 'Ⳑ' => 'ⳑ', - 'Ⳓ' => 'ⳓ', - 'Ⳕ' => 'ⳕ', - 'Ⳗ' => 'ⳗ', - 'Ⳙ' => 'ⳙ', - 'Ⳛ' => 'ⳛ', - 'Ⳝ' => 'ⳝ', - 'Ⳟ' => 'ⳟ', - 'Ⳡ' => 'ⳡ', - 'Ⳣ' => 'ⳣ', - 'Ⳬ' => 'ⳬ', - 'Ⳮ' => 'ⳮ', - 'Ⳳ' => 'ⳳ', - 'Ꙁ' => 'ꙁ', - 'Ꙃ' => 'ꙃ', - 'Ꙅ' => 'ꙅ', - 'Ꙇ' => 'ꙇ', - 'Ꙉ' => 'ꙉ', - 'Ꙋ' => 'ꙋ', - 'Ꙍ' => 'ꙍ', - 'Ꙏ' => 'ꙏ', - 'Ꙑ' => 'ꙑ', - 'Ꙓ' => 'ꙓ', - 'Ꙕ' => 'ꙕ', - 'Ꙗ' => 'ꙗ', - 'Ꙙ' => 'ꙙ', - 'Ꙛ' => 'ꙛ', - 'Ꙝ' => 'ꙝ', - 'Ꙟ' => 'ꙟ', - 'Ꙡ' => 'ꙡ', - 'Ꙣ' => 'ꙣ', - 'Ꙥ' => 'ꙥ', - 'Ꙧ' => 'ꙧ', - 'Ꙩ' => 'ꙩ', - 'Ꙫ' => 'ꙫ', - 'Ꙭ' => 'ꙭ', - 'Ꚁ' => 'ꚁ', - 'Ꚃ' => 'ꚃ', - 'Ꚅ' => 'ꚅ', - 'Ꚇ' => 'ꚇ', - 'Ꚉ' => 'ꚉ', - 'Ꚋ' => 'ꚋ', - 'Ꚍ' => 'ꚍ', - 'Ꚏ' => 'ꚏ', - 'Ꚑ' => 'ꚑ', - 'Ꚓ' => 'ꚓ', - 'Ꚕ' => 'ꚕ', - 'Ꚗ' => 'ꚗ', - 'Ꚙ' => 'ꚙ', - 'Ꚛ' => 'ꚛ', - 'Ꜣ' => 'ꜣ', - 'Ꜥ' => 'ꜥ', - 'Ꜧ' => 'ꜧ', - 'Ꜩ' => 'ꜩ', - 'Ꜫ' => 'ꜫ', - 'Ꜭ' => 'ꜭ', - 'Ꜯ' => 'ꜯ', - 'Ꜳ' => 'ꜳ', - 'Ꜵ' => 'ꜵ', - 'Ꜷ' => 'ꜷ', - 'Ꜹ' => 'ꜹ', - 'Ꜻ' => 'ꜻ', - 'Ꜽ' => 'ꜽ', - 'Ꜿ' => 'ꜿ', - 'Ꝁ' => 'ꝁ', - 'Ꝃ' => 'ꝃ', - 'Ꝅ' => 'ꝅ', - 'Ꝇ' => 'ꝇ', - 'Ꝉ' => 'ꝉ', - 'Ꝋ' => 'ꝋ', - 'Ꝍ' => 'ꝍ', - 'Ꝏ' => 'ꝏ', - 'Ꝑ' => 'ꝑ', - 'Ꝓ' => 'ꝓ', - 'Ꝕ' => 'ꝕ', - 'Ꝗ' => 'ꝗ', - 'Ꝙ' => 'ꝙ', - 'Ꝛ' => 'ꝛ', - 'Ꝝ' => 'ꝝ', - 'Ꝟ' => 'ꝟ', - 'Ꝡ' => 'ꝡ', - 'Ꝣ' => 'ꝣ', - 'Ꝥ' => 'ꝥ', - 'Ꝧ' => 'ꝧ', - 'Ꝩ' => 'ꝩ', - 'Ꝫ' => 'ꝫ', - 'Ꝭ' => 'ꝭ', - 'Ꝯ' => 'ꝯ', - 'Ꝺ' => 'ꝺ', - 'Ꝼ' => 'ꝼ', - 'Ᵹ' => 'ᵹ', - 'Ꝿ' => 'ꝿ', - 'Ꞁ' => 'ꞁ', - 'Ꞃ' => 'ꞃ', - 'Ꞅ' => 'ꞅ', - 'Ꞇ' => 'ꞇ', - 'Ꞌ' => 'ꞌ', - 'Ɥ' => 'ɥ', - 'Ꞑ' => 'ꞑ', - 'Ꞓ' => 'ꞓ', - 'Ꞗ' => 'ꞗ', - 'Ꞙ' => 'ꞙ', - 'Ꞛ' => 'ꞛ', - 'Ꞝ' => 'ꞝ', - 'Ꞟ' => 'ꞟ', - 'Ꞡ' => 'ꞡ', - 'Ꞣ' => 'ꞣ', - 'Ꞥ' => 'ꞥ', - 'Ꞧ' => 'ꞧ', - 'Ꞩ' => 'ꞩ', - 'Ɦ' => 'ɦ', - 'Ɜ' => 'ɜ', - 'Ɡ' => 'ɡ', - 'Ɬ' => 'ɬ', - 'Ɪ' => 'ɪ', - 'Ʞ' => 'ʞ', - 'Ʇ' => 'ʇ', - 'Ʝ' => 'ʝ', - 'Ꭓ' => 'ꭓ', - 'Ꞵ' => 'ꞵ', - 'Ꞷ' => 'ꞷ', - 'Ꞹ' => 'ꞹ', - 'Ꞻ' => 'ꞻ', - 'Ꞽ' => 'ꞽ', - 'Ꞿ' => 'ꞿ', - 'Ꟃ' => 'ꟃ', - 'Ꞔ' => 'ꞔ', - 'Ʂ' => 'ʂ', - 'Ᶎ' => 'ᶎ', - 'Ꟈ' => 'ꟈ', - 'Ꟊ' => 'ꟊ', - 'Ꟶ' => 'ꟶ', - 'A' => 'a', - 'B' => 'b', - 'C' => 'c', - 'D' => 'd', - 'E' => 'e', - 'F' => 'f', - 'G' => 'g', - 'H' => 'h', - 'I' => 'i', - 'J' => 'j', - 'K' => 'k', - 'L' => 'l', - 'M' => 'm', - 'N' => 'n', - 'O' => 'o', - 'P' => 'p', - 'Q' => 'q', - 'R' => 'r', - 'S' => 's', - 'T' => 't', - 'U' => 'u', - 'V' => 'v', - 'W' => 'w', - 'X' => 'x', - 'Y' => 'y', - 'Z' => 'z', - '𐐀' => '𐐨', - '𐐁' => '𐐩', - '𐐂' => '𐐪', - '𐐃' => '𐐫', - '𐐄' => '𐐬', - '𐐅' => '𐐭', - '𐐆' => '𐐮', - '𐐇' => '𐐯', - '𐐈' => '𐐰', - '𐐉' => '𐐱', - '𐐊' => '𐐲', - '𐐋' => '𐐳', - '𐐌' => '𐐴', - '𐐍' => '𐐵', - '𐐎' => '𐐶', - '𐐏' => '𐐷', - '𐐐' => '𐐸', - '𐐑' => '𐐹', - '𐐒' => '𐐺', - '𐐓' => '𐐻', - '𐐔' => '𐐼', - '𐐕' => '𐐽', - '𐐖' => '𐐾', - '𐐗' => '𐐿', - '𐐘' => '𐑀', - '𐐙' => '𐑁', - '𐐚' => '𐑂', - '𐐛' => '𐑃', - '𐐜' => '𐑄', - '𐐝' => '𐑅', - '𐐞' => '𐑆', - '𐐟' => '𐑇', - '𐐠' => '𐑈', - '𐐡' => '𐑉', - '𐐢' => '𐑊', - '𐐣' => '𐑋', - '𐐤' => '𐑌', - '𐐥' => '𐑍', - '𐐦' => '𐑎', - '𐐧' => '𐑏', - '𐒰' => '𐓘', - '𐒱' => '𐓙', - '𐒲' => '𐓚', - '𐒳' => '𐓛', - '𐒴' => '𐓜', - '𐒵' => '𐓝', - '𐒶' => '𐓞', - '𐒷' => '𐓟', - '𐒸' => '𐓠', - '𐒹' => '𐓡', - '𐒺' => '𐓢', - '𐒻' => '𐓣', - '𐒼' => '𐓤', - '𐒽' => '𐓥', - '𐒾' => '𐓦', - '𐒿' => '𐓧', - '𐓀' => '𐓨', - '𐓁' => '𐓩', - '𐓂' => '𐓪', - '𐓃' => '𐓫', - '𐓄' => '𐓬', - '𐓅' => '𐓭', - '𐓆' => '𐓮', - '𐓇' => '𐓯', - '𐓈' => '𐓰', - '𐓉' => '𐓱', - '𐓊' => '𐓲', - '𐓋' => '𐓳', - '𐓌' => '𐓴', - '𐓍' => '𐓵', - '𐓎' => '𐓶', - '𐓏' => '𐓷', - '𐓐' => '𐓸', - '𐓑' => '𐓹', - '𐓒' => '𐓺', - '𐓓' => '𐓻', - '𐲀' => '𐳀', - '𐲁' => '𐳁', - '𐲂' => '𐳂', - '𐲃' => '𐳃', - '𐲄' => '𐳄', - '𐲅' => '𐳅', - '𐲆' => '𐳆', - '𐲇' => '𐳇', - '𐲈' => '𐳈', - '𐲉' => '𐳉', - '𐲊' => '𐳊', - '𐲋' => '𐳋', - '𐲌' => '𐳌', - '𐲍' => '𐳍', - '𐲎' => '𐳎', - '𐲏' => '𐳏', - '𐲐' => '𐳐', - '𐲑' => '𐳑', - '𐲒' => '𐳒', - '𐲓' => '𐳓', - '𐲔' => '𐳔', - '𐲕' => '𐳕', - '𐲖' => '𐳖', - '𐲗' => '𐳗', - '𐲘' => '𐳘', - '𐲙' => '𐳙', - '𐲚' => '𐳚', - '𐲛' => '𐳛', - '𐲜' => '𐳜', - '𐲝' => '𐳝', - '𐲞' => '𐳞', - '𐲟' => '𐳟', - '𐲠' => '𐳠', - '𐲡' => '𐳡', - '𐲢' => '𐳢', - '𐲣' => '𐳣', - '𐲤' => '𐳤', - '𐲥' => '𐳥', - '𐲦' => '𐳦', - '𐲧' => '𐳧', - '𐲨' => '𐳨', - '𐲩' => '𐳩', - '𐲪' => '𐳪', - '𐲫' => '𐳫', - '𐲬' => '𐳬', - '𐲭' => '𐳭', - '𐲮' => '𐳮', - '𐲯' => '𐳯', - '𐲰' => '𐳰', - '𐲱' => '𐳱', - '𐲲' => '𐳲', - '𑢠' => '𑣀', - '𑢡' => '𑣁', - '𑢢' => '𑣂', - '𑢣' => '𑣃', - '𑢤' => '𑣄', - '𑢥' => '𑣅', - '𑢦' => '𑣆', - '𑢧' => '𑣇', - '𑢨' => '𑣈', - '𑢩' => '𑣉', - '𑢪' => '𑣊', - '𑢫' => '𑣋', - '𑢬' => '𑣌', - '𑢭' => '𑣍', - '𑢮' => '𑣎', - '𑢯' => '𑣏', - '𑢰' => '𑣐', - '𑢱' => '𑣑', - '𑢲' => '𑣒', - '𑢳' => '𑣓', - '𑢴' => '𑣔', - '𑢵' => '𑣕', - '𑢶' => '𑣖', - '𑢷' => '𑣗', - '𑢸' => '𑣘', - '𑢹' => '𑣙', - '𑢺' => '𑣚', - '𑢻' => '𑣛', - '𑢼' => '𑣜', - '𑢽' => '𑣝', - '𑢾' => '𑣞', - '𑢿' => '𑣟', - '𖹀' => '𖹠', - '𖹁' => '𖹡', - '𖹂' => '𖹢', - '𖹃' => '𖹣', - '𖹄' => '𖹤', - '𖹅' => '𖹥', - '𖹆' => '𖹦', - '𖹇' => '𖹧', - '𖹈' => '𖹨', - '𖹉' => '𖹩', - '𖹊' => '𖹪', - '𖹋' => '𖹫', - '𖹌' => '𖹬', - '𖹍' => '𖹭', - '𖹎' => '𖹮', - '𖹏' => '𖹯', - '𖹐' => '𖹰', - '𖹑' => '𖹱', - '𖹒' => '𖹲', - '𖹓' => '𖹳', - '𖹔' => '𖹴', - '𖹕' => '𖹵', - '𖹖' => '𖹶', - '𖹗' => '𖹷', - '𖹘' => '𖹸', - '𖹙' => '𖹹', - '𖹚' => '𖹺', - '𖹛' => '𖹻', - '𖹜' => '𖹼', - '𖹝' => '𖹽', - '𖹞' => '𖹾', - '𖹟' => '𖹿', - '𞤀' => '𞤢', - '𞤁' => '𞤣', - '𞤂' => '𞤤', - '𞤃' => '𞤥', - '𞤄' => '𞤦', - '𞤅' => '𞤧', - '𞤆' => '𞤨', - '𞤇' => '𞤩', - '𞤈' => '𞤪', - '𞤉' => '𞤫', - '𞤊' => '𞤬', - '𞤋' => '𞤭', - '𞤌' => '𞤮', - '𞤍' => '𞤯', - '𞤎' => '𞤰', - '𞤏' => '𞤱', - '𞤐' => '𞤲', - '𞤑' => '𞤳', - '𞤒' => '𞤴', - '𞤓' => '𞤵', - '𞤔' => '𞤶', - '𞤕' => '𞤷', - '𞤖' => '𞤸', - '𞤗' => '𞤹', - '𞤘' => '𞤺', - '𞤙' => '𞤻', - '𞤚' => '𞤼', - '𞤛' => '𞤽', - '𞤜' => '𞤾', - '𞤝' => '𞤿', - '𞤞' => '𞥀', - '𞤟' => '𞥁', - '𞤠' => '𞥂', - '𞤡' => '𞥃', -); diff --git a/system/vendor/symfony/polyfill-mbstring/Resources/unidata/titleCaseRegexp.php b/system/vendor/symfony/polyfill-mbstring/Resources/unidata/titleCaseRegexp.php deleted file mode 100644 index 2a8f6e7..0000000 --- a/system/vendor/symfony/polyfill-mbstring/Resources/unidata/titleCaseRegexp.php +++ /dev/null @@ -1,5 +0,0 @@ - 'A', - 'b' => 'B', - 'c' => 'C', - 'd' => 'D', - 'e' => 'E', - 'f' => 'F', - 'g' => 'G', - 'h' => 'H', - 'i' => 'I', - 'j' => 'J', - 'k' => 'K', - 'l' => 'L', - 'm' => 'M', - 'n' => 'N', - 'o' => 'O', - 'p' => 'P', - 'q' => 'Q', - 'r' => 'R', - 's' => 'S', - 't' => 'T', - 'u' => 'U', - 'v' => 'V', - 'w' => 'W', - 'x' => 'X', - 'y' => 'Y', - 'z' => 'Z', - 'µ' => 'Μ', - 'à' => 'À', - 'á' => 'Á', - 'â' => 'Â', - 'ã' => 'Ã', - 'ä' => 'Ä', - 'å' => 'Å', - 'æ' => 'Æ', - 'ç' => 'Ç', - 'è' => 'È', - 'é' => 'É', - 'ê' => 'Ê', - 'ë' => 'Ë', - 'ì' => 'Ì', - 'í' => 'Í', - 'î' => 'Î', - 'ï' => 'Ï', - 'ð' => 'Ð', - 'ñ' => 'Ñ', - 'ò' => 'Ò', - 'ó' => 'Ó', - 'ô' => 'Ô', - 'õ' => 'Õ', - 'ö' => 'Ö', - 'ø' => 'Ø', - 'ù' => 'Ù', - 'ú' => 'Ú', - 'û' => 'Û', - 'ü' => 'Ü', - 'ý' => 'Ý', - 'þ' => 'Þ', - 'ÿ' => 'Ÿ', - 'ā' => 'Ā', - 'ă' => 'Ă', - 'ą' => 'Ą', - 'ć' => 'Ć', - 'ĉ' => 'Ĉ', - 'ċ' => 'Ċ', - 'č' => 'Č', - 'ď' => 'Ď', - 'đ' => 'Đ', - 'ē' => 'Ē', - 'ĕ' => 'Ĕ', - 'ė' => 'Ė', - 'ę' => 'Ę', - 'ě' => 'Ě', - 'ĝ' => 'Ĝ', - 'ğ' => 'Ğ', - 'ġ' => 'Ġ', - 'ģ' => 'Ģ', - 'ĥ' => 'Ĥ', - 'ħ' => 'Ħ', - 'ĩ' => 'Ĩ', - 'ī' => 'Ī', - 'ĭ' => 'Ĭ', - 'į' => 'Į', - 'ı' => 'I', - 'ij' => 'IJ', - 'ĵ' => 'Ĵ', - 'ķ' => 'Ķ', - 'ĺ' => 'Ĺ', - 'ļ' => 'Ļ', - 'ľ' => 'Ľ', - 'ŀ' => 'Ŀ', - 'ł' => 'Ł', - 'ń' => 'Ń', - 'ņ' => 'Ņ', - 'ň' => 'Ň', - 'ŋ' => 'Ŋ', - 'ō' => 'Ō', - 'ŏ' => 'Ŏ', - 'ő' => 'Ő', - 'œ' => 'Œ', - 'ŕ' => 'Ŕ', - 'ŗ' => 'Ŗ', - 'ř' => 'Ř', - 'ś' => 'Ś', - 'ŝ' => 'Ŝ', - 'ş' => 'Ş', - 'š' => 'Š', - 'ţ' => 'Ţ', - 'ť' => 'Ť', - 'ŧ' => 'Ŧ', - 'ũ' => 'Ũ', - 'ū' => 'Ū', - 'ŭ' => 'Ŭ', - 'ů' => 'Ů', - 'ű' => 'Ű', - 'ų' => 'Ų', - 'ŵ' => 'Ŵ', - 'ŷ' => 'Ŷ', - 'ź' => 'Ź', - 'ż' => 'Ż', - 'ž' => 'Ž', - 'ſ' => 'S', - 'ƀ' => 'Ƀ', - 'ƃ' => 'Ƃ', - 'ƅ' => 'Ƅ', - 'ƈ' => 'Ƈ', - 'ƌ' => 'Ƌ', - 'ƒ' => 'Ƒ', - 'ƕ' => 'Ƕ', - 'ƙ' => 'Ƙ', - 'ƚ' => 'Ƚ', - 'ƞ' => 'Ƞ', - 'ơ' => 'Ơ', - 'ƣ' => 'Ƣ', - 'ƥ' => 'Ƥ', - 'ƨ' => 'Ƨ', - 'ƭ' => 'Ƭ', - 'ư' => 'Ư', - 'ƴ' => 'Ƴ', - 'ƶ' => 'Ƶ', - 'ƹ' => 'Ƹ', - 'ƽ' => 'Ƽ', - 'ƿ' => 'Ƿ', - 'Dž' => 'DŽ', - 'dž' => 'DŽ', - 'Lj' => 'LJ', - 'lj' => 'LJ', - 'Nj' => 'NJ', - 'nj' => 'NJ', - 'ǎ' => 'Ǎ', - 'ǐ' => 'Ǐ', - 'ǒ' => 'Ǒ', - 'ǔ' => 'Ǔ', - 'ǖ' => 'Ǖ', - 'ǘ' => 'Ǘ', - 'ǚ' => 'Ǚ', - 'ǜ' => 'Ǜ', - 'ǝ' => 'Ǝ', - 'ǟ' => 'Ǟ', - 'ǡ' => 'Ǡ', - 'ǣ' => 'Ǣ', - 'ǥ' => 'Ǥ', - 'ǧ' => 'Ǧ', - 'ǩ' => 'Ǩ', - 'ǫ' => 'Ǫ', - 'ǭ' => 'Ǭ', - 'ǯ' => 'Ǯ', - 'Dz' => 'DZ', - 'dz' => 'DZ', - 'ǵ' => 'Ǵ', - 'ǹ' => 'Ǹ', - 'ǻ' => 'Ǻ', - 'ǽ' => 'Ǽ', - 'ǿ' => 'Ǿ', - 'ȁ' => 'Ȁ', - 'ȃ' => 'Ȃ', - 'ȅ' => 'Ȅ', - 'ȇ' => 'Ȇ', - 'ȉ' => 'Ȉ', - 'ȋ' => 'Ȋ', - 'ȍ' => 'Ȍ', - 'ȏ' => 'Ȏ', - 'ȑ' => 'Ȑ', - 'ȓ' => 'Ȓ', - 'ȕ' => 'Ȕ', - 'ȗ' => 'Ȗ', - 'ș' => 'Ș', - 'ț' => 'Ț', - 'ȝ' => 'Ȝ', - 'ȟ' => 'Ȟ', - 'ȣ' => 'Ȣ', - 'ȥ' => 'Ȥ', - 'ȧ' => 'Ȧ', - 'ȩ' => 'Ȩ', - 'ȫ' => 'Ȫ', - 'ȭ' => 'Ȭ', - 'ȯ' => 'Ȯ', - 'ȱ' => 'Ȱ', - 'ȳ' => 'Ȳ', - 'ȼ' => 'Ȼ', - 'ȿ' => 'Ȿ', - 'ɀ' => 'Ɀ', - 'ɂ' => 'Ɂ', - 'ɇ' => 'Ɇ', - 'ɉ' => 'Ɉ', - 'ɋ' => 'Ɋ', - 'ɍ' => 'Ɍ', - 'ɏ' => 'Ɏ', - 'ɐ' => 'Ɐ', - 'ɑ' => 'Ɑ', - 'ɒ' => 'Ɒ', - 'ɓ' => 'Ɓ', - 'ɔ' => 'Ɔ', - 'ɖ' => 'Ɖ', - 'ɗ' => 'Ɗ', - 'ə' => 'Ə', - 'ɛ' => 'Ɛ', - 'ɜ' => 'Ɜ', - 'ɠ' => 'Ɠ', - 'ɡ' => 'Ɡ', - 'ɣ' => 'Ɣ', - 'ɥ' => 'Ɥ', - 'ɦ' => 'Ɦ', - 'ɨ' => 'Ɨ', - 'ɩ' => 'Ɩ', - 'ɪ' => 'Ɪ', - 'ɫ' => 'Ɫ', - 'ɬ' => 'Ɬ', - 'ɯ' => 'Ɯ', - 'ɱ' => 'Ɱ', - 'ɲ' => 'Ɲ', - 'ɵ' => 'Ɵ', - 'ɽ' => 'Ɽ', - 'ʀ' => 'Ʀ', - 'ʂ' => 'Ʂ', - 'ʃ' => 'Ʃ', - 'ʇ' => 'Ʇ', - 'ʈ' => 'Ʈ', - 'ʉ' => 'Ʉ', - 'ʊ' => 'Ʊ', - 'ʋ' => 'Ʋ', - 'ʌ' => 'Ʌ', - 'ʒ' => 'Ʒ', - 'ʝ' => 'Ʝ', - 'ʞ' => 'Ʞ', - 'ͅ' => 'Ι', - 'ͱ' => 'Ͱ', - 'ͳ' => 'Ͳ', - 'ͷ' => 'Ͷ', - 'ͻ' => 'Ͻ', - 'ͼ' => 'Ͼ', - 'ͽ' => 'Ͽ', - 'ά' => 'Ά', - 'έ' => 'Έ', - 'ή' => 'Ή', - 'ί' => 'Ί', - 'α' => 'Α', - 'β' => 'Β', - 'γ' => 'Γ', - 'δ' => 'Δ', - 'ε' => 'Ε', - 'ζ' => 'Ζ', - 'η' => 'Η', - 'θ' => 'Θ', - 'ι' => 'Ι', - 'κ' => 'Κ', - 'λ' => 'Λ', - 'μ' => 'Μ', - 'ν' => 'Ν', - 'ξ' => 'Ξ', - 'ο' => 'Ο', - 'π' => 'Π', - 'ρ' => 'Ρ', - 'ς' => 'Σ', - 'σ' => 'Σ', - 'τ' => 'Τ', - 'υ' => 'Υ', - 'φ' => 'Φ', - 'χ' => 'Χ', - 'ψ' => 'Ψ', - 'ω' => 'Ω', - 'ϊ' => 'Ϊ', - 'ϋ' => 'Ϋ', - 'ό' => 'Ό', - 'ύ' => 'Ύ', - 'ώ' => 'Ώ', - 'ϐ' => 'Β', - 'ϑ' => 'Θ', - 'ϕ' => 'Φ', - 'ϖ' => 'Π', - 'ϗ' => 'Ϗ', - 'ϙ' => 'Ϙ', - 'ϛ' => 'Ϛ', - 'ϝ' => 'Ϝ', - 'ϟ' => 'Ϟ', - 'ϡ' => 'Ϡ', - 'ϣ' => 'Ϣ', - 'ϥ' => 'Ϥ', - 'ϧ' => 'Ϧ', - 'ϩ' => 'Ϩ', - 'ϫ' => 'Ϫ', - 'ϭ' => 'Ϭ', - 'ϯ' => 'Ϯ', - 'ϰ' => 'Κ', - 'ϱ' => 'Ρ', - 'ϲ' => 'Ϲ', - 'ϳ' => 'Ϳ', - 'ϵ' => 'Ε', - 'ϸ' => 'Ϸ', - 'ϻ' => 'Ϻ', - 'а' => 'А', - 'б' => 'Б', - 'в' => 'В', - 'г' => 'Г', - 'д' => 'Д', - 'е' => 'Е', - 'ж' => 'Ж', - 'з' => 'З', - 'и' => 'И', - 'й' => 'Й', - 'к' => 'К', - 'л' => 'Л', - 'м' => 'М', - 'н' => 'Н', - 'о' => 'О', - 'п' => 'П', - 'р' => 'Р', - 'с' => 'С', - 'т' => 'Т', - 'у' => 'У', - 'ф' => 'Ф', - 'х' => 'Х', - 'ц' => 'Ц', - 'ч' => 'Ч', - 'ш' => 'Ш', - 'щ' => 'Щ', - 'ъ' => 'Ъ', - 'ы' => 'Ы', - 'ь' => 'Ь', - 'э' => 'Э', - 'ю' => 'Ю', - 'я' => 'Я', - 'ѐ' => 'Ѐ', - 'ё' => 'Ё', - 'ђ' => 'Ђ', - 'ѓ' => 'Ѓ', - 'є' => 'Є', - 'ѕ' => 'Ѕ', - 'і' => 'І', - 'ї' => 'Ї', - 'ј' => 'Ј', - 'љ' => 'Љ', - 'њ' => 'Њ', - 'ћ' => 'Ћ', - 'ќ' => 'Ќ', - 'ѝ' => 'Ѝ', - 'ў' => 'Ў', - 'џ' => 'Џ', - 'ѡ' => 'Ѡ', - 'ѣ' => 'Ѣ', - 'ѥ' => 'Ѥ', - 'ѧ' => 'Ѧ', - 'ѩ' => 'Ѩ', - 'ѫ' => 'Ѫ', - 'ѭ' => 'Ѭ', - 'ѯ' => 'Ѯ', - 'ѱ' => 'Ѱ', - 'ѳ' => 'Ѳ', - 'ѵ' => 'Ѵ', - 'ѷ' => 'Ѷ', - 'ѹ' => 'Ѹ', - 'ѻ' => 'Ѻ', - 'ѽ' => 'Ѽ', - 'ѿ' => 'Ѿ', - 'ҁ' => 'Ҁ', - 'ҋ' => 'Ҋ', - 'ҍ' => 'Ҍ', - 'ҏ' => 'Ҏ', - 'ґ' => 'Ґ', - 'ғ' => 'Ғ', - 'ҕ' => 'Ҕ', - 'җ' => 'Җ', - 'ҙ' => 'Ҙ', - 'қ' => 'Қ', - 'ҝ' => 'Ҝ', - 'ҟ' => 'Ҟ', - 'ҡ' => 'Ҡ', - 'ң' => 'Ң', - 'ҥ' => 'Ҥ', - 'ҧ' => 'Ҧ', - 'ҩ' => 'Ҩ', - 'ҫ' => 'Ҫ', - 'ҭ' => 'Ҭ', - 'ү' => 'Ү', - 'ұ' => 'Ұ', - 'ҳ' => 'Ҳ', - 'ҵ' => 'Ҵ', - 'ҷ' => 'Ҷ', - 'ҹ' => 'Ҹ', - 'һ' => 'Һ', - 'ҽ' => 'Ҽ', - 'ҿ' => 'Ҿ', - 'ӂ' => 'Ӂ', - 'ӄ' => 'Ӄ', - 'ӆ' => 'Ӆ', - 'ӈ' => 'Ӈ', - 'ӊ' => 'Ӊ', - 'ӌ' => 'Ӌ', - 'ӎ' => 'Ӎ', - 'ӏ' => 'Ӏ', - 'ӑ' => 'Ӑ', - 'ӓ' => 'Ӓ', - 'ӕ' => 'Ӕ', - 'ӗ' => 'Ӗ', - 'ә' => 'Ә', - 'ӛ' => 'Ӛ', - 'ӝ' => 'Ӝ', - 'ӟ' => 'Ӟ', - 'ӡ' => 'Ӡ', - 'ӣ' => 'Ӣ', - 'ӥ' => 'Ӥ', - 'ӧ' => 'Ӧ', - 'ө' => 'Ө', - 'ӫ' => 'Ӫ', - 'ӭ' => 'Ӭ', - 'ӯ' => 'Ӯ', - 'ӱ' => 'Ӱ', - 'ӳ' => 'Ӳ', - 'ӵ' => 'Ӵ', - 'ӷ' => 'Ӷ', - 'ӹ' => 'Ӹ', - 'ӻ' => 'Ӻ', - 'ӽ' => 'Ӽ', - 'ӿ' => 'Ӿ', - 'ԁ' => 'Ԁ', - 'ԃ' => 'Ԃ', - 'ԅ' => 'Ԅ', - 'ԇ' => 'Ԇ', - 'ԉ' => 'Ԉ', - 'ԋ' => 'Ԋ', - 'ԍ' => 'Ԍ', - 'ԏ' => 'Ԏ', - 'ԑ' => 'Ԑ', - 'ԓ' => 'Ԓ', - 'ԕ' => 'Ԕ', - 'ԗ' => 'Ԗ', - 'ԙ' => 'Ԙ', - 'ԛ' => 'Ԛ', - 'ԝ' => 'Ԝ', - 'ԟ' => 'Ԟ', - 'ԡ' => 'Ԡ', - 'ԣ' => 'Ԣ', - 'ԥ' => 'Ԥ', - 'ԧ' => 'Ԧ', - 'ԩ' => 'Ԩ', - 'ԫ' => 'Ԫ', - 'ԭ' => 'Ԭ', - 'ԯ' => 'Ԯ', - 'ա' => 'Ա', - 'բ' => 'Բ', - 'գ' => 'Գ', - 'դ' => 'Դ', - 'ե' => 'Ե', - 'զ' => 'Զ', - 'է' => 'Է', - 'ը' => 'Ը', - 'թ' => 'Թ', - 'ժ' => 'Ժ', - 'ի' => 'Ի', - 'լ' => 'Լ', - 'խ' => 'Խ', - 'ծ' => 'Ծ', - 'կ' => 'Կ', - 'հ' => 'Հ', - 'ձ' => 'Ձ', - 'ղ' => 'Ղ', - 'ճ' => 'Ճ', - 'մ' => 'Մ', - 'յ' => 'Յ', - 'ն' => 'Ն', - 'շ' => 'Շ', - 'ո' => 'Ո', - 'չ' => 'Չ', - 'պ' => 'Պ', - 'ջ' => 'Ջ', - 'ռ' => 'Ռ', - 'ս' => 'Ս', - 'վ' => 'Վ', - 'տ' => 'Տ', - 'ր' => 'Ր', - 'ց' => 'Ց', - 'ւ' => 'Ւ', - 'փ' => 'Փ', - 'ք' => 'Ք', - 'օ' => 'Օ', - 'ֆ' => 'Ֆ', - 'ა' => 'Ა', - 'ბ' => 'Ბ', - 'გ' => 'Გ', - 'დ' => 'Დ', - 'ე' => 'Ე', - 'ვ' => 'Ვ', - 'ზ' => 'Ზ', - 'თ' => 'Თ', - 'ი' => 'Ი', - 'კ' => 'Კ', - 'ლ' => 'Ლ', - 'მ' => 'Მ', - 'ნ' => 'Ნ', - 'ო' => 'Ო', - 'პ' => 'Პ', - 'ჟ' => 'Ჟ', - 'რ' => 'Რ', - 'ს' => 'Ს', - 'ტ' => 'Ტ', - 'უ' => 'Უ', - 'ფ' => 'Ფ', - 'ქ' => 'Ქ', - 'ღ' => 'Ღ', - 'ყ' => 'Ყ', - 'შ' => 'Შ', - 'ჩ' => 'Ჩ', - 'ც' => 'Ც', - 'ძ' => 'Ძ', - 'წ' => 'Წ', - 'ჭ' => 'Ჭ', - 'ხ' => 'Ხ', - 'ჯ' => 'Ჯ', - 'ჰ' => 'Ჰ', - 'ჱ' => 'Ჱ', - 'ჲ' => 'Ჲ', - 'ჳ' => 'Ჳ', - 'ჴ' => 'Ჴ', - 'ჵ' => 'Ჵ', - 'ჶ' => 'Ჶ', - 'ჷ' => 'Ჷ', - 'ჸ' => 'Ჸ', - 'ჹ' => 'Ჹ', - 'ჺ' => 'Ჺ', - 'ჽ' => 'Ჽ', - 'ჾ' => 'Ჾ', - 'ჿ' => 'Ჿ', - 'ᏸ' => 'Ᏸ', - 'ᏹ' => 'Ᏹ', - 'ᏺ' => 'Ᏺ', - 'ᏻ' => 'Ᏻ', - 'ᏼ' => 'Ᏼ', - 'ᏽ' => 'Ᏽ', - 'ᲀ' => 'В', - 'ᲁ' => 'Д', - 'ᲂ' => 'О', - 'ᲃ' => 'С', - 'ᲄ' => 'Т', - 'ᲅ' => 'Т', - 'ᲆ' => 'Ъ', - 'ᲇ' => 'Ѣ', - 'ᲈ' => 'Ꙋ', - 'ᵹ' => 'Ᵹ', - 'ᵽ' => 'Ᵽ', - 'ᶎ' => 'Ᶎ', - 'ḁ' => 'Ḁ', - 'ḃ' => 'Ḃ', - 'ḅ' => 'Ḅ', - 'ḇ' => 'Ḇ', - 'ḉ' => 'Ḉ', - 'ḋ' => 'Ḋ', - 'ḍ' => 'Ḍ', - 'ḏ' => 'Ḏ', - 'ḑ' => 'Ḑ', - 'ḓ' => 'Ḓ', - 'ḕ' => 'Ḕ', - 'ḗ' => 'Ḗ', - 'ḙ' => 'Ḙ', - 'ḛ' => 'Ḛ', - 'ḝ' => 'Ḝ', - 'ḟ' => 'Ḟ', - 'ḡ' => 'Ḡ', - 'ḣ' => 'Ḣ', - 'ḥ' => 'Ḥ', - 'ḧ' => 'Ḧ', - 'ḩ' => 'Ḩ', - 'ḫ' => 'Ḫ', - 'ḭ' => 'Ḭ', - 'ḯ' => 'Ḯ', - 'ḱ' => 'Ḱ', - 'ḳ' => 'Ḳ', - 'ḵ' => 'Ḵ', - 'ḷ' => 'Ḷ', - 'ḹ' => 'Ḹ', - 'ḻ' => 'Ḻ', - 'ḽ' => 'Ḽ', - 'ḿ' => 'Ḿ', - 'ṁ' => 'Ṁ', - 'ṃ' => 'Ṃ', - 'ṅ' => 'Ṅ', - 'ṇ' => 'Ṇ', - 'ṉ' => 'Ṉ', - 'ṋ' => 'Ṋ', - 'ṍ' => 'Ṍ', - 'ṏ' => 'Ṏ', - 'ṑ' => 'Ṑ', - 'ṓ' => 'Ṓ', - 'ṕ' => 'Ṕ', - 'ṗ' => 'Ṗ', - 'ṙ' => 'Ṙ', - 'ṛ' => 'Ṛ', - 'ṝ' => 'Ṝ', - 'ṟ' => 'Ṟ', - 'ṡ' => 'Ṡ', - 'ṣ' => 'Ṣ', - 'ṥ' => 'Ṥ', - 'ṧ' => 'Ṧ', - 'ṩ' => 'Ṩ', - 'ṫ' => 'Ṫ', - 'ṭ' => 'Ṭ', - 'ṯ' => 'Ṯ', - 'ṱ' => 'Ṱ', - 'ṳ' => 'Ṳ', - 'ṵ' => 'Ṵ', - 'ṷ' => 'Ṷ', - 'ṹ' => 'Ṹ', - 'ṻ' => 'Ṻ', - 'ṽ' => 'Ṽ', - 'ṿ' => 'Ṿ', - 'ẁ' => 'Ẁ', - 'ẃ' => 'Ẃ', - 'ẅ' => 'Ẅ', - 'ẇ' => 'Ẇ', - 'ẉ' => 'Ẉ', - 'ẋ' => 'Ẋ', - 'ẍ' => 'Ẍ', - 'ẏ' => 'Ẏ', - 'ẑ' => 'Ẑ', - 'ẓ' => 'Ẓ', - 'ẕ' => 'Ẕ', - 'ẛ' => 'Ṡ', - 'ạ' => 'Ạ', - 'ả' => 'Ả', - 'ấ' => 'Ấ', - 'ầ' => 'Ầ', - 'ẩ' => 'Ẩ', - 'ẫ' => 'Ẫ', - 'ậ' => 'Ậ', - 'ắ' => 'Ắ', - 'ằ' => 'Ằ', - 'ẳ' => 'Ẳ', - 'ẵ' => 'Ẵ', - 'ặ' => 'Ặ', - 'ẹ' => 'Ẹ', - 'ẻ' => 'Ẻ', - 'ẽ' => 'Ẽ', - 'ế' => 'Ế', - 'ề' => 'Ề', - 'ể' => 'Ể', - 'ễ' => 'Ễ', - 'ệ' => 'Ệ', - 'ỉ' => 'Ỉ', - 'ị' => 'Ị', - 'ọ' => 'Ọ', - 'ỏ' => 'Ỏ', - 'ố' => 'Ố', - 'ồ' => 'Ồ', - 'ổ' => 'Ổ', - 'ỗ' => 'Ỗ', - 'ộ' => 'Ộ', - 'ớ' => 'Ớ', - 'ờ' => 'Ờ', - 'ở' => 'Ở', - 'ỡ' => 'Ỡ', - 'ợ' => 'Ợ', - 'ụ' => 'Ụ', - 'ủ' => 'Ủ', - 'ứ' => 'Ứ', - 'ừ' => 'Ừ', - 'ử' => 'Ử', - 'ữ' => 'Ữ', - 'ự' => 'Ự', - 'ỳ' => 'Ỳ', - 'ỵ' => 'Ỵ', - 'ỷ' => 'Ỷ', - 'ỹ' => 'Ỹ', - 'ỻ' => 'Ỻ', - 'ỽ' => 'Ỽ', - 'ỿ' => 'Ỿ', - 'ἀ' => 'Ἀ', - 'ἁ' => 'Ἁ', - 'ἂ' => 'Ἂ', - 'ἃ' => 'Ἃ', - 'ἄ' => 'Ἄ', - 'ἅ' => 'Ἅ', - 'ἆ' => 'Ἆ', - 'ἇ' => 'Ἇ', - 'ἐ' => 'Ἐ', - 'ἑ' => 'Ἑ', - 'ἒ' => 'Ἒ', - 'ἓ' => 'Ἓ', - 'ἔ' => 'Ἔ', - 'ἕ' => 'Ἕ', - 'ἠ' => 'Ἠ', - 'ἡ' => 'Ἡ', - 'ἢ' => 'Ἢ', - 'ἣ' => 'Ἣ', - 'ἤ' => 'Ἤ', - 'ἥ' => 'Ἥ', - 'ἦ' => 'Ἦ', - 'ἧ' => 'Ἧ', - 'ἰ' => 'Ἰ', - 'ἱ' => 'Ἱ', - 'ἲ' => 'Ἲ', - 'ἳ' => 'Ἳ', - 'ἴ' => 'Ἴ', - 'ἵ' => 'Ἵ', - 'ἶ' => 'Ἶ', - 'ἷ' => 'Ἷ', - 'ὀ' => 'Ὀ', - 'ὁ' => 'Ὁ', - 'ὂ' => 'Ὂ', - 'ὃ' => 'Ὃ', - 'ὄ' => 'Ὄ', - 'ὅ' => 'Ὅ', - 'ὑ' => 'Ὑ', - 'ὓ' => 'Ὓ', - 'ὕ' => 'Ὕ', - 'ὗ' => 'Ὗ', - 'ὠ' => 'Ὠ', - 'ὡ' => 'Ὡ', - 'ὢ' => 'Ὢ', - 'ὣ' => 'Ὣ', - 'ὤ' => 'Ὤ', - 'ὥ' => 'Ὥ', - 'ὦ' => 'Ὦ', - 'ὧ' => 'Ὧ', - 'ὰ' => 'Ὰ', - 'ά' => 'Ά', - 'ὲ' => 'Ὲ', - 'έ' => 'Έ', - 'ὴ' => 'Ὴ', - 'ή' => 'Ή', - 'ὶ' => 'Ὶ', - 'ί' => 'Ί', - 'ὸ' => 'Ὸ', - 'ό' => 'Ό', - 'ὺ' => 'Ὺ', - 'ύ' => 'Ύ', - 'ὼ' => 'Ὼ', - 'ώ' => 'Ώ', - 'ᾀ' => 'ἈΙ', - 'ᾁ' => 'ἉΙ', - 'ᾂ' => 'ἊΙ', - 'ᾃ' => 'ἋΙ', - 'ᾄ' => 'ἌΙ', - 'ᾅ' => 'ἍΙ', - 'ᾆ' => 'ἎΙ', - 'ᾇ' => 'ἏΙ', - 'ᾐ' => 'ἨΙ', - 'ᾑ' => 'ἩΙ', - 'ᾒ' => 'ἪΙ', - 'ᾓ' => 'ἫΙ', - 'ᾔ' => 'ἬΙ', - 'ᾕ' => 'ἭΙ', - 'ᾖ' => 'ἮΙ', - 'ᾗ' => 'ἯΙ', - 'ᾠ' => 'ὨΙ', - 'ᾡ' => 'ὩΙ', - 'ᾢ' => 'ὪΙ', - 'ᾣ' => 'ὫΙ', - 'ᾤ' => 'ὬΙ', - 'ᾥ' => 'ὭΙ', - 'ᾦ' => 'ὮΙ', - 'ᾧ' => 'ὯΙ', - 'ᾰ' => 'Ᾰ', - 'ᾱ' => 'Ᾱ', - 'ᾳ' => 'ΑΙ', - 'ι' => 'Ι', - 'ῃ' => 'ΗΙ', - 'ῐ' => 'Ῐ', - 'ῑ' => 'Ῑ', - 'ῠ' => 'Ῠ', - 'ῡ' => 'Ῡ', - 'ῥ' => 'Ῥ', - 'ῳ' => 'ΩΙ', - 'ⅎ' => 'Ⅎ', - 'ⅰ' => 'Ⅰ', - 'ⅱ' => 'Ⅱ', - 'ⅲ' => 'Ⅲ', - 'ⅳ' => 'Ⅳ', - 'ⅴ' => 'Ⅴ', - 'ⅵ' => 'Ⅵ', - 'ⅶ' => 'Ⅶ', - 'ⅷ' => 'Ⅷ', - 'ⅸ' => 'Ⅸ', - 'ⅹ' => 'Ⅹ', - 'ⅺ' => 'Ⅺ', - 'ⅻ' => 'Ⅻ', - 'ⅼ' => 'Ⅼ', - 'ⅽ' => 'Ⅽ', - 'ⅾ' => 'Ⅾ', - 'ⅿ' => 'Ⅿ', - 'ↄ' => 'Ↄ', - 'ⓐ' => 'Ⓐ', - 'ⓑ' => 'Ⓑ', - 'ⓒ' => 'Ⓒ', - 'ⓓ' => 'Ⓓ', - 'ⓔ' => 'Ⓔ', - 'ⓕ' => 'Ⓕ', - 'ⓖ' => 'Ⓖ', - 'ⓗ' => 'Ⓗ', - 'ⓘ' => 'Ⓘ', - 'ⓙ' => 'Ⓙ', - 'ⓚ' => 'Ⓚ', - 'ⓛ' => 'Ⓛ', - 'ⓜ' => 'Ⓜ', - 'ⓝ' => 'Ⓝ', - 'ⓞ' => 'Ⓞ', - 'ⓟ' => 'Ⓟ', - 'ⓠ' => 'Ⓠ', - 'ⓡ' => 'Ⓡ', - 'ⓢ' => 'Ⓢ', - 'ⓣ' => 'Ⓣ', - 'ⓤ' => 'Ⓤ', - 'ⓥ' => 'Ⓥ', - 'ⓦ' => 'Ⓦ', - 'ⓧ' => 'Ⓧ', - 'ⓨ' => 'Ⓨ', - 'ⓩ' => 'Ⓩ', - 'ⰰ' => 'Ⰰ', - 'ⰱ' => 'Ⰱ', - 'ⰲ' => 'Ⰲ', - 'ⰳ' => 'Ⰳ', - 'ⰴ' => 'Ⰴ', - 'ⰵ' => 'Ⰵ', - 'ⰶ' => 'Ⰶ', - 'ⰷ' => 'Ⰷ', - 'ⰸ' => 'Ⰸ', - 'ⰹ' => 'Ⰹ', - 'ⰺ' => 'Ⰺ', - 'ⰻ' => 'Ⰻ', - 'ⰼ' => 'Ⰼ', - 'ⰽ' => 'Ⰽ', - 'ⰾ' => 'Ⰾ', - 'ⰿ' => 'Ⰿ', - 'ⱀ' => 'Ⱀ', - 'ⱁ' => 'Ⱁ', - 'ⱂ' => 'Ⱂ', - 'ⱃ' => 'Ⱃ', - 'ⱄ' => 'Ⱄ', - 'ⱅ' => 'Ⱅ', - 'ⱆ' => 'Ⱆ', - 'ⱇ' => 'Ⱇ', - 'ⱈ' => 'Ⱈ', - 'ⱉ' => 'Ⱉ', - 'ⱊ' => 'Ⱊ', - 'ⱋ' => 'Ⱋ', - 'ⱌ' => 'Ⱌ', - 'ⱍ' => 'Ⱍ', - 'ⱎ' => 'Ⱎ', - 'ⱏ' => 'Ⱏ', - 'ⱐ' => 'Ⱐ', - 'ⱑ' => 'Ⱑ', - 'ⱒ' => 'Ⱒ', - 'ⱓ' => 'Ⱓ', - 'ⱔ' => 'Ⱔ', - 'ⱕ' => 'Ⱕ', - 'ⱖ' => 'Ⱖ', - 'ⱗ' => 'Ⱗ', - 'ⱘ' => 'Ⱘ', - 'ⱙ' => 'Ⱙ', - 'ⱚ' => 'Ⱚ', - 'ⱛ' => 'Ⱛ', - 'ⱜ' => 'Ⱜ', - 'ⱝ' => 'Ⱝ', - 'ⱞ' => 'Ⱞ', - 'ⱡ' => 'Ⱡ', - 'ⱥ' => 'Ⱥ', - 'ⱦ' => 'Ⱦ', - 'ⱨ' => 'Ⱨ', - 'ⱪ' => 'Ⱪ', - 'ⱬ' => 'Ⱬ', - 'ⱳ' => 'Ⱳ', - 'ⱶ' => 'Ⱶ', - 'ⲁ' => 'Ⲁ', - 'ⲃ' => 'Ⲃ', - 'ⲅ' => 'Ⲅ', - 'ⲇ' => 'Ⲇ', - 'ⲉ' => 'Ⲉ', - 'ⲋ' => 'Ⲋ', - 'ⲍ' => 'Ⲍ', - 'ⲏ' => 'Ⲏ', - 'ⲑ' => 'Ⲑ', - 'ⲓ' => 'Ⲓ', - 'ⲕ' => 'Ⲕ', - 'ⲗ' => 'Ⲗ', - 'ⲙ' => 'Ⲙ', - 'ⲛ' => 'Ⲛ', - 'ⲝ' => 'Ⲝ', - 'ⲟ' => 'Ⲟ', - 'ⲡ' => 'Ⲡ', - 'ⲣ' => 'Ⲣ', - 'ⲥ' => 'Ⲥ', - 'ⲧ' => 'Ⲧ', - 'ⲩ' => 'Ⲩ', - 'ⲫ' => 'Ⲫ', - 'ⲭ' => 'Ⲭ', - 'ⲯ' => 'Ⲯ', - 'ⲱ' => 'Ⲱ', - 'ⲳ' => 'Ⲳ', - 'ⲵ' => 'Ⲵ', - 'ⲷ' => 'Ⲷ', - 'ⲹ' => 'Ⲹ', - 'ⲻ' => 'Ⲻ', - 'ⲽ' => 'Ⲽ', - 'ⲿ' => 'Ⲿ', - 'ⳁ' => 'Ⳁ', - 'ⳃ' => 'Ⳃ', - 'ⳅ' => 'Ⳅ', - 'ⳇ' => 'Ⳇ', - 'ⳉ' => 'Ⳉ', - 'ⳋ' => 'Ⳋ', - 'ⳍ' => 'Ⳍ', - 'ⳏ' => 'Ⳏ', - 'ⳑ' => 'Ⳑ', - 'ⳓ' => 'Ⳓ', - 'ⳕ' => 'Ⳕ', - 'ⳗ' => 'Ⳗ', - 'ⳙ' => 'Ⳙ', - 'ⳛ' => 'Ⳛ', - 'ⳝ' => 'Ⳝ', - 'ⳟ' => 'Ⳟ', - 'ⳡ' => 'Ⳡ', - 'ⳣ' => 'Ⳣ', - 'ⳬ' => 'Ⳬ', - 'ⳮ' => 'Ⳮ', - 'ⳳ' => 'Ⳳ', - 'ⴀ' => 'Ⴀ', - 'ⴁ' => 'Ⴁ', - 'ⴂ' => 'Ⴂ', - 'ⴃ' => 'Ⴃ', - 'ⴄ' => 'Ⴄ', - 'ⴅ' => 'Ⴅ', - 'ⴆ' => 'Ⴆ', - 'ⴇ' => 'Ⴇ', - 'ⴈ' => 'Ⴈ', - 'ⴉ' => 'Ⴉ', - 'ⴊ' => 'Ⴊ', - 'ⴋ' => 'Ⴋ', - 'ⴌ' => 'Ⴌ', - 'ⴍ' => 'Ⴍ', - 'ⴎ' => 'Ⴎ', - 'ⴏ' => 'Ⴏ', - 'ⴐ' => 'Ⴐ', - 'ⴑ' => 'Ⴑ', - 'ⴒ' => 'Ⴒ', - 'ⴓ' => 'Ⴓ', - 'ⴔ' => 'Ⴔ', - 'ⴕ' => 'Ⴕ', - 'ⴖ' => 'Ⴖ', - 'ⴗ' => 'Ⴗ', - 'ⴘ' => 'Ⴘ', - 'ⴙ' => 'Ⴙ', - 'ⴚ' => 'Ⴚ', - 'ⴛ' => 'Ⴛ', - 'ⴜ' => 'Ⴜ', - 'ⴝ' => 'Ⴝ', - 'ⴞ' => 'Ⴞ', - 'ⴟ' => 'Ⴟ', - 'ⴠ' => 'Ⴠ', - 'ⴡ' => 'Ⴡ', - 'ⴢ' => 'Ⴢ', - 'ⴣ' => 'Ⴣ', - 'ⴤ' => 'Ⴤ', - 'ⴥ' => 'Ⴥ', - 'ⴧ' => 'Ⴧ', - 'ⴭ' => 'Ⴭ', - 'ꙁ' => 'Ꙁ', - 'ꙃ' => 'Ꙃ', - 'ꙅ' => 'Ꙅ', - 'ꙇ' => 'Ꙇ', - 'ꙉ' => 'Ꙉ', - 'ꙋ' => 'Ꙋ', - 'ꙍ' => 'Ꙍ', - 'ꙏ' => 'Ꙏ', - 'ꙑ' => 'Ꙑ', - 'ꙓ' => 'Ꙓ', - 'ꙕ' => 'Ꙕ', - 'ꙗ' => 'Ꙗ', - 'ꙙ' => 'Ꙙ', - 'ꙛ' => 'Ꙛ', - 'ꙝ' => 'Ꙝ', - 'ꙟ' => 'Ꙟ', - 'ꙡ' => 'Ꙡ', - 'ꙣ' => 'Ꙣ', - 'ꙥ' => 'Ꙥ', - 'ꙧ' => 'Ꙧ', - 'ꙩ' => 'Ꙩ', - 'ꙫ' => 'Ꙫ', - 'ꙭ' => 'Ꙭ', - 'ꚁ' => 'Ꚁ', - 'ꚃ' => 'Ꚃ', - 'ꚅ' => 'Ꚅ', - 'ꚇ' => 'Ꚇ', - 'ꚉ' => 'Ꚉ', - 'ꚋ' => 'Ꚋ', - 'ꚍ' => 'Ꚍ', - 'ꚏ' => 'Ꚏ', - 'ꚑ' => 'Ꚑ', - 'ꚓ' => 'Ꚓ', - 'ꚕ' => 'Ꚕ', - 'ꚗ' => 'Ꚗ', - 'ꚙ' => 'Ꚙ', - 'ꚛ' => 'Ꚛ', - 'ꜣ' => 'Ꜣ', - 'ꜥ' => 'Ꜥ', - 'ꜧ' => 'Ꜧ', - 'ꜩ' => 'Ꜩ', - 'ꜫ' => 'Ꜫ', - 'ꜭ' => 'Ꜭ', - 'ꜯ' => 'Ꜯ', - 'ꜳ' => 'Ꜳ', - 'ꜵ' => 'Ꜵ', - 'ꜷ' => 'Ꜷ', - 'ꜹ' => 'Ꜹ', - 'ꜻ' => 'Ꜻ', - 'ꜽ' => 'Ꜽ', - 'ꜿ' => 'Ꜿ', - 'ꝁ' => 'Ꝁ', - 'ꝃ' => 'Ꝃ', - 'ꝅ' => 'Ꝅ', - 'ꝇ' => 'Ꝇ', - 'ꝉ' => 'Ꝉ', - 'ꝋ' => 'Ꝋ', - 'ꝍ' => 'Ꝍ', - 'ꝏ' => 'Ꝏ', - 'ꝑ' => 'Ꝑ', - 'ꝓ' => 'Ꝓ', - 'ꝕ' => 'Ꝕ', - 'ꝗ' => 'Ꝗ', - 'ꝙ' => 'Ꝙ', - 'ꝛ' => 'Ꝛ', - 'ꝝ' => 'Ꝝ', - 'ꝟ' => 'Ꝟ', - 'ꝡ' => 'Ꝡ', - 'ꝣ' => 'Ꝣ', - 'ꝥ' => 'Ꝥ', - 'ꝧ' => 'Ꝧ', - 'ꝩ' => 'Ꝩ', - 'ꝫ' => 'Ꝫ', - 'ꝭ' => 'Ꝭ', - 'ꝯ' => 'Ꝯ', - 'ꝺ' => 'Ꝺ', - 'ꝼ' => 'Ꝼ', - 'ꝿ' => 'Ꝿ', - 'ꞁ' => 'Ꞁ', - 'ꞃ' => 'Ꞃ', - 'ꞅ' => 'Ꞅ', - 'ꞇ' => 'Ꞇ', - 'ꞌ' => 'Ꞌ', - 'ꞑ' => 'Ꞑ', - 'ꞓ' => 'Ꞓ', - 'ꞔ' => 'Ꞔ', - 'ꞗ' => 'Ꞗ', - 'ꞙ' => 'Ꞙ', - 'ꞛ' => 'Ꞛ', - 'ꞝ' => 'Ꞝ', - 'ꞟ' => 'Ꞟ', - 'ꞡ' => 'Ꞡ', - 'ꞣ' => 'Ꞣ', - 'ꞥ' => 'Ꞥ', - 'ꞧ' => 'Ꞧ', - 'ꞩ' => 'Ꞩ', - 'ꞵ' => 'Ꞵ', - 'ꞷ' => 'Ꞷ', - 'ꞹ' => 'Ꞹ', - 'ꞻ' => 'Ꞻ', - 'ꞽ' => 'Ꞽ', - 'ꞿ' => 'Ꞿ', - 'ꟃ' => 'Ꟃ', - 'ꟈ' => 'Ꟈ', - 'ꟊ' => 'Ꟊ', - 'ꟶ' => 'Ꟶ', - 'ꭓ' => 'Ꭓ', - 'ꭰ' => 'Ꭰ', - 'ꭱ' => 'Ꭱ', - 'ꭲ' => 'Ꭲ', - 'ꭳ' => 'Ꭳ', - 'ꭴ' => 'Ꭴ', - 'ꭵ' => 'Ꭵ', - 'ꭶ' => 'Ꭶ', - 'ꭷ' => 'Ꭷ', - 'ꭸ' => 'Ꭸ', - 'ꭹ' => 'Ꭹ', - 'ꭺ' => 'Ꭺ', - 'ꭻ' => 'Ꭻ', - 'ꭼ' => 'Ꭼ', - 'ꭽ' => 'Ꭽ', - 'ꭾ' => 'Ꭾ', - 'ꭿ' => 'Ꭿ', - 'ꮀ' => 'Ꮀ', - 'ꮁ' => 'Ꮁ', - 'ꮂ' => 'Ꮂ', - 'ꮃ' => 'Ꮃ', - 'ꮄ' => 'Ꮄ', - 'ꮅ' => 'Ꮅ', - 'ꮆ' => 'Ꮆ', - 'ꮇ' => 'Ꮇ', - 'ꮈ' => 'Ꮈ', - 'ꮉ' => 'Ꮉ', - 'ꮊ' => 'Ꮊ', - 'ꮋ' => 'Ꮋ', - 'ꮌ' => 'Ꮌ', - 'ꮍ' => 'Ꮍ', - 'ꮎ' => 'Ꮎ', - 'ꮏ' => 'Ꮏ', - 'ꮐ' => 'Ꮐ', - 'ꮑ' => 'Ꮑ', - 'ꮒ' => 'Ꮒ', - 'ꮓ' => 'Ꮓ', - 'ꮔ' => 'Ꮔ', - 'ꮕ' => 'Ꮕ', - 'ꮖ' => 'Ꮖ', - 'ꮗ' => 'Ꮗ', - 'ꮘ' => 'Ꮘ', - 'ꮙ' => 'Ꮙ', - 'ꮚ' => 'Ꮚ', - 'ꮛ' => 'Ꮛ', - 'ꮜ' => 'Ꮜ', - 'ꮝ' => 'Ꮝ', - 'ꮞ' => 'Ꮞ', - 'ꮟ' => 'Ꮟ', - 'ꮠ' => 'Ꮠ', - 'ꮡ' => 'Ꮡ', - 'ꮢ' => 'Ꮢ', - 'ꮣ' => 'Ꮣ', - 'ꮤ' => 'Ꮤ', - 'ꮥ' => 'Ꮥ', - 'ꮦ' => 'Ꮦ', - 'ꮧ' => 'Ꮧ', - 'ꮨ' => 'Ꮨ', - 'ꮩ' => 'Ꮩ', - 'ꮪ' => 'Ꮪ', - 'ꮫ' => 'Ꮫ', - 'ꮬ' => 'Ꮬ', - 'ꮭ' => 'Ꮭ', - 'ꮮ' => 'Ꮮ', - 'ꮯ' => 'Ꮯ', - 'ꮰ' => 'Ꮰ', - 'ꮱ' => 'Ꮱ', - 'ꮲ' => 'Ꮲ', - 'ꮳ' => 'Ꮳ', - 'ꮴ' => 'Ꮴ', - 'ꮵ' => 'Ꮵ', - 'ꮶ' => 'Ꮶ', - 'ꮷ' => 'Ꮷ', - 'ꮸ' => 'Ꮸ', - 'ꮹ' => 'Ꮹ', - 'ꮺ' => 'Ꮺ', - 'ꮻ' => 'Ꮻ', - 'ꮼ' => 'Ꮼ', - 'ꮽ' => 'Ꮽ', - 'ꮾ' => 'Ꮾ', - 'ꮿ' => 'Ꮿ', - 'a' => 'A', - 'b' => 'B', - 'c' => 'C', - 'd' => 'D', - 'e' => 'E', - 'f' => 'F', - 'g' => 'G', - 'h' => 'H', - 'i' => 'I', - 'j' => 'J', - 'k' => 'K', - 'l' => 'L', - 'm' => 'M', - 'n' => 'N', - 'o' => 'O', - 'p' => 'P', - 'q' => 'Q', - 'r' => 'R', - 's' => 'S', - 't' => 'T', - 'u' => 'U', - 'v' => 'V', - 'w' => 'W', - 'x' => 'X', - 'y' => 'Y', - 'z' => 'Z', - '𐐨' => '𐐀', - '𐐩' => '𐐁', - '𐐪' => '𐐂', - '𐐫' => '𐐃', - '𐐬' => '𐐄', - '𐐭' => '𐐅', - '𐐮' => '𐐆', - '𐐯' => '𐐇', - '𐐰' => '𐐈', - '𐐱' => '𐐉', - '𐐲' => '𐐊', - '𐐳' => '𐐋', - '𐐴' => '𐐌', - '𐐵' => '𐐍', - '𐐶' => '𐐎', - '𐐷' => '𐐏', - '𐐸' => '𐐐', - '𐐹' => '𐐑', - '𐐺' => '𐐒', - '𐐻' => '𐐓', - '𐐼' => '𐐔', - '𐐽' => '𐐕', - '𐐾' => '𐐖', - '𐐿' => '𐐗', - '𐑀' => '𐐘', - '𐑁' => '𐐙', - '𐑂' => '𐐚', - '𐑃' => '𐐛', - '𐑄' => '𐐜', - '𐑅' => '𐐝', - '𐑆' => '𐐞', - '𐑇' => '𐐟', - '𐑈' => '𐐠', - '𐑉' => '𐐡', - '𐑊' => '𐐢', - '𐑋' => '𐐣', - '𐑌' => '𐐤', - '𐑍' => '𐐥', - '𐑎' => '𐐦', - '𐑏' => '𐐧', - '𐓘' => '𐒰', - '𐓙' => '𐒱', - '𐓚' => '𐒲', - '𐓛' => '𐒳', - '𐓜' => '𐒴', - '𐓝' => '𐒵', - '𐓞' => '𐒶', - '𐓟' => '𐒷', - '𐓠' => '𐒸', - '𐓡' => '𐒹', - '𐓢' => '𐒺', - '𐓣' => '𐒻', - '𐓤' => '𐒼', - '𐓥' => '𐒽', - '𐓦' => '𐒾', - '𐓧' => '𐒿', - '𐓨' => '𐓀', - '𐓩' => '𐓁', - '𐓪' => '𐓂', - '𐓫' => '𐓃', - '𐓬' => '𐓄', - '𐓭' => '𐓅', - '𐓮' => '𐓆', - '𐓯' => '𐓇', - '𐓰' => '𐓈', - '𐓱' => '𐓉', - '𐓲' => '𐓊', - '𐓳' => '𐓋', - '𐓴' => '𐓌', - '𐓵' => '𐓍', - '𐓶' => '𐓎', - '𐓷' => '𐓏', - '𐓸' => '𐓐', - '𐓹' => '𐓑', - '𐓺' => '𐓒', - '𐓻' => '𐓓', - '𐳀' => '𐲀', - '𐳁' => '𐲁', - '𐳂' => '𐲂', - '𐳃' => '𐲃', - '𐳄' => '𐲄', - '𐳅' => '𐲅', - '𐳆' => '𐲆', - '𐳇' => '𐲇', - '𐳈' => '𐲈', - '𐳉' => '𐲉', - '𐳊' => '𐲊', - '𐳋' => '𐲋', - '𐳌' => '𐲌', - '𐳍' => '𐲍', - '𐳎' => '𐲎', - '𐳏' => '𐲏', - '𐳐' => '𐲐', - '𐳑' => '𐲑', - '𐳒' => '𐲒', - '𐳓' => '𐲓', - '𐳔' => '𐲔', - '𐳕' => '𐲕', - '𐳖' => '𐲖', - '𐳗' => '𐲗', - '𐳘' => '𐲘', - '𐳙' => '𐲙', - '𐳚' => '𐲚', - '𐳛' => '𐲛', - '𐳜' => '𐲜', - '𐳝' => '𐲝', - '𐳞' => '𐲞', - '𐳟' => '𐲟', - '𐳠' => '𐲠', - '𐳡' => '𐲡', - '𐳢' => '𐲢', - '𐳣' => '𐲣', - '𐳤' => '𐲤', - '𐳥' => '𐲥', - '𐳦' => '𐲦', - '𐳧' => '𐲧', - '𐳨' => '𐲨', - '𐳩' => '𐲩', - '𐳪' => '𐲪', - '𐳫' => '𐲫', - '𐳬' => '𐲬', - '𐳭' => '𐲭', - '𐳮' => '𐲮', - '𐳯' => '𐲯', - '𐳰' => '𐲰', - '𐳱' => '𐲱', - '𐳲' => '𐲲', - '𑣀' => '𑢠', - '𑣁' => '𑢡', - '𑣂' => '𑢢', - '𑣃' => '𑢣', - '𑣄' => '𑢤', - '𑣅' => '𑢥', - '𑣆' => '𑢦', - '𑣇' => '𑢧', - '𑣈' => '𑢨', - '𑣉' => '𑢩', - '𑣊' => '𑢪', - '𑣋' => '𑢫', - '𑣌' => '𑢬', - '𑣍' => '𑢭', - '𑣎' => '𑢮', - '𑣏' => '𑢯', - '𑣐' => '𑢰', - '𑣑' => '𑢱', - '𑣒' => '𑢲', - '𑣓' => '𑢳', - '𑣔' => '𑢴', - '𑣕' => '𑢵', - '𑣖' => '𑢶', - '𑣗' => '𑢷', - '𑣘' => '𑢸', - '𑣙' => '𑢹', - '𑣚' => '𑢺', - '𑣛' => '𑢻', - '𑣜' => '𑢼', - '𑣝' => '𑢽', - '𑣞' => '𑢾', - '𑣟' => '𑢿', - '𖹠' => '𖹀', - '𖹡' => '𖹁', - '𖹢' => '𖹂', - '𖹣' => '𖹃', - '𖹤' => '𖹄', - '𖹥' => '𖹅', - '𖹦' => '𖹆', - '𖹧' => '𖹇', - '𖹨' => '𖹈', - '𖹩' => '𖹉', - '𖹪' => '𖹊', - '𖹫' => '𖹋', - '𖹬' => '𖹌', - '𖹭' => '𖹍', - '𖹮' => '𖹎', - '𖹯' => '𖹏', - '𖹰' => '𖹐', - '𖹱' => '𖹑', - '𖹲' => '𖹒', - '𖹳' => '𖹓', - '𖹴' => '𖹔', - '𖹵' => '𖹕', - '𖹶' => '𖹖', - '𖹷' => '𖹗', - '𖹸' => '𖹘', - '𖹹' => '𖹙', - '𖹺' => '𖹚', - '𖹻' => '𖹛', - '𖹼' => '𖹜', - '𖹽' => '𖹝', - '𖹾' => '𖹞', - '𖹿' => '𖹟', - '𞤢' => '𞤀', - '𞤣' => '𞤁', - '𞤤' => '𞤂', - '𞤥' => '𞤃', - '𞤦' => '𞤄', - '𞤧' => '𞤅', - '𞤨' => '𞤆', - '𞤩' => '𞤇', - '𞤪' => '𞤈', - '𞤫' => '𞤉', - '𞤬' => '𞤊', - '𞤭' => '𞤋', - '𞤮' => '𞤌', - '𞤯' => '𞤍', - '𞤰' => '𞤎', - '𞤱' => '𞤏', - '𞤲' => '𞤐', - '𞤳' => '𞤑', - '𞤴' => '𞤒', - '𞤵' => '𞤓', - '𞤶' => '𞤔', - '𞤷' => '𞤕', - '𞤸' => '𞤖', - '𞤹' => '𞤗', - '𞤺' => '𞤘', - '𞤻' => '𞤙', - '𞤼' => '𞤚', - '𞤽' => '𞤛', - '𞤾' => '𞤜', - '𞤿' => '𞤝', - '𞥀' => '𞤞', - '𞥁' => '𞤟', - '𞥂' => '𞤠', - '𞥃' => '𞤡', - 'ß' => 'SS', - 'ff' => 'FF', - 'fi' => 'FI', - 'fl' => 'FL', - 'ffi' => 'FFI', - 'ffl' => 'FFL', - 'ſt' => 'ST', - 'st' => 'ST', - 'և' => 'ԵՒ', - 'ﬓ' => 'ՄՆ', - 'ﬔ' => 'ՄԵ', - 'ﬕ' => 'ՄԻ', - 'ﬖ' => 'ՎՆ', - 'ﬗ' => 'ՄԽ', - 'ʼn' => 'ʼN', - 'ΐ' => 'Ϊ́', - 'ΰ' => 'Ϋ́', - 'ǰ' => 'J̌', - 'ẖ' => 'H̱', - 'ẗ' => 'T̈', - 'ẘ' => 'W̊', - 'ẙ' => 'Y̊', - 'ẚ' => 'Aʾ', - 'ὐ' => 'Υ̓', - 'ὒ' => 'Υ̓̀', - 'ὔ' => 'Υ̓́', - 'ὖ' => 'Υ̓͂', - 'ᾶ' => 'Α͂', - 'ῆ' => 'Η͂', - 'ῒ' => 'Ϊ̀', - 'ΐ' => 'Ϊ́', - 'ῖ' => 'Ι͂', - 'ῗ' => 'Ϊ͂', - 'ῢ' => 'Ϋ̀', - 'ΰ' => 'Ϋ́', - 'ῤ' => 'Ρ̓', - 'ῦ' => 'Υ͂', - 'ῧ' => 'Ϋ͂', - 'ῶ' => 'Ω͂', - 'ᾈ' => 'ἈΙ', - 'ᾉ' => 'ἉΙ', - 'ᾊ' => 'ἊΙ', - 'ᾋ' => 'ἋΙ', - 'ᾌ' => 'ἌΙ', - 'ᾍ' => 'ἍΙ', - 'ᾎ' => 'ἎΙ', - 'ᾏ' => 'ἏΙ', - 'ᾘ' => 'ἨΙ', - 'ᾙ' => 'ἩΙ', - 'ᾚ' => 'ἪΙ', - 'ᾛ' => 'ἫΙ', - 'ᾜ' => 'ἬΙ', - 'ᾝ' => 'ἭΙ', - 'ᾞ' => 'ἮΙ', - 'ᾟ' => 'ἯΙ', - 'ᾨ' => 'ὨΙ', - 'ᾩ' => 'ὩΙ', - 'ᾪ' => 'ὪΙ', - 'ᾫ' => 'ὫΙ', - 'ᾬ' => 'ὬΙ', - 'ᾭ' => 'ὭΙ', - 'ᾮ' => 'ὮΙ', - 'ᾯ' => 'ὯΙ', - 'ᾼ' => 'ΑΙ', - 'ῌ' => 'ΗΙ', - 'ῼ' => 'ΩΙ', - 'ᾲ' => 'ᾺΙ', - 'ᾴ' => 'ΆΙ', - 'ῂ' => 'ῊΙ', - 'ῄ' => 'ΉΙ', - 'ῲ' => 'ῺΙ', - 'ῴ' => 'ΏΙ', - 'ᾷ' => 'Α͂Ι', - 'ῇ' => 'Η͂Ι', - 'ῷ' => 'Ω͂Ι', -); diff --git a/system/vendor/symfony/polyfill-mbstring/bootstrap.php b/system/vendor/symfony/polyfill-mbstring/bootstrap.php deleted file mode 100644 index ecf1a03..0000000 --- a/system/vendor/symfony/polyfill-mbstring/bootstrap.php +++ /dev/null @@ -1,151 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Mbstring as p; - -if (\PHP_VERSION_ID >= 80000) { - return require __DIR__.'/bootstrap80.php'; -} - -if (!function_exists('mb_convert_encoding')) { - function mb_convert_encoding($string, $to_encoding, $from_encoding = null) { return p\Mbstring::mb_convert_encoding($string, $to_encoding, $from_encoding); } -} -if (!function_exists('mb_decode_mimeheader')) { - function mb_decode_mimeheader($string) { return p\Mbstring::mb_decode_mimeheader($string); } -} -if (!function_exists('mb_encode_mimeheader')) { - function mb_encode_mimeheader($string, $charset = null, $transfer_encoding = null, $newline = "\r\n", $indent = 0) { return p\Mbstring::mb_encode_mimeheader($string, $charset, $transfer_encoding, $newline, $indent); } -} -if (!function_exists('mb_decode_numericentity')) { - function mb_decode_numericentity($string, $map, $encoding = null) { return p\Mbstring::mb_decode_numericentity($string, $map, $encoding); } -} -if (!function_exists('mb_encode_numericentity')) { - function mb_encode_numericentity($string, $map, $encoding = null, $hex = false) { return p\Mbstring::mb_encode_numericentity($string, $map, $encoding, $hex); } -} -if (!function_exists('mb_convert_case')) { - function mb_convert_case($string, $mode, $encoding = null) { return p\Mbstring::mb_convert_case($string, $mode, $encoding); } -} -if (!function_exists('mb_internal_encoding')) { - function mb_internal_encoding($encoding = null) { return p\Mbstring::mb_internal_encoding($encoding); } -} -if (!function_exists('mb_language')) { - function mb_language($language = null) { return p\Mbstring::mb_language($language); } -} -if (!function_exists('mb_list_encodings')) { - function mb_list_encodings() { return p\Mbstring::mb_list_encodings(); } -} -if (!function_exists('mb_encoding_aliases')) { - function mb_encoding_aliases($encoding) { return p\Mbstring::mb_encoding_aliases($encoding); } -} -if (!function_exists('mb_check_encoding')) { - function mb_check_encoding($value = null, $encoding = null) { return p\Mbstring::mb_check_encoding($value, $encoding); } -} -if (!function_exists('mb_detect_encoding')) { - function mb_detect_encoding($string, $encodings = null, $strict = false) { return p\Mbstring::mb_detect_encoding($string, $encodings, $strict); } -} -if (!function_exists('mb_detect_order')) { - function mb_detect_order($encoding = null) { return p\Mbstring::mb_detect_order($encoding); } -} -if (!function_exists('mb_parse_str')) { - function mb_parse_str($string, &$result = []) { parse_str($string, $result); return (bool) $result; } -} -if (!function_exists('mb_strlen')) { - function mb_strlen($string, $encoding = null) { return p\Mbstring::mb_strlen($string, $encoding); } -} -if (!function_exists('mb_strpos')) { - function mb_strpos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strpos($haystack, $needle, $offset, $encoding); } -} -if (!function_exists('mb_strtolower')) { - function mb_strtolower($string, $encoding = null) { return p\Mbstring::mb_strtolower($string, $encoding); } -} -if (!function_exists('mb_strtoupper')) { - function mb_strtoupper($string, $encoding = null) { return p\Mbstring::mb_strtoupper($string, $encoding); } -} -if (!function_exists('mb_substitute_character')) { - function mb_substitute_character($substitute_character = null) { return p\Mbstring::mb_substitute_character($substitute_character); } -} -if (!function_exists('mb_substr')) { - function mb_substr($string, $start, $length = 2147483647, $encoding = null) { return p\Mbstring::mb_substr($string, $start, $length, $encoding); } -} -if (!function_exists('mb_stripos')) { - function mb_stripos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_stripos($haystack, $needle, $offset, $encoding); } -} -if (!function_exists('mb_stristr')) { - function mb_stristr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_stristr($haystack, $needle, $before_needle, $encoding); } -} -if (!function_exists('mb_strrchr')) { - function mb_strrchr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strrchr($haystack, $needle, $before_needle, $encoding); } -} -if (!function_exists('mb_strrichr')) { - function mb_strrichr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strrichr($haystack, $needle, $before_needle, $encoding); } -} -if (!function_exists('mb_strripos')) { - function mb_strripos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strripos($haystack, $needle, $offset, $encoding); } -} -if (!function_exists('mb_strrpos')) { - function mb_strrpos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strrpos($haystack, $needle, $offset, $encoding); } -} -if (!function_exists('mb_strstr')) { - function mb_strstr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strstr($haystack, $needle, $before_needle, $encoding); } -} -if (!function_exists('mb_get_info')) { - function mb_get_info($type = 'all') { return p\Mbstring::mb_get_info($type); } -} -if (!function_exists('mb_http_output')) { - function mb_http_output($encoding = null) { return p\Mbstring::mb_http_output($encoding); } -} -if (!function_exists('mb_strwidth')) { - function mb_strwidth($string, $encoding = null) { return p\Mbstring::mb_strwidth($string, $encoding); } -} -if (!function_exists('mb_substr_count')) { - function mb_substr_count($haystack, $needle, $encoding = null) { return p\Mbstring::mb_substr_count($haystack, $needle, $encoding); } -} -if (!function_exists('mb_output_handler')) { - function mb_output_handler($string, $status) { return p\Mbstring::mb_output_handler($string, $status); } -} -if (!function_exists('mb_http_input')) { - function mb_http_input($type = null) { return p\Mbstring::mb_http_input($type); } -} - -if (!function_exists('mb_convert_variables')) { - function mb_convert_variables($to_encoding, $from_encoding, &...$vars) { return p\Mbstring::mb_convert_variables($to_encoding, $from_encoding, ...$vars); } -} - -if (!function_exists('mb_ord')) { - function mb_ord($string, $encoding = null) { return p\Mbstring::mb_ord($string, $encoding); } -} -if (!function_exists('mb_chr')) { - function mb_chr($codepoint, $encoding = null) { return p\Mbstring::mb_chr($codepoint, $encoding); } -} -if (!function_exists('mb_scrub')) { - function mb_scrub($string, $encoding = null) { $encoding = null === $encoding ? mb_internal_encoding() : $encoding; return mb_convert_encoding($string, $encoding, $encoding); } -} -if (!function_exists('mb_str_split')) { - function mb_str_split($string, $length = 1, $encoding = null) { return p\Mbstring::mb_str_split($string, $length, $encoding); } -} - -if (!function_exists('mb_str_pad')) { - function mb_str_pad(string $string, int $length, string $pad_string = ' ', int $pad_type = STR_PAD_RIGHT, ?string $encoding = null): string { return p\Mbstring::mb_str_pad($string, $length, $pad_string, $pad_type, $encoding); } -} - -if (extension_loaded('mbstring')) { - return; -} - -if (!defined('MB_CASE_UPPER')) { - define('MB_CASE_UPPER', 0); -} -if (!defined('MB_CASE_LOWER')) { - define('MB_CASE_LOWER', 1); -} -if (!defined('MB_CASE_TITLE')) { - define('MB_CASE_TITLE', 2); -} diff --git a/system/vendor/symfony/polyfill-mbstring/bootstrap80.php b/system/vendor/symfony/polyfill-mbstring/bootstrap80.php deleted file mode 100644 index 2f9fb5b..0000000 --- a/system/vendor/symfony/polyfill-mbstring/bootstrap80.php +++ /dev/null @@ -1,147 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Mbstring as p; - -if (!function_exists('mb_convert_encoding')) { - function mb_convert_encoding(array|string|null $string, ?string $to_encoding, array|string|null $from_encoding = null): array|string|false { return p\Mbstring::mb_convert_encoding($string ?? '', (string) $to_encoding, $from_encoding); } -} -if (!function_exists('mb_decode_mimeheader')) { - function mb_decode_mimeheader(?string $string): string { return p\Mbstring::mb_decode_mimeheader((string) $string); } -} -if (!function_exists('mb_encode_mimeheader')) { - function mb_encode_mimeheader(?string $string, ?string $charset = null, ?string $transfer_encoding = null, ?string $newline = "\r\n", ?int $indent = 0): string { return p\Mbstring::mb_encode_mimeheader((string) $string, $charset, $transfer_encoding, (string) $newline, (int) $indent); } -} -if (!function_exists('mb_decode_numericentity')) { - function mb_decode_numericentity(?string $string, array $map, ?string $encoding = null): string { return p\Mbstring::mb_decode_numericentity((string) $string, $map, $encoding); } -} -if (!function_exists('mb_encode_numericentity')) { - function mb_encode_numericentity(?string $string, array $map, ?string $encoding = null, ?bool $hex = false): string { return p\Mbstring::mb_encode_numericentity((string) $string, $map, $encoding, (bool) $hex); } -} -if (!function_exists('mb_convert_case')) { - function mb_convert_case(?string $string, ?int $mode, ?string $encoding = null): string { return p\Mbstring::mb_convert_case((string) $string, (int) $mode, $encoding); } -} -if (!function_exists('mb_internal_encoding')) { - function mb_internal_encoding(?string $encoding = null): string|bool { return p\Mbstring::mb_internal_encoding($encoding); } -} -if (!function_exists('mb_language')) { - function mb_language(?string $language = null): string|bool { return p\Mbstring::mb_language($language); } -} -if (!function_exists('mb_list_encodings')) { - function mb_list_encodings(): array { return p\Mbstring::mb_list_encodings(); } -} -if (!function_exists('mb_encoding_aliases')) { - function mb_encoding_aliases(?string $encoding): array { return p\Mbstring::mb_encoding_aliases((string) $encoding); } -} -if (!function_exists('mb_check_encoding')) { - function mb_check_encoding(array|string|null $value = null, ?string $encoding = null): bool { return p\Mbstring::mb_check_encoding($value, $encoding); } -} -if (!function_exists('mb_detect_encoding')) { - function mb_detect_encoding(?string $string, array|string|null $encodings = null, ?bool $strict = false): string|false { return p\Mbstring::mb_detect_encoding((string) $string, $encodings, (bool) $strict); } -} -if (!function_exists('mb_detect_order')) { - function mb_detect_order(array|string|null $encoding = null): array|bool { return p\Mbstring::mb_detect_order($encoding); } -} -if (!function_exists('mb_parse_str')) { - function mb_parse_str(?string $string, &$result = []): bool { parse_str((string) $string, $result); return (bool) $result; } -} -if (!function_exists('mb_strlen')) { - function mb_strlen(?string $string, ?string $encoding = null): int { return p\Mbstring::mb_strlen((string) $string, $encoding); } -} -if (!function_exists('mb_strpos')) { - function mb_strpos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_strpos((string) $haystack, (string) $needle, (int) $offset, $encoding); } -} -if (!function_exists('mb_strtolower')) { - function mb_strtolower(?string $string, ?string $encoding = null): string { return p\Mbstring::mb_strtolower((string) $string, $encoding); } -} -if (!function_exists('mb_strtoupper')) { - function mb_strtoupper(?string $string, ?string $encoding = null): string { return p\Mbstring::mb_strtoupper((string) $string, $encoding); } -} -if (!function_exists('mb_substitute_character')) { - function mb_substitute_character(string|int|null $substitute_character = null): string|int|bool { return p\Mbstring::mb_substitute_character($substitute_character); } -} -if (!function_exists('mb_substr')) { - function mb_substr(?string $string, ?int $start, ?int $length = null, ?string $encoding = null): string { return p\Mbstring::mb_substr((string) $string, (int) $start, $length, $encoding); } -} -if (!function_exists('mb_stripos')) { - function mb_stripos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_stripos((string) $haystack, (string) $needle, (int) $offset, $encoding); } -} -if (!function_exists('mb_stristr')) { - function mb_stristr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_stristr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); } -} -if (!function_exists('mb_strrchr')) { - function mb_strrchr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_strrchr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); } -} -if (!function_exists('mb_strrichr')) { - function mb_strrichr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_strrichr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); } -} -if (!function_exists('mb_strripos')) { - function mb_strripos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_strripos((string) $haystack, (string) $needle, (int) $offset, $encoding); } -} -if (!function_exists('mb_strrpos')) { - function mb_strrpos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_strrpos((string) $haystack, (string) $needle, (int) $offset, $encoding); } -} -if (!function_exists('mb_strstr')) { - function mb_strstr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_strstr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); } -} -if (!function_exists('mb_get_info')) { - function mb_get_info(?string $type = 'all'): array|string|int|false { return p\Mbstring::mb_get_info((string) $type); } -} -if (!function_exists('mb_http_output')) { - function mb_http_output(?string $encoding = null): string|bool { return p\Mbstring::mb_http_output($encoding); } -} -if (!function_exists('mb_strwidth')) { - function mb_strwidth(?string $string, ?string $encoding = null): int { return p\Mbstring::mb_strwidth((string) $string, $encoding); } -} -if (!function_exists('mb_substr_count')) { - function mb_substr_count(?string $haystack, ?string $needle, ?string $encoding = null): int { return p\Mbstring::mb_substr_count((string) $haystack, (string) $needle, $encoding); } -} -if (!function_exists('mb_output_handler')) { - function mb_output_handler(?string $string, ?int $status): string { return p\Mbstring::mb_output_handler((string) $string, (int) $status); } -} -if (!function_exists('mb_http_input')) { - function mb_http_input(?string $type = null): array|string|false { return p\Mbstring::mb_http_input($type); } -} - -if (!function_exists('mb_convert_variables')) { - function mb_convert_variables(?string $to_encoding, array|string|null $from_encoding, mixed &$var, mixed &...$vars): string|false { return p\Mbstring::mb_convert_variables((string) $to_encoding, $from_encoding ?? '', $var, ...$vars); } -} - -if (!function_exists('mb_ord')) { - function mb_ord(?string $string, ?string $encoding = null): int|false { return p\Mbstring::mb_ord((string) $string, $encoding); } -} -if (!function_exists('mb_chr')) { - function mb_chr(?int $codepoint, ?string $encoding = null): string|false { return p\Mbstring::mb_chr((int) $codepoint, $encoding); } -} -if (!function_exists('mb_scrub')) { - function mb_scrub(?string $string, ?string $encoding = null): string { $encoding ??= mb_internal_encoding(); return mb_convert_encoding((string) $string, $encoding, $encoding); } -} -if (!function_exists('mb_str_split')) { - function mb_str_split(?string $string, ?int $length = 1, ?string $encoding = null): array { return p\Mbstring::mb_str_split((string) $string, (int) $length, $encoding); } -} - -if (!function_exists('mb_str_pad')) { - function mb_str_pad(string $string, int $length, string $pad_string = ' ', int $pad_type = STR_PAD_RIGHT, ?string $encoding = null): string { return p\Mbstring::mb_str_pad($string, $length, $pad_string, $pad_type, $encoding); } -} - -if (extension_loaded('mbstring')) { - return; -} - -if (!defined('MB_CASE_UPPER')) { - define('MB_CASE_UPPER', 0); -} -if (!defined('MB_CASE_LOWER')) { - define('MB_CASE_LOWER', 1); -} -if (!defined('MB_CASE_TITLE')) { - define('MB_CASE_TITLE', 2); -} diff --git a/system/vendor/symfony/polyfill-mbstring/composer.json b/system/vendor/symfony/polyfill-mbstring/composer.json deleted file mode 100644 index 943e502..0000000 --- a/system/vendor/symfony/polyfill-mbstring/composer.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "symfony/polyfill-mbstring", - "type": "library", - "description": "Symfony polyfill for the Mbstring extension", - "keywords": ["polyfill", "shim", "compatibility", "portable", "mbstring"], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=7.1" - }, - "provide": { - "ext-mbstring": "*" - }, - "autoload": { - "psr-4": { "Symfony\\Polyfill\\Mbstring\\": "" }, - "files": [ "bootstrap.php" ] - }, - "suggest": { - "ext-mbstring": "For best performance" - }, - "minimum-stability": "dev", - "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - } -} diff --git a/system/vendor/symfony/polyfill-php80/LICENSE b/system/vendor/symfony/polyfill-php80/LICENSE deleted file mode 100644 index 0ed3a24..0000000 --- a/system/vendor/symfony/polyfill-php80/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2020-present Fabien Potencier - -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/system/vendor/symfony/polyfill-php80/Php80.php b/system/vendor/symfony/polyfill-php80/Php80.php deleted file mode 100644 index 362dd1a..0000000 --- a/system/vendor/symfony/polyfill-php80/Php80.php +++ /dev/null @@ -1,115 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Polyfill\Php80; - -/** - * @author Ion Bazan - * @author Nico Oelgart - * @author Nicolas Grekas - * - * @internal - */ -final class Php80 -{ - public static function fdiv(float $dividend, float $divisor): float - { - return @($dividend / $divisor); - } - - public static function get_debug_type($value): string - { - switch (true) { - case null === $value: return 'null'; - case \is_bool($value): return 'bool'; - case \is_string($value): return 'string'; - case \is_array($value): return 'array'; - case \is_int($value): return 'int'; - case \is_float($value): return 'float'; - case \is_object($value): break; - case $value instanceof \__PHP_Incomplete_Class: return '__PHP_Incomplete_Class'; - default: - if (null === $type = @get_resource_type($value)) { - return 'unknown'; - } - - if ('Unknown' === $type) { - $type = 'closed'; - } - - return "resource ($type)"; - } - - $class = \get_class($value); - - if (false === strpos($class, '@')) { - return $class; - } - - return (get_parent_class($class) ?: key(class_implements($class)) ?: 'class').'@anonymous'; - } - - public static function get_resource_id($res): int - { - if (!\is_resource($res) && null === @get_resource_type($res)) { - throw new \TypeError(sprintf('Argument 1 passed to get_resource_id() must be of the type resource, %s given', get_debug_type($res))); - } - - return (int) $res; - } - - public static function preg_last_error_msg(): string - { - switch (preg_last_error()) { - case \PREG_INTERNAL_ERROR: - return 'Internal error'; - case \PREG_BAD_UTF8_ERROR: - return 'Malformed UTF-8 characters, possibly incorrectly encoded'; - case \PREG_BAD_UTF8_OFFSET_ERROR: - return 'The offset did not correspond to the beginning of a valid UTF-8 code point'; - case \PREG_BACKTRACK_LIMIT_ERROR: - return 'Backtrack limit exhausted'; - case \PREG_RECURSION_LIMIT_ERROR: - return 'Recursion limit exhausted'; - case \PREG_JIT_STACKLIMIT_ERROR: - return 'JIT stack limit exhausted'; - case \PREG_NO_ERROR: - return 'No error'; - default: - return 'Unknown error'; - } - } - - public static function str_contains(string $haystack, string $needle): bool - { - return '' === $needle || false !== strpos($haystack, $needle); - } - - public static function str_starts_with(string $haystack, string $needle): bool - { - return 0 === strncmp($haystack, $needle, \strlen($needle)); - } - - public static function str_ends_with(string $haystack, string $needle): bool - { - if ('' === $needle || $needle === $haystack) { - return true; - } - - if ('' === $haystack) { - return false; - } - - $needleLength = \strlen($needle); - - return $needleLength <= \strlen($haystack) && 0 === substr_compare($haystack, $needle, -$needleLength); - } -} diff --git a/system/vendor/symfony/polyfill-php80/PhpToken.php b/system/vendor/symfony/polyfill-php80/PhpToken.php deleted file mode 100644 index fe6e691..0000000 --- a/system/vendor/symfony/polyfill-php80/PhpToken.php +++ /dev/null @@ -1,103 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Polyfill\Php80; - -/** - * @author Fedonyuk Anton - * - * @internal - */ -class PhpToken implements \Stringable -{ - /** - * @var int - */ - public $id; - - /** - * @var string - */ - public $text; - - /** - * @var int - */ - public $line; - - /** - * @var int - */ - public $pos; - - public function __construct(int $id, string $text, int $line = -1, int $position = -1) - { - $this->id = $id; - $this->text = $text; - $this->line = $line; - $this->pos = $position; - } - - public function getTokenName(): ?string - { - if ('UNKNOWN' === $name = token_name($this->id)) { - $name = \strlen($this->text) > 1 || \ord($this->text) < 32 ? null : $this->text; - } - - return $name; - } - - /** - * @param int|string|array $kind - */ - public function is($kind): bool - { - foreach ((array) $kind as $value) { - if (\in_array($value, [$this->id, $this->text], true)) { - return true; - } - } - - return false; - } - - public function isIgnorable(): bool - { - return \in_array($this->id, [\T_WHITESPACE, \T_COMMENT, \T_DOC_COMMENT, \T_OPEN_TAG], true); - } - - public function __toString(): string - { - return (string) $this->text; - } - - /** - * @return static[] - */ - public static function tokenize(string $code, int $flags = 0): array - { - $line = 1; - $position = 0; - $tokens = token_get_all($code, $flags); - foreach ($tokens as $index => $token) { - if (\is_string($token)) { - $id = \ord($token); - $text = $token; - } else { - [$id, $text, $line] = $token; - } - $tokens[$index] = new static($id, $text, $line, $position); - $position += \strlen($text); - } - - return $tokens; - } -} diff --git a/system/vendor/symfony/polyfill-php80/README.md b/system/vendor/symfony/polyfill-php80/README.md deleted file mode 100644 index 3816c55..0000000 --- a/system/vendor/symfony/polyfill-php80/README.md +++ /dev/null @@ -1,25 +0,0 @@ -Symfony Polyfill / Php80 -======================== - -This component provides features added to PHP 8.0 core: - -- [`Stringable`](https://php.net/stringable) interface -- [`fdiv`](https://php.net/fdiv) -- [`ValueError`](https://php.net/valueerror) class -- [`UnhandledMatchError`](https://php.net/unhandledmatcherror) class -- `FILTER_VALIDATE_BOOL` constant -- [`get_debug_type`](https://php.net/get_debug_type) -- [`PhpToken`](https://php.net/phptoken) class -- [`preg_last_error_msg`](https://php.net/preg_last_error_msg) -- [`str_contains`](https://php.net/str_contains) -- [`str_starts_with`](https://php.net/str_starts_with) -- [`str_ends_with`](https://php.net/str_ends_with) -- [`get_resource_id`](https://php.net/get_resource_id) - -More information can be found in the -[main Polyfill README](https://github.com/symfony/polyfill/blob/main/README.md). - -License -======= - -This library is released under the [MIT license](LICENSE). diff --git a/system/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php b/system/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php deleted file mode 100644 index 2b95542..0000000 --- a/system/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php +++ /dev/null @@ -1,31 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -#[Attribute(Attribute::TARGET_CLASS)] -final class Attribute -{ - public const TARGET_CLASS = 1; - public const TARGET_FUNCTION = 2; - public const TARGET_METHOD = 4; - public const TARGET_PROPERTY = 8; - public const TARGET_CLASS_CONSTANT = 16; - public const TARGET_PARAMETER = 32; - public const TARGET_ALL = 63; - public const IS_REPEATABLE = 64; - - /** @var int */ - public $flags; - - public function __construct(int $flags = self::TARGET_ALL) - { - $this->flags = $flags; - } -} diff --git a/system/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php b/system/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php deleted file mode 100644 index bd1212f..0000000 --- a/system/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php +++ /dev/null @@ -1,16 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -if (\PHP_VERSION_ID < 80000 && extension_loaded('tokenizer')) { - class PhpToken extends Symfony\Polyfill\Php80\PhpToken - { - } -} diff --git a/system/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php b/system/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php deleted file mode 100644 index 7c62d75..0000000 --- a/system/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php +++ /dev/null @@ -1,20 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -if (\PHP_VERSION_ID < 80000) { - interface Stringable - { - /** - * @return string - */ - public function __toString(); - } -} diff --git a/system/vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php b/system/vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php deleted file mode 100644 index 01c6c6c..0000000 --- a/system/vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php +++ /dev/null @@ -1,16 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -if (\PHP_VERSION_ID < 80000) { - class UnhandledMatchError extends Error - { - } -} diff --git a/system/vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php b/system/vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php deleted file mode 100644 index 783dbc2..0000000 --- a/system/vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php +++ /dev/null @@ -1,16 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -if (\PHP_VERSION_ID < 80000) { - class ValueError extends Error - { - } -} diff --git a/system/vendor/symfony/polyfill-php80/bootstrap.php b/system/vendor/symfony/polyfill-php80/bootstrap.php deleted file mode 100644 index e5f7dbc..0000000 --- a/system/vendor/symfony/polyfill-php80/bootstrap.php +++ /dev/null @@ -1,42 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Php80 as p; - -if (\PHP_VERSION_ID >= 80000) { - return; -} - -if (!defined('FILTER_VALIDATE_BOOL') && defined('FILTER_VALIDATE_BOOLEAN')) { - define('FILTER_VALIDATE_BOOL', \FILTER_VALIDATE_BOOLEAN); -} - -if (!function_exists('fdiv')) { - function fdiv(float $num1, float $num2): float { return p\Php80::fdiv($num1, $num2); } -} -if (!function_exists('preg_last_error_msg')) { - function preg_last_error_msg(): string { return p\Php80::preg_last_error_msg(); } -} -if (!function_exists('str_contains')) { - function str_contains(?string $haystack, ?string $needle): bool { return p\Php80::str_contains($haystack ?? '', $needle ?? ''); } -} -if (!function_exists('str_starts_with')) { - function str_starts_with(?string $haystack, ?string $needle): bool { return p\Php80::str_starts_with($haystack ?? '', $needle ?? ''); } -} -if (!function_exists('str_ends_with')) { - function str_ends_with(?string $haystack, ?string $needle): bool { return p\Php80::str_ends_with($haystack ?? '', $needle ?? ''); } -} -if (!function_exists('get_debug_type')) { - function get_debug_type($value): string { return p\Php80::get_debug_type($value); } -} -if (!function_exists('get_resource_id')) { - function get_resource_id($resource): int { return p\Php80::get_resource_id($resource); } -} diff --git a/system/vendor/symfony/polyfill-php80/composer.json b/system/vendor/symfony/polyfill-php80/composer.json deleted file mode 100644 index f1801f4..0000000 --- a/system/vendor/symfony/polyfill-php80/composer.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "symfony/polyfill-php80", - "type": "library", - "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", - "keywords": ["polyfill", "shim", "compatibility", "portable"], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Ion Bazan", - "email": "ion.bazan@gmail.com" - }, - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=7.1" - }, - "autoload": { - "psr-4": { "Symfony\\Polyfill\\Php80\\": "" }, - "files": [ "bootstrap.php" ], - "classmap": [ "Resources/stubs" ] - }, - "minimum-stability": "dev", - "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - } -} diff --git a/system/vendor/symfony/polyfill-php81/LICENSE b/system/vendor/symfony/polyfill-php81/LICENSE deleted file mode 100644 index 99c6bdf..0000000 --- a/system/vendor/symfony/polyfill-php81/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2021-present Fabien Potencier - -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/system/vendor/symfony/polyfill-php81/Php81.php b/system/vendor/symfony/polyfill-php81/Php81.php deleted file mode 100644 index f0507b7..0000000 --- a/system/vendor/symfony/polyfill-php81/Php81.php +++ /dev/null @@ -1,37 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Polyfill\Php81; - -/** - * @author Nicolas Grekas - * - * @internal - */ -final class Php81 -{ - public static function array_is_list(array $array): bool - { - if ([] === $array || $array === array_values($array)) { - return true; - } - - $nextKey = -1; - - foreach ($array as $k => $v) { - if ($k !== ++$nextKey) { - return false; - } - } - - return true; - } -} diff --git a/system/vendor/symfony/polyfill-php81/README.md b/system/vendor/symfony/polyfill-php81/README.md deleted file mode 100644 index c07ef78..0000000 --- a/system/vendor/symfony/polyfill-php81/README.md +++ /dev/null @@ -1,18 +0,0 @@ -Symfony Polyfill / Php81 -======================== - -This component provides features added to PHP 8.1 core: - -- [`array_is_list`](https://php.net/array_is_list) -- [`enum_exists`](https://php.net/enum-exists) -- [`MYSQLI_REFRESH_REPLICA`](https://php.net/mysqli.constants#constantmysqli-refresh-replica) constant -- [`ReturnTypeWillChange`](https://wiki.php.net/rfc/internal_method_return_types) -- [`CURLStringFile`](https://php.net/CURLStringFile) (but only if PHP >= 7.4 is used) - -More information can be found in the -[main Polyfill README](https://github.com/symfony/polyfill/blob/main/README.md). - -License -======= - -This library is released under the [MIT license](LICENSE). diff --git a/system/vendor/symfony/polyfill-php81/Resources/stubs/CURLStringFile.php b/system/vendor/symfony/polyfill-php81/Resources/stubs/CURLStringFile.php deleted file mode 100644 index eb5952e..0000000 --- a/system/vendor/symfony/polyfill-php81/Resources/stubs/CURLStringFile.php +++ /dev/null @@ -1,51 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -if (\PHP_VERSION_ID >= 70400 && extension_loaded('curl')) { - /** - * @property string $data - */ - class CURLStringFile extends CURLFile - { - private $data; - - public function __construct(string $data, string $postname, string $mime = 'application/octet-stream') - { - $this->data = $data; - parent::__construct('data://application/octet-stream;base64,'.base64_encode($data), $mime, $postname); - } - - public function __set(string $name, $value): void - { - if ('data' !== $name) { - $this->$name = $value; - - return; - } - - if (is_object($value) ? !method_exists($value, '__toString') : !is_scalar($value)) { - throw new \TypeError('Cannot assign '.gettype($value).' to property CURLStringFile::$data of type string'); - } - - $this->name = 'data://application/octet-stream;base64,'.base64_encode($value); - } - - public function __isset(string $name): bool - { - return isset($this->$name); - } - - public function &__get(string $name) - { - return $this->$name; - } - } -} diff --git a/system/vendor/symfony/polyfill-php81/Resources/stubs/ReturnTypeWillChange.php b/system/vendor/symfony/polyfill-php81/Resources/stubs/ReturnTypeWillChange.php deleted file mode 100644 index cb7720a..0000000 --- a/system/vendor/symfony/polyfill-php81/Resources/stubs/ReturnTypeWillChange.php +++ /dev/null @@ -1,20 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -if (\PHP_VERSION_ID < 80100) { - #[Attribute(Attribute::TARGET_METHOD)] - final class ReturnTypeWillChange - { - public function __construct() - { - } - } -} diff --git a/system/vendor/symfony/polyfill-php81/bootstrap.php b/system/vendor/symfony/polyfill-php81/bootstrap.php deleted file mode 100644 index 9f872e0..0000000 --- a/system/vendor/symfony/polyfill-php81/bootstrap.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Php81 as p; - -if (\PHP_VERSION_ID >= 80100) { - return; -} - -if (defined('MYSQLI_REFRESH_SLAVE') && !defined('MYSQLI_REFRESH_REPLICA')) { - define('MYSQLI_REFRESH_REPLICA', 64); -} - -if (!function_exists('array_is_list')) { - function array_is_list(array $array): bool { return p\Php81::array_is_list($array); } -} - -if (!function_exists('enum_exists')) { - function enum_exists(string $enum, bool $autoload = true): bool { return $autoload && class_exists($enum) && false; } -} diff --git a/system/vendor/symfony/polyfill-php81/composer.json b/system/vendor/symfony/polyfill-php81/composer.json deleted file mode 100644 index e02d673..0000000 --- a/system/vendor/symfony/polyfill-php81/composer.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "symfony/polyfill-php81", - "type": "library", - "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions", - "keywords": ["polyfill", "shim", "compatibility", "portable"], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=7.1" - }, - "autoload": { - "psr-4": { "Symfony\\Polyfill\\Php81\\": "" }, - "files": [ "bootstrap.php" ], - "classmap": [ "Resources/stubs" ] - }, - "minimum-stability": "dev", - "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - } -} diff --git a/system/vendor/symfony/yaml/CHANGELOG.md b/system/vendor/symfony/yaml/CHANGELOG.md deleted file mode 100644 index b9561b2..0000000 --- a/system/vendor/symfony/yaml/CHANGELOG.md +++ /dev/null @@ -1,237 +0,0 @@ -CHANGELOG -========= - -5.4 ---- - - * Add new `lint:yaml dirname --exclude=/dirname/foo.yaml --exclude=/dirname/bar.yaml` - option to exclude one or more specific files from multiple file list - * Allow negatable for the parse tags option with `--no-parse-tags` - -5.3 ---- - - * Added `github` format support & autodetection to render errors as annotations - when running the YAML linter command in a Github Action environment. - -5.1.0 ------ - - * Added support for parsing numbers prefixed with `0o` as octal numbers. - * Deprecated support for parsing numbers starting with `0` as octal numbers. They will be parsed as strings as of Symfony 6.0. Prefix numbers with `0o` - so that they are parsed as octal numbers. - - Before: - - ```yaml - Yaml::parse('072'); - ``` - - After: - - ```yaml - Yaml::parse('0o72'); - ``` - - * Added `yaml-lint` binary. - * Deprecated using the `!php/object` and `!php/const` tags without a value. - -5.0.0 ------ - - * Removed support for mappings inside multi-line strings. - * removed support for implicit STDIN usage in the `lint:yaml` command, use `lint:yaml -` (append a dash) instead to make it explicit. - -4.4.0 ------ - - * Added support for parsing the inline notation spanning multiple lines. - * Added support to dump `null` as `~` by using the `Yaml::DUMP_NULL_AS_TILDE` flag. - * deprecated accepting STDIN implicitly when using the `lint:yaml` command, use `lint:yaml -` (append a dash) instead to make it explicit. - -4.3.0 ------ - - * Using a mapping inside a multi-line string is deprecated and will throw a `ParseException` in 5.0. - -4.2.0 ------ - - * added support for multiple files or directories in `LintCommand` - -4.0.0 ------ - - * The behavior of the non-specific tag `!` is changed and now forces - non-evaluating your values. - * complex mappings will throw a `ParseException` - * support for the comma as a group separator for floats has been dropped, use - the underscore instead - * support for the `!!php/object` tag has been dropped, use the `!php/object` - tag instead - * duplicate mapping keys throw a `ParseException` - * non-string mapping keys throw a `ParseException`, use the `Yaml::PARSE_KEYS_AS_STRINGS` - flag to cast them to strings - * `%` at the beginning of an unquoted string throw a `ParseException` - * mappings with a colon (`:`) that is not followed by a whitespace throw a - `ParseException` - * the `Dumper::setIndentation()` method has been removed - * being able to pass boolean options to the `Yaml::parse()`, `Yaml::dump()`, - `Parser::parse()`, and `Dumper::dump()` methods to configure the behavior of - the parser and dumper is no longer supported, pass bitmask flags instead - * the constructor arguments of the `Parser` class have been removed - * the `Inline` class is internal and no longer part of the BC promise - * removed support for the `!str` tag, use the `!!str` tag instead - * added support for tagged scalars. - - ```yml - Yaml::parse('!foo bar', Yaml::PARSE_CUSTOM_TAGS); - // returns TaggedValue('foo', 'bar'); - ``` - -3.4.0 ------ - - * added support for parsing YAML files using the `Yaml::parseFile()` or `Parser::parseFile()` method - - * the `Dumper`, `Parser`, and `Yaml` classes are marked as final - - * Deprecated the `!php/object:` tag which will be replaced by the - `!php/object` tag (without the colon) in 4.0. - - * Deprecated the `!php/const:` tag which will be replaced by the - `!php/const` tag (without the colon) in 4.0. - - * Support for the `!str` tag is deprecated, use the `!!str` tag instead. - - * Deprecated using the non-specific tag `!` as its behavior will change in 4.0. - It will force non-evaluating your values in 4.0. Use plain integers or `!!float` instead. - -3.3.0 ------ - - * Starting an unquoted string with a question mark followed by a space is - deprecated and will throw a `ParseException` in Symfony 4.0. - - * Deprecated support for implicitly parsing non-string mapping keys as strings. - Mapping keys that are no strings will lead to a `ParseException` in Symfony - 4.0. Use quotes to opt-in for keys to be parsed as strings. - - Before: - - ```php - $yaml = << new A(), 'bar' => 1], 0, 0, Yaml::DUMP_EXCEPTION_ON_INVALID_TYPE | Yaml::DUMP_OBJECT); - ``` - -3.0.0 ------ - - * Yaml::parse() now throws an exception when a blackslash is not escaped - in double-quoted strings - -2.8.0 ------ - - * Deprecated usage of a colon in an unquoted mapping value - * Deprecated usage of @, \`, | and > at the beginning of an unquoted string - * When surrounding strings with double-quotes, you must now escape `\` characters. Not - escaping those characters (when surrounded by double-quotes) is deprecated. - - Before: - - ```yml - class: "Foo\Var" - ``` - - After: - - ```yml - class: "Foo\\Var" - ``` - -2.1.0 ------ - - * Yaml::parse() does not evaluate loaded files as PHP files by default - anymore (call Yaml::enablePhpParsing() to get back the old behavior) diff --git a/system/vendor/symfony/yaml/Command/LintCommand.php b/system/vendor/symfony/yaml/Command/LintCommand.php deleted file mode 100644 index 3ebd570..0000000 --- a/system/vendor/symfony/yaml/Command/LintCommand.php +++ /dev/null @@ -1,289 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Yaml\Command; - -use Symfony\Component\Console\CI\GithubActionReporter; -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Completion\CompletionInput; -use Symfony\Component\Console\Completion\CompletionSuggestions; -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Exception\RuntimeException; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Style\SymfonyStyle; -use Symfony\Component\Yaml\Exception\ParseException; -use Symfony\Component\Yaml\Parser; -use Symfony\Component\Yaml\Yaml; - -/** - * Validates YAML files syntax and outputs encountered errors. - * - * @author Grégoire Pineau - * @author Robin Chalas - */ -class LintCommand extends Command -{ - protected static $defaultName = 'lint:yaml'; - protected static $defaultDescription = 'Lint a YAML file and outputs encountered errors'; - - private $parser; - private $format; - private $displayCorrectFiles; - private $directoryIteratorProvider; - private $isReadableProvider; - - public function __construct(string $name = null, callable $directoryIteratorProvider = null, callable $isReadableProvider = null) - { - parent::__construct($name); - - $this->directoryIteratorProvider = $directoryIteratorProvider; - $this->isReadableProvider = $isReadableProvider; - } - - /** - * {@inheritdoc} - */ - protected function configure() - { - $this - ->setDescription(self::$defaultDescription) - ->addArgument('filename', InputArgument::IS_ARRAY, 'A file, a directory or "-" for reading from STDIN') - ->addOption('format', null, InputOption::VALUE_REQUIRED, 'The output format') - ->addOption('exclude', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'Path(s) to exclude') - ->addOption('parse-tags', null, InputOption::VALUE_NEGATABLE, 'Parse custom tags', null) - ->setHelp(<<%command.name% command lints a YAML file and outputs to STDOUT -the first encountered syntax error. - -You can validates YAML contents passed from STDIN: - - cat filename | php %command.full_name% - - -You can also validate the syntax of a file: - - php %command.full_name% filename - -Or of a whole directory: - - php %command.full_name% dirname - php %command.full_name% dirname --format=json - -You can also exclude one or more specific files: - - php %command.full_name% dirname --exclude="dirname/foo.yaml" --exclude="dirname/bar.yaml" - -EOF - ) - ; - } - - protected function execute(InputInterface $input, OutputInterface $output) - { - $io = new SymfonyStyle($input, $output); - $filenames = (array) $input->getArgument('filename'); - $excludes = $input->getOption('exclude'); - $this->format = $input->getOption('format'); - $flags = $input->getOption('parse-tags'); - - if ('github' === $this->format && !class_exists(GithubActionReporter::class)) { - throw new \InvalidArgumentException('The "github" format is only available since "symfony/console" >= 5.3.'); - } - - if (null === $this->format) { - // Autodetect format according to CI environment - $this->format = class_exists(GithubActionReporter::class) && GithubActionReporter::isGithubActionEnvironment() ? 'github' : 'txt'; - } - - $flags = $flags ? Yaml::PARSE_CUSTOM_TAGS : 0; - - $this->displayCorrectFiles = $output->isVerbose(); - - if (['-'] === $filenames) { - return $this->display($io, [$this->validate(file_get_contents('php://stdin'), $flags)]); - } - - if (!$filenames) { - throw new RuntimeException('Please provide a filename or pipe file content to STDIN.'); - } - - $filesInfo = []; - foreach ($filenames as $filename) { - if (!$this->isReadable($filename)) { - throw new RuntimeException(sprintf('File or directory "%s" is not readable.', $filename)); - } - - foreach ($this->getFiles($filename) as $file) { - if (!\in_array($file->getPathname(), $excludes, true)) { - $filesInfo[] = $this->validate(file_get_contents($file), $flags, $file); - } - } - } - - return $this->display($io, $filesInfo); - } - - private function validate(string $content, int $flags, string $file = null) - { - $prevErrorHandler = set_error_handler(function ($level, $message, $file, $line) use (&$prevErrorHandler) { - if (\E_USER_DEPRECATED === $level) { - throw new ParseException($message, $this->getParser()->getRealCurrentLineNb() + 1); - } - - return $prevErrorHandler ? $prevErrorHandler($level, $message, $file, $line) : false; - }); - - try { - $this->getParser()->parse($content, Yaml::PARSE_CONSTANT | $flags); - } catch (ParseException $e) { - return ['file' => $file, 'line' => $e->getParsedLine(), 'valid' => false, 'message' => $e->getMessage()]; - } finally { - restore_error_handler(); - } - - return ['file' => $file, 'valid' => true]; - } - - private function display(SymfonyStyle $io, array $files): int - { - switch ($this->format) { - case 'txt': - return $this->displayTxt($io, $files); - case 'json': - return $this->displayJson($io, $files); - case 'github': - return $this->displayTxt($io, $files, true); - default: - throw new InvalidArgumentException(sprintf('The format "%s" is not supported.', $this->format)); - } - } - - private function displayTxt(SymfonyStyle $io, array $filesInfo, bool $errorAsGithubAnnotations = false): int - { - $countFiles = \count($filesInfo); - $erroredFiles = 0; - $suggestTagOption = false; - - if ($errorAsGithubAnnotations) { - $githubReporter = new GithubActionReporter($io); - } - - foreach ($filesInfo as $info) { - if ($info['valid'] && $this->displayCorrectFiles) { - $io->comment('OK'.($info['file'] ? sprintf(' in %s', $info['file']) : '')); - } elseif (!$info['valid']) { - ++$erroredFiles; - $io->text(' ERROR '.($info['file'] ? sprintf(' in %s', $info['file']) : '')); - $io->text(sprintf(' >> %s', $info['message'])); - - if (false !== strpos($info['message'], 'PARSE_CUSTOM_TAGS')) { - $suggestTagOption = true; - } - - if ($errorAsGithubAnnotations) { - $githubReporter->error($info['message'], $info['file'] ?? 'php://stdin', $info['line']); - } - } - } - - if (0 === $erroredFiles) { - $io->success(sprintf('All %d YAML files contain valid syntax.', $countFiles)); - } else { - $io->warning(sprintf('%d YAML files have valid syntax and %d contain errors.%s', $countFiles - $erroredFiles, $erroredFiles, $suggestTagOption ? ' Use the --parse-tags option if you want parse custom tags.' : '')); - } - - return min($erroredFiles, 1); - } - - private function displayJson(SymfonyStyle $io, array $filesInfo): int - { - $errors = 0; - - array_walk($filesInfo, function (&$v) use (&$errors) { - $v['file'] = (string) $v['file']; - if (!$v['valid']) { - ++$errors; - } - - if (isset($v['message']) && false !== strpos($v['message'], 'PARSE_CUSTOM_TAGS')) { - $v['message'] .= ' Use the --parse-tags option if you want parse custom tags.'; - } - }); - - $io->writeln(json_encode($filesInfo, \JSON_PRETTY_PRINT | \JSON_UNESCAPED_SLASHES)); - - return min($errors, 1); - } - - private function getFiles(string $fileOrDirectory): iterable - { - if (is_file($fileOrDirectory)) { - yield new \SplFileInfo($fileOrDirectory); - - return; - } - - foreach ($this->getDirectoryIterator($fileOrDirectory) as $file) { - if (!\in_array($file->getExtension(), ['yml', 'yaml'])) { - continue; - } - - yield $file; - } - } - - private function getParser(): Parser - { - if (!$this->parser) { - $this->parser = new Parser(); - } - - return $this->parser; - } - - private function getDirectoryIterator(string $directory): iterable - { - $default = function ($directory) { - return new \RecursiveIteratorIterator( - new \RecursiveDirectoryIterator($directory, \FilesystemIterator::SKIP_DOTS | \FilesystemIterator::FOLLOW_SYMLINKS), - \RecursiveIteratorIterator::LEAVES_ONLY - ); - }; - - if (null !== $this->directoryIteratorProvider) { - return ($this->directoryIteratorProvider)($directory, $default); - } - - return $default($directory); - } - - private function isReadable(string $fileOrDirectory): bool - { - $default = function ($fileOrDirectory) { - return is_readable($fileOrDirectory); - }; - - if (null !== $this->isReadableProvider) { - return ($this->isReadableProvider)($fileOrDirectory, $default); - } - - return $default($fileOrDirectory); - } - - public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void - { - if ($input->mustSuggestOptionValuesFor('format')) { - $suggestions->suggestValues(['txt', 'json', 'github']); - } - } -} diff --git a/system/vendor/symfony/yaml/Dumper.php b/system/vendor/symfony/yaml/Dumper.php deleted file mode 100644 index 99346aa..0000000 --- a/system/vendor/symfony/yaml/Dumper.php +++ /dev/null @@ -1,176 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Yaml; - -use Symfony\Component\Yaml\Tag\TaggedValue; - -/** - * Dumper dumps PHP variables to YAML strings. - * - * @author Fabien Potencier - * - * @final - */ -class Dumper -{ - /** - * The amount of spaces to use for indentation of nested nodes. - * - * @var int - */ - protected $indentation; - - public function __construct(int $indentation = 4) - { - if ($indentation < 1) { - throw new \InvalidArgumentException('The indentation must be greater than zero.'); - } - - $this->indentation = $indentation; - } - - /** - * Dumps a PHP value to YAML. - * - * @param mixed $input The PHP value - * @param int $inline The level where you switch to inline YAML - * @param int $indent The level of indentation (used internally) - * @param int $flags A bit field of Yaml::DUMP_* constants to customize the dumped YAML string - */ - public function dump($input, int $inline = 0, int $indent = 0, int $flags = 0): string - { - $output = ''; - $prefix = $indent ? str_repeat(' ', $indent) : ''; - $dumpObjectAsInlineMap = true; - - if (Yaml::DUMP_OBJECT_AS_MAP & $flags && ($input instanceof \ArrayObject || $input instanceof \stdClass)) { - $dumpObjectAsInlineMap = empty((array) $input); - } - - if ($inline <= 0 || (!\is_array($input) && !$input instanceof TaggedValue && $dumpObjectAsInlineMap) || empty($input)) { - $output .= $prefix.Inline::dump($input, $flags); - } elseif ($input instanceof TaggedValue) { - $output .= $this->dumpTaggedValue($input, $inline, $indent, $flags, $prefix); - } else { - $dumpAsMap = Inline::isHash($input); - - foreach ($input as $key => $value) { - if ('' !== $output && "\n" !== $output[-1]) { - $output .= "\n"; - } - - if (Yaml::DUMP_MULTI_LINE_LITERAL_BLOCK & $flags && \is_string($value) && false !== strpos($value, "\n") && false === strpos($value, "\r")) { - $blockIndentationIndicator = $this->getBlockIndentationIndicator($value); - - if (isset($value[-2]) && "\n" === $value[-2] && "\n" === $value[-1]) { - $blockChompingIndicator = '+'; - } elseif ("\n" === $value[-1]) { - $blockChompingIndicator = ''; - } else { - $blockChompingIndicator = '-'; - } - - $output .= sprintf('%s%s%s |%s%s', $prefix, $dumpAsMap ? Inline::dump($key, $flags).':' : '-', '', $blockIndentationIndicator, $blockChompingIndicator); - - foreach (explode("\n", $value) as $row) { - if ('' === $row) { - $output .= "\n"; - } else { - $output .= sprintf("\n%s%s%s", $prefix, str_repeat(' ', $this->indentation), $row); - } - } - - continue; - } - - if ($value instanceof TaggedValue) { - $output .= sprintf('%s%s !%s', $prefix, $dumpAsMap ? Inline::dump($key, $flags).':' : '-', $value->getTag()); - - if (Yaml::DUMP_MULTI_LINE_LITERAL_BLOCK & $flags && \is_string($value->getValue()) && false !== strpos($value->getValue(), "\n") && false === strpos($value->getValue(), "\r\n")) { - $blockIndentationIndicator = $this->getBlockIndentationIndicator($value->getValue()); - $output .= sprintf(' |%s', $blockIndentationIndicator); - - foreach (explode("\n", $value->getValue()) as $row) { - $output .= sprintf("\n%s%s%s", $prefix, str_repeat(' ', $this->indentation), $row); - } - - continue; - } - - if ($inline - 1 <= 0 || null === $value->getValue() || \is_scalar($value->getValue())) { - $output .= ' '.$this->dump($value->getValue(), $inline - 1, 0, $flags)."\n"; - } else { - $output .= "\n"; - $output .= $this->dump($value->getValue(), $inline - 1, $dumpAsMap ? $indent + $this->indentation : $indent + 2, $flags); - } - - continue; - } - - $dumpObjectAsInlineMap = true; - - if (Yaml::DUMP_OBJECT_AS_MAP & $flags && ($value instanceof \ArrayObject || $value instanceof \stdClass)) { - $dumpObjectAsInlineMap = empty((array) $value); - } - - $willBeInlined = $inline - 1 <= 0 || !\is_array($value) && $dumpObjectAsInlineMap || empty($value); - - $output .= sprintf('%s%s%s%s', - $prefix, - $dumpAsMap ? Inline::dump($key, $flags).':' : '-', - $willBeInlined ? ' ' : "\n", - $this->dump($value, $inline - 1, $willBeInlined ? 0 : $indent + $this->indentation, $flags) - ).($willBeInlined ? "\n" : ''); - } - } - - return $output; - } - - private function dumpTaggedValue(TaggedValue $value, int $inline, int $indent, int $flags, string $prefix): string - { - $output = sprintf('%s!%s', $prefix ? $prefix.' ' : '', $value->getTag()); - - if (Yaml::DUMP_MULTI_LINE_LITERAL_BLOCK & $flags && \is_string($value->getValue()) && false !== strpos($value->getValue(), "\n") && false === strpos($value->getValue(), "\r\n")) { - $blockIndentationIndicator = $this->getBlockIndentationIndicator($value->getValue()); - $output .= sprintf(' |%s', $blockIndentationIndicator); - - foreach (explode("\n", $value->getValue()) as $row) { - $output .= sprintf("\n%s%s%s", $prefix, str_repeat(' ', $this->indentation), $row); - } - - return $output; - } - - if ($inline - 1 <= 0 || null === $value->getValue() || \is_scalar($value->getValue())) { - return $output.' '.$this->dump($value->getValue(), $inline - 1, 0, $flags)."\n"; - } - - return $output."\n".$this->dump($value->getValue(), $inline - 1, $indent, $flags); - } - - private function getBlockIndentationIndicator(string $value): string - { - $lines = explode("\n", $value); - - // If the first line (that is neither empty nor contains only spaces) - // starts with a space character, the spec requires a block indentation indicator - // http://www.yaml.org/spec/1.2/spec.html#id2793979 - foreach ($lines as $line) { - if ('' !== trim($line, ' ')) { - return (' ' === substr($line, 0, 1)) ? (string) $this->indentation : ''; - } - } - - return ''; - } -} diff --git a/system/vendor/symfony/yaml/Escaper.php b/system/vendor/symfony/yaml/Escaper.php deleted file mode 100644 index e8090d8..0000000 --- a/system/vendor/symfony/yaml/Escaper.php +++ /dev/null @@ -1,95 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Yaml; - -/** - * Escaper encapsulates escaping rules for single and double-quoted - * YAML strings. - * - * @author Matthew Lewinski - * - * @internal - */ -class Escaper -{ - // Characters that would cause a dumped string to require double quoting. - public const REGEX_CHARACTER_TO_ESCAPE = "[\\x00-\\x1f]|\x7f|\xc2\x85|\xc2\xa0|\xe2\x80\xa8|\xe2\x80\xa9"; - - // Mapping arrays for escaping a double quoted string. The backslash is - // first to ensure proper escaping because str_replace operates iteratively - // on the input arrays. This ordering of the characters avoids the use of strtr, - // which performs more slowly. - private const ESCAPEES = ['\\', '\\\\', '\\"', '"', - "\x00", "\x01", "\x02", "\x03", "\x04", "\x05", "\x06", "\x07", - "\x08", "\x09", "\x0a", "\x0b", "\x0c", "\x0d", "\x0e", "\x0f", - "\x10", "\x11", "\x12", "\x13", "\x14", "\x15", "\x16", "\x17", - "\x18", "\x19", "\x1a", "\x1b", "\x1c", "\x1d", "\x1e", "\x1f", - "\x7f", - "\xc2\x85", "\xc2\xa0", "\xe2\x80\xa8", "\xe2\x80\xa9", - ]; - private const ESCAPED = ['\\\\', '\\"', '\\\\', '\\"', - '\\0', '\\x01', '\\x02', '\\x03', '\\x04', '\\x05', '\\x06', '\\a', - '\\b', '\\t', '\\n', '\\v', '\\f', '\\r', '\\x0e', '\\x0f', - '\\x10', '\\x11', '\\x12', '\\x13', '\\x14', '\\x15', '\\x16', '\\x17', - '\\x18', '\\x19', '\\x1a', '\\e', '\\x1c', '\\x1d', '\\x1e', '\\x1f', - '\\x7f', - '\\N', '\\_', '\\L', '\\P', - ]; - - /** - * Determines if a PHP value would require double quoting in YAML. - * - * @param string $value A PHP value - */ - public static function requiresDoubleQuoting(string $value): bool - { - return 0 < preg_match('/'.self::REGEX_CHARACTER_TO_ESCAPE.'/u', $value); - } - - /** - * Escapes and surrounds a PHP value with double quotes. - * - * @param string $value A PHP value - */ - public static function escapeWithDoubleQuotes(string $value): string - { - return sprintf('"%s"', str_replace(self::ESCAPEES, self::ESCAPED, $value)); - } - - /** - * Determines if a PHP value would require single quoting in YAML. - * - * @param string $value A PHP value - */ - public static function requiresSingleQuoting(string $value): bool - { - // Determines if a PHP value is entirely composed of a value that would - // require single quoting in YAML. - if (\in_array(strtolower($value), ['null', '~', 'true', 'false', 'y', 'n', 'yes', 'no', 'on', 'off'])) { - return true; - } - - // Determines if the PHP value contains any single characters that would - // cause it to require single quoting in YAML. - return 0 < preg_match('/[ \s \' " \: \{ \} \[ \] , & \* \# \?] | \A[ \- ? | < > = ! % @ ` \p{Zs}]/xu', $value); - } - - /** - * Escapes and surrounds a PHP value with single quotes. - * - * @param string $value A PHP value - */ - public static function escapeWithSingleQuotes(string $value): string - { - return sprintf("'%s'", str_replace('\'', '\'\'', $value)); - } -} diff --git a/system/vendor/symfony/yaml/Exception/DumpException.php b/system/vendor/symfony/yaml/Exception/DumpException.php deleted file mode 100644 index cce972f..0000000 --- a/system/vendor/symfony/yaml/Exception/DumpException.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Yaml\Exception; - -/** - * Exception class thrown when an error occurs during dumping. - * - * @author Fabien Potencier - */ -class DumpException extends RuntimeException -{ -} diff --git a/system/vendor/symfony/yaml/Exception/ExceptionInterface.php b/system/vendor/symfony/yaml/Exception/ExceptionInterface.php deleted file mode 100644 index 9091316..0000000 --- a/system/vendor/symfony/yaml/Exception/ExceptionInterface.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Yaml\Exception; - -/** - * Exception interface for all exceptions thrown by the component. - * - * @author Fabien Potencier - */ -interface ExceptionInterface extends \Throwable -{ -} diff --git a/system/vendor/symfony/yaml/Exception/ParseException.php b/system/vendor/symfony/yaml/Exception/ParseException.php deleted file mode 100644 index 8748d2b..0000000 --- a/system/vendor/symfony/yaml/Exception/ParseException.php +++ /dev/null @@ -1,132 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Yaml\Exception; - -/** - * Exception class thrown when an error occurs during parsing. - * - * @author Fabien Potencier - */ -class ParseException extends RuntimeException -{ - private $parsedFile; - private $parsedLine; - private $snippet; - private $rawMessage; - - /** - * @param string $message The error message - * @param int $parsedLine The line where the error occurred - * @param string|null $snippet The snippet of code near the problem - * @param string|null $parsedFile The file name where the error occurred - */ - public function __construct(string $message, int $parsedLine = -1, string $snippet = null, string $parsedFile = null, \Throwable $previous = null) - { - $this->parsedFile = $parsedFile; - $this->parsedLine = $parsedLine; - $this->snippet = $snippet; - $this->rawMessage = $message; - - $this->updateRepr(); - - parent::__construct($this->message, 0, $previous); - } - - /** - * Gets the snippet of code near the error. - * - * @return string - */ - public function getSnippet() - { - return $this->snippet; - } - - /** - * Sets the snippet of code near the error. - */ - public function setSnippet(string $snippet) - { - $this->snippet = $snippet; - - $this->updateRepr(); - } - - /** - * Gets the filename where the error occurred. - * - * This method returns null if a string is parsed. - * - * @return string - */ - public function getParsedFile() - { - return $this->parsedFile; - } - - /** - * Sets the filename where the error occurred. - */ - public function setParsedFile(string $parsedFile) - { - $this->parsedFile = $parsedFile; - - $this->updateRepr(); - } - - /** - * Gets the line where the error occurred. - * - * @return int - */ - public function getParsedLine() - { - return $this->parsedLine; - } - - /** - * Sets the line where the error occurred. - */ - public function setParsedLine(int $parsedLine) - { - $this->parsedLine = $parsedLine; - - $this->updateRepr(); - } - - private function updateRepr() - { - $this->message = $this->rawMessage; - - $dot = false; - if ('.' === substr($this->message, -1)) { - $this->message = substr($this->message, 0, -1); - $dot = true; - } - - if (null !== $this->parsedFile) { - $this->message .= sprintf(' in %s', json_encode($this->parsedFile, \JSON_UNESCAPED_SLASHES | \JSON_UNESCAPED_UNICODE)); - } - - if ($this->parsedLine >= 0) { - $this->message .= sprintf(' at line %d', $this->parsedLine); - } - - if ($this->snippet) { - $this->message .= sprintf(' (near "%s")', $this->snippet); - } - - if ($dot) { - $this->message .= '.'; - } - } -} diff --git a/system/vendor/symfony/yaml/Exception/RuntimeException.php b/system/vendor/symfony/yaml/Exception/RuntimeException.php deleted file mode 100644 index 3f36b73..0000000 --- a/system/vendor/symfony/yaml/Exception/RuntimeException.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Yaml\Exception; - -/** - * Exception class thrown when an error occurs during parsing. - * - * @author Romain Neutron - */ -class RuntimeException extends \RuntimeException implements ExceptionInterface -{ -} diff --git a/system/vendor/symfony/yaml/Inline.php b/system/vendor/symfony/yaml/Inline.php deleted file mode 100644 index 712add9..0000000 --- a/system/vendor/symfony/yaml/Inline.php +++ /dev/null @@ -1,815 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Yaml; - -use Symfony\Component\Yaml\Exception\DumpException; -use Symfony\Component\Yaml\Exception\ParseException; -use Symfony\Component\Yaml\Tag\TaggedValue; - -/** - * Inline implements a YAML parser/dumper for the YAML inline syntax. - * - * @author Fabien Potencier - * - * @internal - */ -class Inline -{ - public const REGEX_QUOTED_STRING = '(?:"([^"\\\\]*+(?:\\\\.[^"\\\\]*+)*+)"|\'([^\']*+(?:\'\'[^\']*+)*+)\')'; - - public static $parsedLineNumber = -1; - public static $parsedFilename; - - private static $exceptionOnInvalidType = false; - private static $objectSupport = false; - private static $objectForMap = false; - private static $constantSupport = false; - - public static function initialize(int $flags, int $parsedLineNumber = null, string $parsedFilename = null) - { - self::$exceptionOnInvalidType = (bool) (Yaml::PARSE_EXCEPTION_ON_INVALID_TYPE & $flags); - self::$objectSupport = (bool) (Yaml::PARSE_OBJECT & $flags); - self::$objectForMap = (bool) (Yaml::PARSE_OBJECT_FOR_MAP & $flags); - self::$constantSupport = (bool) (Yaml::PARSE_CONSTANT & $flags); - self::$parsedFilename = $parsedFilename; - - if (null !== $parsedLineNumber) { - self::$parsedLineNumber = $parsedLineNumber; - } - } - - /** - * Converts a YAML string to a PHP value. - * - * @param string|null $value A YAML string - * @param int $flags A bit field of Yaml::PARSE_* constants to customize the YAML parser behavior - * @param array $references Mapping of variable names to values - * - * @return mixed - * - * @throws ParseException - */ - public static function parse(string $value = null, int $flags = 0, array &$references = []) - { - if (null === $value) { - return ''; - } - - self::initialize($flags); - - $value = trim($value); - - if ('' === $value) { - return ''; - } - - if (2 /* MB_OVERLOAD_STRING */ & (int) \ini_get('mbstring.func_overload')) { - $mbEncoding = mb_internal_encoding(); - mb_internal_encoding('ASCII'); - } - - try { - $i = 0; - $tag = self::parseTag($value, $i, $flags); - switch ($value[$i]) { - case '[': - $result = self::parseSequence($value, $flags, $i, $references); - ++$i; - break; - case '{': - $result = self::parseMapping($value, $flags, $i, $references); - ++$i; - break; - default: - $result = self::parseScalar($value, $flags, null, $i, true, $references); - } - - // some comments are allowed at the end - if (preg_replace('/\s*#.*$/A', '', substr($value, $i))) { - throw new ParseException(sprintf('Unexpected characters near "%s".', substr($value, $i)), self::$parsedLineNumber + 1, $value, self::$parsedFilename); - } - - if (null !== $tag && '' !== $tag) { - return new TaggedValue($tag, $result); - } - - return $result; - } finally { - if (isset($mbEncoding)) { - mb_internal_encoding($mbEncoding); - } - } - } - - /** - * Dumps a given PHP variable to a YAML string. - * - * @param mixed $value The PHP variable to convert - * @param int $flags A bit field of Yaml::DUMP_* constants to customize the dumped YAML string - * - * @throws DumpException When trying to dump PHP resource - */ - public static function dump($value, int $flags = 0): string - { - switch (true) { - case \is_resource($value): - if (Yaml::DUMP_EXCEPTION_ON_INVALID_TYPE & $flags) { - throw new DumpException(sprintf('Unable to dump PHP resources in a YAML file ("%s").', get_resource_type($value))); - } - - return self::dumpNull($flags); - case $value instanceof \DateTimeInterface: - return $value->format('c'); - case $value instanceof \UnitEnum: - return sprintf('!php/const %s::%s', \get_class($value), $value->name); - case \is_object($value): - if ($value instanceof TaggedValue) { - return '!'.$value->getTag().' '.self::dump($value->getValue(), $flags); - } - - if (Yaml::DUMP_OBJECT & $flags) { - return '!php/object '.self::dump(serialize($value)); - } - - if (Yaml::DUMP_OBJECT_AS_MAP & $flags && ($value instanceof \stdClass || $value instanceof \ArrayObject)) { - $output = []; - - foreach ($value as $key => $val) { - $output[] = sprintf('%s: %s', self::dump($key, $flags), self::dump($val, $flags)); - } - - return sprintf('{ %s }', implode(', ', $output)); - } - - if (Yaml::DUMP_EXCEPTION_ON_INVALID_TYPE & $flags) { - throw new DumpException('Object support when dumping a YAML file has been disabled.'); - } - - return self::dumpNull($flags); - case \is_array($value): - return self::dumpArray($value, $flags); - case null === $value: - return self::dumpNull($flags); - case true === $value: - return 'true'; - case false === $value: - return 'false'; - case \is_int($value): - return $value; - case is_numeric($value) && false === strpbrk($value, "\f\n\r\t\v"): - $locale = setlocale(\LC_NUMERIC, 0); - if (false !== $locale) { - setlocale(\LC_NUMERIC, 'C'); - } - if (\is_float($value)) { - $repr = (string) $value; - if (is_infinite($value)) { - $repr = str_ireplace('INF', '.Inf', $repr); - } elseif (floor($value) == $value && $repr == $value) { - // Preserve float data type since storing a whole number will result in integer value. - if (false === strpos($repr, 'E')) { - $repr = $repr.'.0'; - } - } - } else { - $repr = \is_string($value) ? "'$value'" : (string) $value; - } - if (false !== $locale) { - setlocale(\LC_NUMERIC, $locale); - } - - return $repr; - case '' == $value: - return "''"; - case self::isBinaryString($value): - return '!!binary '.base64_encode($value); - case Escaper::requiresDoubleQuoting($value): - return Escaper::escapeWithDoubleQuotes($value); - case Escaper::requiresSingleQuoting($value): - case Parser::preg_match('{^[0-9]+[_0-9]*$}', $value): - case Parser::preg_match(self::getHexRegex(), $value): - case Parser::preg_match(self::getTimestampRegex(), $value): - return Escaper::escapeWithSingleQuotes($value); - default: - return $value; - } - } - - /** - * Check if given array is hash or just normal indexed array. - * - * @param array|\ArrayObject|\stdClass $value The PHP array or array-like object to check - */ - public static function isHash($value): bool - { - if ($value instanceof \stdClass || $value instanceof \ArrayObject) { - return true; - } - - $expectedKey = 0; - - foreach ($value as $key => $val) { - if ($key !== $expectedKey++) { - return true; - } - } - - return false; - } - - /** - * Dumps a PHP array to a YAML string. - * - * @param array $value The PHP array to dump - * @param int $flags A bit field of Yaml::DUMP_* constants to customize the dumped YAML string - */ - private static function dumpArray(array $value, int $flags): string - { - // array - if (($value || Yaml::DUMP_EMPTY_ARRAY_AS_SEQUENCE & $flags) && !self::isHash($value)) { - $output = []; - foreach ($value as $val) { - $output[] = self::dump($val, $flags); - } - - return sprintf('[%s]', implode(', ', $output)); - } - - // hash - $output = []; - foreach ($value as $key => $val) { - $output[] = sprintf('%s: %s', self::dump($key, $flags), self::dump($val, $flags)); - } - - return sprintf('{ %s }', implode(', ', $output)); - } - - private static function dumpNull(int $flags): string - { - if (Yaml::DUMP_NULL_AS_TILDE & $flags) { - return '~'; - } - - return 'null'; - } - - /** - * Parses a YAML scalar. - * - * @return mixed - * - * @throws ParseException When malformed inline YAML string is parsed - */ - public static function parseScalar(string $scalar, int $flags = 0, array $delimiters = null, int &$i = 0, bool $evaluate = true, array &$references = [], bool &$isQuoted = null) - { - if (\in_array($scalar[$i], ['"', "'"], true)) { - // quoted scalar - $isQuoted = true; - $output = self::parseQuotedScalar($scalar, $i); - - if (null !== $delimiters) { - $tmp = ltrim(substr($scalar, $i), " \n"); - if ('' === $tmp) { - throw new ParseException(sprintf('Unexpected end of line, expected one of "%s".', implode('', $delimiters)), self::$parsedLineNumber + 1, $scalar, self::$parsedFilename); - } - if (!\in_array($tmp[0], $delimiters)) { - throw new ParseException(sprintf('Unexpected characters (%s).', substr($scalar, $i)), self::$parsedLineNumber + 1, $scalar, self::$parsedFilename); - } - } - } else { - // "normal" string - $isQuoted = false; - - if (!$delimiters) { - $output = substr($scalar, $i); - $i += \strlen($output); - - // remove comments - if (Parser::preg_match('/[ \t]+#/', $output, $match, \PREG_OFFSET_CAPTURE)) { - $output = substr($output, 0, $match[0][1]); - } - } elseif (Parser::preg_match('/^(.*?)('.implode('|', $delimiters).')/', substr($scalar, $i), $match)) { - $output = $match[1]; - $i += \strlen($output); - $output = trim($output); - } else { - throw new ParseException(sprintf('Malformed inline YAML string: "%s".', $scalar), self::$parsedLineNumber + 1, null, self::$parsedFilename); - } - - // a non-quoted string cannot start with @ or ` (reserved) nor with a scalar indicator (| or >) - if ($output && ('@' === $output[0] || '`' === $output[0] || '|' === $output[0] || '>' === $output[0] || '%' === $output[0])) { - throw new ParseException(sprintf('The reserved indicator "%s" cannot start a plain scalar; you need to quote the scalar.', $output[0]), self::$parsedLineNumber + 1, $output, self::$parsedFilename); - } - - if ($evaluate) { - $output = self::evaluateScalar($output, $flags, $references, $isQuoted); - } - } - - return $output; - } - - /** - * Parses a YAML quoted scalar. - * - * @throws ParseException When malformed inline YAML string is parsed - */ - private static function parseQuotedScalar(string $scalar, int &$i = 0): string - { - if (!Parser::preg_match('/'.self::REGEX_QUOTED_STRING.'/Au', substr($scalar, $i), $match)) { - throw new ParseException(sprintf('Malformed inline YAML string: "%s".', substr($scalar, $i)), self::$parsedLineNumber + 1, $scalar, self::$parsedFilename); - } - - $output = substr($match[0], 1, -1); - - $unescaper = new Unescaper(); - if ('"' == $scalar[$i]) { - $output = $unescaper->unescapeDoubleQuotedString($output); - } else { - $output = $unescaper->unescapeSingleQuotedString($output); - } - - $i += \strlen($match[0]); - - return $output; - } - - /** - * Parses a YAML sequence. - * - * @throws ParseException When malformed inline YAML string is parsed - */ - private static function parseSequence(string $sequence, int $flags, int &$i = 0, array &$references = []): array - { - $output = []; - $len = \strlen($sequence); - ++$i; - - // [foo, bar, ...] - while ($i < $len) { - if (']' === $sequence[$i]) { - return $output; - } - if (',' === $sequence[$i] || ' ' === $sequence[$i]) { - ++$i; - - continue; - } - - $tag = self::parseTag($sequence, $i, $flags); - switch ($sequence[$i]) { - case '[': - // nested sequence - $value = self::parseSequence($sequence, $flags, $i, $references); - break; - case '{': - // nested mapping - $value = self::parseMapping($sequence, $flags, $i, $references); - break; - default: - $value = self::parseScalar($sequence, $flags, [',', ']'], $i, null === $tag, $references, $isQuoted); - - // the value can be an array if a reference has been resolved to an array var - if (\is_string($value) && !$isQuoted && false !== strpos($value, ': ')) { - // embedded mapping? - try { - $pos = 0; - $value = self::parseMapping('{'.$value.'}', $flags, $pos, $references); - } catch (\InvalidArgumentException $e) { - // no, it's not - } - } - - if (!$isQuoted && \is_string($value) && '' !== $value && '&' === $value[0] && Parser::preg_match(Parser::REFERENCE_PATTERN, $value, $matches)) { - $references[$matches['ref']] = $matches['value']; - $value = $matches['value']; - } - - --$i; - } - - if (null !== $tag && '' !== $tag) { - $value = new TaggedValue($tag, $value); - } - - $output[] = $value; - - ++$i; - } - - throw new ParseException(sprintf('Malformed inline YAML string: "%s".', $sequence), self::$parsedLineNumber + 1, null, self::$parsedFilename); - } - - /** - * Parses a YAML mapping. - * - * @return array|\stdClass - * - * @throws ParseException When malformed inline YAML string is parsed - */ - private static function parseMapping(string $mapping, int $flags, int &$i = 0, array &$references = []) - { - $output = []; - $len = \strlen($mapping); - ++$i; - $allowOverwrite = false; - - // {foo: bar, bar:foo, ...} - while ($i < $len) { - switch ($mapping[$i]) { - case ' ': - case ',': - case "\n": - ++$i; - continue 2; - case '}': - if (self::$objectForMap) { - return (object) $output; - } - - return $output; - } - - // key - $offsetBeforeKeyParsing = $i; - $isKeyQuoted = \in_array($mapping[$i], ['"', "'"], true); - $key = self::parseScalar($mapping, $flags, [':', ' '], $i, false); - - if ($offsetBeforeKeyParsing === $i) { - throw new ParseException('Missing mapping key.', self::$parsedLineNumber + 1, $mapping); - } - - if ('!php/const' === $key) { - $key .= ' '.self::parseScalar($mapping, $flags, [':'], $i, false); - $key = self::evaluateScalar($key, $flags); - } - - if (false === $i = strpos($mapping, ':', $i)) { - break; - } - - if (!$isKeyQuoted) { - $evaluatedKey = self::evaluateScalar($key, $flags, $references); - - if ('' !== $key && $evaluatedKey !== $key && !\is_string($evaluatedKey) && !\is_int($evaluatedKey)) { - throw new ParseException('Implicit casting of incompatible mapping keys to strings is not supported. Quote your evaluable mapping keys instead.', self::$parsedLineNumber + 1, $mapping); - } - } - - if (!$isKeyQuoted && (!isset($mapping[$i + 1]) || !\in_array($mapping[$i + 1], [' ', ',', '[', ']', '{', '}', "\n"], true))) { - throw new ParseException('Colons must be followed by a space or an indication character (i.e. " ", ",", "[", "]", "{", "}").', self::$parsedLineNumber + 1, $mapping); - } - - if ('<<' === $key) { - $allowOverwrite = true; - } - - while ($i < $len) { - if (':' === $mapping[$i] || ' ' === $mapping[$i] || "\n" === $mapping[$i]) { - ++$i; - - continue; - } - - $tag = self::parseTag($mapping, $i, $flags); - switch ($mapping[$i]) { - case '[': - // nested sequence - $value = self::parseSequence($mapping, $flags, $i, $references); - // Spec: Keys MUST be unique; first one wins. - // Parser cannot abort this mapping earlier, since lines - // are processed sequentially. - // But overwriting is allowed when a merge node is used in current block. - if ('<<' === $key) { - foreach ($value as $parsedValue) { - $output += $parsedValue; - } - } elseif ($allowOverwrite || !isset($output[$key])) { - if (null !== $tag) { - $output[$key] = new TaggedValue($tag, $value); - } else { - $output[$key] = $value; - } - } elseif (isset($output[$key])) { - throw new ParseException(sprintf('Duplicate key "%s" detected.', $key), self::$parsedLineNumber + 1, $mapping); - } - break; - case '{': - // nested mapping - $value = self::parseMapping($mapping, $flags, $i, $references); - // Spec: Keys MUST be unique; first one wins. - // Parser cannot abort this mapping earlier, since lines - // are processed sequentially. - // But overwriting is allowed when a merge node is used in current block. - if ('<<' === $key) { - $output += $value; - } elseif ($allowOverwrite || !isset($output[$key])) { - if (null !== $tag) { - $output[$key] = new TaggedValue($tag, $value); - } else { - $output[$key] = $value; - } - } elseif (isset($output[$key])) { - throw new ParseException(sprintf('Duplicate key "%s" detected.', $key), self::$parsedLineNumber + 1, $mapping); - } - break; - default: - $value = self::parseScalar($mapping, $flags, [',', '}', "\n"], $i, null === $tag, $references, $isValueQuoted); - // Spec: Keys MUST be unique; first one wins. - // Parser cannot abort this mapping earlier, since lines - // are processed sequentially. - // But overwriting is allowed when a merge node is used in current block. - if ('<<' === $key) { - $output += $value; - } elseif ($allowOverwrite || !isset($output[$key])) { - if (!$isValueQuoted && \is_string($value) && '' !== $value && '&' === $value[0] && !self::isBinaryString($value) && Parser::preg_match(Parser::REFERENCE_PATTERN, $value, $matches)) { - $references[$matches['ref']] = $matches['value']; - $value = $matches['value']; - } - - if (null !== $tag) { - $output[$key] = new TaggedValue($tag, $value); - } else { - $output[$key] = $value; - } - } elseif (isset($output[$key])) { - throw new ParseException(sprintf('Duplicate key "%s" detected.', $key), self::$parsedLineNumber + 1, $mapping); - } - --$i; - } - ++$i; - - continue 2; - } - } - - throw new ParseException(sprintf('Malformed inline YAML string: "%s".', $mapping), self::$parsedLineNumber + 1, null, self::$parsedFilename); - } - - /** - * Evaluates scalars and replaces magic values. - * - * @return mixed - * - * @throws ParseException when object parsing support was disabled and the parser detected a PHP object or when a reference could not be resolved - */ - private static function evaluateScalar(string $scalar, int $flags, array &$references = [], bool &$isQuotedString = null) - { - $isQuotedString = false; - $scalar = trim($scalar); - - if (0 === strpos($scalar, '*')) { - if (false !== $pos = strpos($scalar, '#')) { - $value = substr($scalar, 1, $pos - 2); - } else { - $value = substr($scalar, 1); - } - - // an unquoted * - if (false === $value || '' === $value) { - throw new ParseException('A reference must contain at least one character.', self::$parsedLineNumber + 1, $value, self::$parsedFilename); - } - - if (!\array_key_exists($value, $references)) { - throw new ParseException(sprintf('Reference "%s" does not exist.', $value), self::$parsedLineNumber + 1, $value, self::$parsedFilename); - } - - return $references[$value]; - } - - $scalarLower = strtolower($scalar); - - switch (true) { - case 'null' === $scalarLower: - case '' === $scalar: - case '~' === $scalar: - return null; - case 'true' === $scalarLower: - return true; - case 'false' === $scalarLower: - return false; - case '!' === $scalar[0]: - switch (true) { - case 0 === strpos($scalar, '!!str '): - $s = (string) substr($scalar, 6); - - if (\in_array($s[0] ?? '', ['"', "'"], true)) { - $isQuotedString = true; - $s = self::parseQuotedScalar($s); - } - - return $s; - case 0 === strpos($scalar, '! '): - return substr($scalar, 2); - case 0 === strpos($scalar, '!php/object'): - if (self::$objectSupport) { - if (!isset($scalar[12])) { - trigger_deprecation('symfony/yaml', '5.1', 'Using the !php/object tag without a value is deprecated.'); - - return false; - } - - return unserialize(self::parseScalar(substr($scalar, 12))); - } - - if (self::$exceptionOnInvalidType) { - throw new ParseException('Object support when parsing a YAML file has been disabled.', self::$parsedLineNumber + 1, $scalar, self::$parsedFilename); - } - - return null; - case 0 === strpos($scalar, '!php/const'): - if (self::$constantSupport) { - if (!isset($scalar[11])) { - trigger_deprecation('symfony/yaml', '5.1', 'Using the !php/const tag without a value is deprecated.'); - - return ''; - } - - $i = 0; - if (\defined($const = self::parseScalar(substr($scalar, 11), 0, null, $i, false))) { - return \constant($const); - } - - throw new ParseException(sprintf('The constant "%s" is not defined.', $const), self::$parsedLineNumber + 1, $scalar, self::$parsedFilename); - } - if (self::$exceptionOnInvalidType) { - throw new ParseException(sprintf('The string "%s" could not be parsed as a constant. Did you forget to pass the "Yaml::PARSE_CONSTANT" flag to the parser?', $scalar), self::$parsedLineNumber + 1, $scalar, self::$parsedFilename); - } - - return null; - case 0 === strpos($scalar, '!!float '): - return (float) substr($scalar, 8); - case 0 === strpos($scalar, '!!binary '): - return self::evaluateBinaryScalar(substr($scalar, 9)); - } - - throw new ParseException(sprintf('The string "%s" could not be parsed as it uses an unsupported built-in tag.', $scalar), self::$parsedLineNumber, $scalar, self::$parsedFilename); - case preg_match('/^(?:\+|-)?0o(?P[0-7_]++)$/', $scalar, $matches): - $value = str_replace('_', '', $matches['value']); - - if ('-' === $scalar[0]) { - return -octdec($value); - } - - return octdec($value); - case \in_array($scalar[0], ['+', '-', '.'], true) || is_numeric($scalar[0]): - if (Parser::preg_match('{^[+-]?[0-9][0-9_]*$}', $scalar)) { - $scalar = str_replace('_', '', $scalar); - } - - switch (true) { - case ctype_digit($scalar): - if (preg_match('/^0[0-7]+$/', $scalar)) { - trigger_deprecation('symfony/yaml', '5.1', 'Support for parsing numbers prefixed with 0 as octal numbers. They will be parsed as strings as of 6.0. Use "%s" to represent the octal number.', '0o'.substr($scalar, 1)); - - return octdec($scalar); - } - - $cast = (int) $scalar; - - return ($scalar === (string) $cast) ? $cast : $scalar; - case '-' === $scalar[0] && ctype_digit(substr($scalar, 1)): - if (preg_match('/^-0[0-7]+$/', $scalar)) { - trigger_deprecation('symfony/yaml', '5.1', 'Support for parsing numbers prefixed with 0 as octal numbers. They will be parsed as strings as of 6.0. Use "%s" to represent the octal number.', '-0o'.substr($scalar, 2)); - - return -octdec(substr($scalar, 1)); - } - - $cast = (int) $scalar; - - return ($scalar === (string) $cast) ? $cast : $scalar; - case is_numeric($scalar): - case Parser::preg_match(self::getHexRegex(), $scalar): - $scalar = str_replace('_', '', $scalar); - - return '0x' === $scalar[0].$scalar[1] ? hexdec($scalar) : (float) $scalar; - case '.inf' === $scalarLower: - case '.nan' === $scalarLower: - return -log(0); - case '-.inf' === $scalarLower: - return log(0); - case Parser::preg_match('/^(-|\+)?[0-9][0-9_]*(\.[0-9_]+)?$/', $scalar): - return (float) str_replace('_', '', $scalar); - case Parser::preg_match(self::getTimestampRegex(), $scalar): - // When no timezone is provided in the parsed date, YAML spec says we must assume UTC. - $time = new \DateTime($scalar, new \DateTimeZone('UTC')); - - if (Yaml::PARSE_DATETIME & $flags) { - return $time; - } - - try { - if (false !== $scalar = $time->getTimestamp()) { - return $scalar; - } - } catch (\ValueError $e) { - // no-op - } - - return $time->format('U'); - } - } - - return (string) $scalar; - } - - private static function parseTag(string $value, int &$i, int $flags): ?string - { - if ('!' !== $value[$i]) { - return null; - } - - $tagLength = strcspn($value, " \t\n[]{},", $i + 1); - $tag = substr($value, $i + 1, $tagLength); - - $nextOffset = $i + $tagLength + 1; - $nextOffset += strspn($value, ' ', $nextOffset); - - if ('' === $tag && (!isset($value[$nextOffset]) || \in_array($value[$nextOffset], [']', '}', ','], true))) { - throw new ParseException('Using the unquoted scalar value "!" is not supported. You must quote it.', self::$parsedLineNumber + 1, $value, self::$parsedFilename); - } - - // Is followed by a scalar and is a built-in tag - if ('' !== $tag && (!isset($value[$nextOffset]) || !\in_array($value[$nextOffset], ['[', '{'], true)) && ('!' === $tag[0] || 'str' === $tag || 'php/const' === $tag || 'php/object' === $tag)) { - // Manage in {@link self::evaluateScalar()} - return null; - } - - $i = $nextOffset; - - // Built-in tags - if ('' !== $tag && '!' === $tag[0]) { - throw new ParseException(sprintf('The built-in tag "!%s" is not implemented.', $tag), self::$parsedLineNumber + 1, $value, self::$parsedFilename); - } - - if ('' !== $tag && !isset($value[$i])) { - throw new ParseException(sprintf('Missing value for tag "%s".', $tag), self::$parsedLineNumber + 1, $value, self::$parsedFilename); - } - - if ('' === $tag || Yaml::PARSE_CUSTOM_TAGS & $flags) { - return $tag; - } - - throw new ParseException(sprintf('Tags support is not enabled. Enable the "Yaml::PARSE_CUSTOM_TAGS" flag to use "!%s".', $tag), self::$parsedLineNumber + 1, $value, self::$parsedFilename); - } - - public static function evaluateBinaryScalar(string $scalar): string - { - $parsedBinaryData = self::parseScalar(preg_replace('/\s/', '', $scalar)); - - if (0 !== (\strlen($parsedBinaryData) % 4)) { - throw new ParseException(sprintf('The normalized base64 encoded data (data without whitespace characters) length must be a multiple of four (%d bytes given).', \strlen($parsedBinaryData)), self::$parsedLineNumber + 1, $scalar, self::$parsedFilename); - } - - if (!Parser::preg_match('#^[A-Z0-9+/]+={0,2}$#i', $parsedBinaryData)) { - throw new ParseException(sprintf('The base64 encoded data (%s) contains invalid characters.', $parsedBinaryData), self::$parsedLineNumber + 1, $scalar, self::$parsedFilename); - } - - return base64_decode($parsedBinaryData, true); - } - - private static function isBinaryString(string $value): bool - { - return !preg_match('//u', $value) || preg_match('/[^\x00\x07-\x0d\x1B\x20-\xff]/', $value); - } - - /** - * Gets a regex that matches a YAML date. - * - * @see http://www.yaml.org/spec/1.2/spec.html#id2761573 - */ - private static function getTimestampRegex(): string - { - return <<[0-9][0-9][0-9][0-9]) - -(?P[0-9][0-9]?) - -(?P[0-9][0-9]?) - (?:(?:[Tt]|[ \t]+) - (?P[0-9][0-9]?) - :(?P[0-9][0-9]) - :(?P[0-9][0-9]) - (?:\.(?P[0-9]*))? - (?:[ \t]*(?PZ|(?P[-+])(?P[0-9][0-9]?) - (?::(?P[0-9][0-9]))?))?)? - $~x -EOF; - } - - /** - * Gets a regex that matches a YAML number in hexadecimal notation. - */ - private static function getHexRegex(): string - { - return '~^0x[0-9a-f_]++$~i'; - } -} diff --git a/system/vendor/symfony/yaml/LICENSE b/system/vendor/symfony/yaml/LICENSE deleted file mode 100644 index 0138f8f..0000000 --- a/system/vendor/symfony/yaml/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2004-present Fabien Potencier - -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/system/vendor/symfony/yaml/Parser.php b/system/vendor/symfony/yaml/Parser.php deleted file mode 100644 index e4bacd7..0000000 --- a/system/vendor/symfony/yaml/Parser.php +++ /dev/null @@ -1,1308 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Yaml; - -use Symfony\Component\Yaml\Exception\ParseException; -use Symfony\Component\Yaml\Tag\TaggedValue; - -/** - * Parser parses YAML strings to convert them to PHP arrays. - * - * @author Fabien Potencier - * - * @final - */ -class Parser -{ - public const TAG_PATTERN = '(?P![\w!.\/:-]+)'; - public const BLOCK_SCALAR_HEADER_PATTERN = '(?P\||>)(?P\+|\-|\d+|\+\d+|\-\d+|\d+\+|\d+\-)?(?P +#.*)?'; - public const REFERENCE_PATTERN = '#^&(?P[^ ]++) *+(?P.*)#u'; - - private $filename; - private $offset = 0; - private $numberOfParsedLines = 0; - private $totalNumberOfLines; - private $lines = []; - private $currentLineNb = -1; - private $currentLine = ''; - private $refs = []; - private $skippedLineNumbers = []; - private $locallySkippedLineNumbers = []; - private $refsBeingParsed = []; - - /** - * Parses a YAML file into a PHP value. - * - * @param string $filename The path to the YAML file to be parsed - * @param int $flags A bit field of Yaml::PARSE_* constants to customize the YAML parser behavior - * - * @return mixed - * - * @throws ParseException If the file could not be read or the YAML is not valid - */ - public function parseFile(string $filename, int $flags = 0) - { - if (!is_file($filename)) { - throw new ParseException(sprintf('File "%s" does not exist.', $filename)); - } - - if (!is_readable($filename)) { - throw new ParseException(sprintf('File "%s" cannot be read.', $filename)); - } - - $this->filename = $filename; - - try { - return $this->parse(file_get_contents($filename), $flags); - } finally { - $this->filename = null; - } - } - - /** - * Parses a YAML string to a PHP value. - * - * @param string $value A YAML string - * @param int $flags A bit field of Yaml::PARSE_* constants to customize the YAML parser behavior - * - * @return mixed - * - * @throws ParseException If the YAML is not valid - */ - public function parse(string $value, int $flags = 0) - { - if (false === preg_match('//u', $value)) { - throw new ParseException('The YAML value does not appear to be valid UTF-8.', -1, null, $this->filename); - } - - $this->refs = []; - - $mbEncoding = null; - - if (2 /* MB_OVERLOAD_STRING */ & (int) \ini_get('mbstring.func_overload')) { - $mbEncoding = mb_internal_encoding(); - mb_internal_encoding('UTF-8'); - } - - try { - $data = $this->doParse($value, $flags); - } finally { - if (null !== $mbEncoding) { - mb_internal_encoding($mbEncoding); - } - $this->refsBeingParsed = []; - $this->offset = 0; - $this->lines = []; - $this->currentLine = ''; - $this->numberOfParsedLines = 0; - $this->refs = []; - $this->skippedLineNumbers = []; - $this->locallySkippedLineNumbers = []; - $this->totalNumberOfLines = null; - } - - return $data; - } - - private function doParse(string $value, int $flags) - { - $this->currentLineNb = -1; - $this->currentLine = ''; - $value = $this->cleanup($value); - $this->lines = explode("\n", $value); - $this->numberOfParsedLines = \count($this->lines); - $this->locallySkippedLineNumbers = []; - - if (null === $this->totalNumberOfLines) { - $this->totalNumberOfLines = $this->numberOfParsedLines; - } - - if (!$this->moveToNextLine()) { - return null; - } - - $data = []; - $context = null; - $allowOverwrite = false; - - while ($this->isCurrentLineEmpty()) { - if (!$this->moveToNextLine()) { - return null; - } - } - - // Resolves the tag and returns if end of the document - if (null !== ($tag = $this->getLineTag($this->currentLine, $flags, false)) && !$this->moveToNextLine()) { - return new TaggedValue($tag, ''); - } - - do { - if ($this->isCurrentLineEmpty()) { - continue; - } - - // tab? - if ("\t" === $this->currentLine[0]) { - throw new ParseException('A YAML file cannot contain tabs as indentation.', $this->getRealCurrentLineNb() + 1, $this->currentLine, $this->filename); - } - - Inline::initialize($flags, $this->getRealCurrentLineNb(), $this->filename); - - $isRef = $mergeNode = false; - if ('-' === $this->currentLine[0] && self::preg_match('#^\-((?P\s+)(?P.+))?$#u', rtrim($this->currentLine), $values)) { - if ($context && 'mapping' == $context) { - throw new ParseException('You cannot define a sequence item when in a mapping.', $this->getRealCurrentLineNb() + 1, $this->currentLine, $this->filename); - } - $context = 'sequence'; - - if (isset($values['value']) && '&' === $values['value'][0] && self::preg_match(self::REFERENCE_PATTERN, $values['value'], $matches)) { - $isRef = $matches['ref']; - $this->refsBeingParsed[] = $isRef; - $values['value'] = $matches['value']; - } - - if (isset($values['value'][1]) && '?' === $values['value'][0] && ' ' === $values['value'][1]) { - throw new ParseException('Complex mappings are not supported.', $this->getRealCurrentLineNb() + 1, $this->currentLine); - } - - // array - if (isset($values['value']) && 0 === strpos(ltrim($values['value'], ' '), '-')) { - // Inline first child - $currentLineNumber = $this->getRealCurrentLineNb(); - - $sequenceIndentation = \strlen($values['leadspaces']) + 1; - $sequenceYaml = substr($this->currentLine, $sequenceIndentation); - $sequenceYaml .= "\n".$this->getNextEmbedBlock($sequenceIndentation, true); - - $data[] = $this->parseBlock($currentLineNumber, rtrim($sequenceYaml), $flags); - } elseif (!isset($values['value']) || '' == trim($values['value'], ' ') || 0 === strpos(ltrim($values['value'], ' '), '#')) { - $data[] = $this->parseBlock($this->getRealCurrentLineNb() + 1, $this->getNextEmbedBlock(null, true) ?? '', $flags); - } elseif (null !== $subTag = $this->getLineTag(ltrim($values['value'], ' '), $flags)) { - $data[] = new TaggedValue( - $subTag, - $this->parseBlock($this->getRealCurrentLineNb() + 1, $this->getNextEmbedBlock(null, true), $flags) - ); - } else { - if ( - isset($values['leadspaces']) - && ( - '!' === $values['value'][0] - || self::preg_match('#^(?P'.Inline::REGEX_QUOTED_STRING.'|[^ \'"\{\[].*?) *\:(\s+(?P.+?))?\s*$#u', $this->trimTag($values['value']), $matches) - ) - ) { - $block = $values['value']; - if ($this->isNextLineIndented() || isset($matches['value']) && '>-' === $matches['value']) { - $block .= "\n".$this->getNextEmbedBlock($this->getCurrentLineIndentation() + \strlen($values['leadspaces']) + 1); - } - - $data[] = $this->parseBlock($this->getRealCurrentLineNb(), $block, $flags); - } else { - $data[] = $this->parseValue($values['value'], $flags, $context); - } - } - if ($isRef) { - $this->refs[$isRef] = end($data); - array_pop($this->refsBeingParsed); - } - } elseif ( - self::preg_match('#^(?P(?:![^\s]++\s++)?(?:'.Inline::REGEX_QUOTED_STRING.'|(?:!?!php/const:)?[^ \'"\[\{!].*?)) *\:(( |\t)++(?P.+))?$#u', rtrim($this->currentLine), $values) - && (false === strpos($values['key'], ' #') || \in_array($values['key'][0], ['"', "'"])) - ) { - if ($context && 'sequence' == $context) { - throw new ParseException('You cannot define a mapping item when in a sequence.', $this->currentLineNb + 1, $this->currentLine, $this->filename); - } - $context = 'mapping'; - - try { - $key = Inline::parseScalar($values['key']); - } catch (ParseException $e) { - $e->setParsedLine($this->getRealCurrentLineNb() + 1); - $e->setSnippet($this->currentLine); - - throw $e; - } - - if (!\is_string($key) && !\is_int($key)) { - throw new ParseException((is_numeric($key) ? 'Numeric' : 'Non-string').' keys are not supported. Quote your evaluable mapping keys instead.', $this->getRealCurrentLineNb() + 1, $this->currentLine); - } - - // Convert float keys to strings, to avoid being converted to integers by PHP - if (\is_float($key)) { - $key = (string) $key; - } - - if ('<<' === $key && (!isset($values['value']) || '&' !== $values['value'][0] || !self::preg_match('#^&(?P[^ ]+)#u', $values['value'], $refMatches))) { - $mergeNode = true; - $allowOverwrite = true; - if (isset($values['value'][0]) && '*' === $values['value'][0]) { - $refName = substr(rtrim($values['value']), 1); - if (!\array_key_exists($refName, $this->refs)) { - if (false !== $pos = array_search($refName, $this->refsBeingParsed, true)) { - throw new ParseException(sprintf('Circular reference [%s] detected for reference "%s".', implode(', ', array_merge(\array_slice($this->refsBeingParsed, $pos), [$refName])), $refName), $this->currentLineNb + 1, $this->currentLine, $this->filename); - } - - throw new ParseException(sprintf('Reference "%s" does not exist.', $refName), $this->getRealCurrentLineNb() + 1, $this->currentLine, $this->filename); - } - - $refValue = $this->refs[$refName]; - - if (Yaml::PARSE_OBJECT_FOR_MAP & $flags && $refValue instanceof \stdClass) { - $refValue = (array) $refValue; - } - - if (!\is_array($refValue)) { - throw new ParseException('YAML merge keys used with a scalar value instead of an array.', $this->getRealCurrentLineNb() + 1, $this->currentLine, $this->filename); - } - - $data += $refValue; // array union - } else { - if (isset($values['value']) && '' !== $values['value']) { - $value = $values['value']; - } else { - $value = $this->getNextEmbedBlock(); - } - $parsed = $this->parseBlock($this->getRealCurrentLineNb() + 1, $value, $flags); - - if (Yaml::PARSE_OBJECT_FOR_MAP & $flags && $parsed instanceof \stdClass) { - $parsed = (array) $parsed; - } - - if (!\is_array($parsed)) { - throw new ParseException('YAML merge keys used with a scalar value instead of an array.', $this->getRealCurrentLineNb() + 1, $this->currentLine, $this->filename); - } - - if (isset($parsed[0])) { - // If the value associated with the merge key is a sequence, then this sequence is expected to contain mapping nodes - // and each of these nodes is merged in turn according to its order in the sequence. Keys in mapping nodes earlier - // in the sequence override keys specified in later mapping nodes. - foreach ($parsed as $parsedItem) { - if (Yaml::PARSE_OBJECT_FOR_MAP & $flags && $parsedItem instanceof \stdClass) { - $parsedItem = (array) $parsedItem; - } - - if (!\is_array($parsedItem)) { - throw new ParseException('Merge items must be arrays.', $this->getRealCurrentLineNb() + 1, $parsedItem, $this->filename); - } - - $data += $parsedItem; // array union - } - } else { - // If the value associated with the key is a single mapping node, each of its key/value pairs is inserted into the - // current mapping, unless the key already exists in it. - $data += $parsed; // array union - } - } - } elseif ('<<' !== $key && isset($values['value']) && '&' === $values['value'][0] && self::preg_match(self::REFERENCE_PATTERN, $values['value'], $matches)) { - $isRef = $matches['ref']; - $this->refsBeingParsed[] = $isRef; - $values['value'] = $matches['value']; - } - - $subTag = null; - if ($mergeNode) { - // Merge keys - } elseif (!isset($values['value']) || '' === $values['value'] || 0 === strpos($values['value'], '#') || (null !== $subTag = $this->getLineTag($values['value'], $flags)) || '<<' === $key) { - // hash - // if next line is less indented or equal, then it means that the current value is null - if (!$this->isNextLineIndented() && !$this->isNextLineUnIndentedCollection()) { - // Spec: Keys MUST be unique; first one wins. - // But overwriting is allowed when a merge node is used in current block. - if ($allowOverwrite || !isset($data[$key])) { - if (null !== $subTag) { - $data[$key] = new TaggedValue($subTag, ''); - } else { - $data[$key] = null; - } - } else { - throw new ParseException(sprintf('Duplicate key "%s" detected.', $key), $this->getRealCurrentLineNb() + 1, $this->currentLine); - } - } else { - // remember the parsed line number here in case we need it to provide some contexts in error messages below - $realCurrentLineNbKey = $this->getRealCurrentLineNb(); - $value = $this->parseBlock($this->getRealCurrentLineNb() + 1, $this->getNextEmbedBlock(), $flags); - if ('<<' === $key) { - $this->refs[$refMatches['ref']] = $value; - - if (Yaml::PARSE_OBJECT_FOR_MAP & $flags && $value instanceof \stdClass) { - $value = (array) $value; - } - - $data += $value; - } elseif ($allowOverwrite || !isset($data[$key])) { - // Spec: Keys MUST be unique; first one wins. - // But overwriting is allowed when a merge node is used in current block. - if (null !== $subTag) { - $data[$key] = new TaggedValue($subTag, $value); - } else { - $data[$key] = $value; - } - } else { - throw new ParseException(sprintf('Duplicate key "%s" detected.', $key), $realCurrentLineNbKey + 1, $this->currentLine); - } - } - } else { - $value = $this->parseValue(rtrim($values['value']), $flags, $context); - // Spec: Keys MUST be unique; first one wins. - // But overwriting is allowed when a merge node is used in current block. - if ($allowOverwrite || !isset($data[$key])) { - $data[$key] = $value; - } else { - throw new ParseException(sprintf('Duplicate key "%s" detected.', $key), $this->getRealCurrentLineNb() + 1, $this->currentLine); - } - } - if ($isRef) { - $this->refs[$isRef] = $data[$key]; - array_pop($this->refsBeingParsed); - } - } elseif ('"' === $this->currentLine[0] || "'" === $this->currentLine[0]) { - if (null !== $context) { - throw new ParseException('Unable to parse.', $this->getRealCurrentLineNb() + 1, $this->currentLine, $this->filename); - } - - try { - return Inline::parse($this->lexInlineQuotedString(), $flags, $this->refs); - } catch (ParseException $e) { - $e->setParsedLine($this->getRealCurrentLineNb() + 1); - $e->setSnippet($this->currentLine); - - throw $e; - } - } elseif ('{' === $this->currentLine[0]) { - if (null !== $context) { - throw new ParseException('Unable to parse.', $this->getRealCurrentLineNb() + 1, $this->currentLine, $this->filename); - } - - try { - $parsedMapping = Inline::parse($this->lexInlineMapping(), $flags, $this->refs); - - while ($this->moveToNextLine()) { - if (!$this->isCurrentLineEmpty()) { - throw new ParseException('Unable to parse.', $this->getRealCurrentLineNb() + 1, $this->currentLine, $this->filename); - } - } - - return $parsedMapping; - } catch (ParseException $e) { - $e->setParsedLine($this->getRealCurrentLineNb() + 1); - $e->setSnippet($this->currentLine); - - throw $e; - } - } elseif ('[' === $this->currentLine[0]) { - if (null !== $context) { - throw new ParseException('Unable to parse.', $this->getRealCurrentLineNb() + 1, $this->currentLine, $this->filename); - } - - try { - $parsedSequence = Inline::parse($this->lexInlineSequence(), $flags, $this->refs); - - while ($this->moveToNextLine()) { - if (!$this->isCurrentLineEmpty()) { - throw new ParseException('Unable to parse.', $this->getRealCurrentLineNb() + 1, $this->currentLine, $this->filename); - } - } - - return $parsedSequence; - } catch (ParseException $e) { - $e->setParsedLine($this->getRealCurrentLineNb() + 1); - $e->setSnippet($this->currentLine); - - throw $e; - } - } else { - // multiple documents are not supported - if ('---' === $this->currentLine) { - throw new ParseException('Multiple documents are not supported.', $this->currentLineNb + 1, $this->currentLine, $this->filename); - } - - if ($deprecatedUsage = (isset($this->currentLine[1]) && '?' === $this->currentLine[0] && ' ' === $this->currentLine[1])) { - throw new ParseException('Complex mappings are not supported.', $this->getRealCurrentLineNb() + 1, $this->currentLine); - } - - // 1-liner optionally followed by newline(s) - if (\is_string($value) && $this->lines[0] === trim($value)) { - try { - $value = Inline::parse($this->lines[0], $flags, $this->refs); - } catch (ParseException $e) { - $e->setParsedLine($this->getRealCurrentLineNb() + 1); - $e->setSnippet($this->currentLine); - - throw $e; - } - - return $value; - } - - // try to parse the value as a multi-line string as a last resort - if (0 === $this->currentLineNb) { - $previousLineWasNewline = false; - $previousLineWasTerminatedWithBackslash = false; - $value = ''; - - foreach ($this->lines as $line) { - $trimmedLine = trim($line); - if ('#' === ($trimmedLine[0] ?? '')) { - continue; - } - // If the indentation is not consistent at offset 0, it is to be considered as a ParseError - if (0 === $this->offset && !$deprecatedUsage && isset($line[0]) && ' ' === $line[0]) { - throw new ParseException('Unable to parse.', $this->getRealCurrentLineNb() + 1, $this->currentLine, $this->filename); - } - - if (false !== strpos($line, ': ')) { - throw new ParseException('Mapping values are not allowed in multi-line blocks.', $this->getRealCurrentLineNb() + 1, $this->currentLine, $this->filename); - } - - if ('' === $trimmedLine) { - $value .= "\n"; - } elseif (!$previousLineWasNewline && !$previousLineWasTerminatedWithBackslash) { - $value .= ' '; - } - - if ('' !== $trimmedLine && '\\' === substr($line, -1)) { - $value .= ltrim(substr($line, 0, -1)); - } elseif ('' !== $trimmedLine) { - $value .= $trimmedLine; - } - - if ('' === $trimmedLine) { - $previousLineWasNewline = true; - $previousLineWasTerminatedWithBackslash = false; - } elseif ('\\' === substr($line, -1)) { - $previousLineWasNewline = false; - $previousLineWasTerminatedWithBackslash = true; - } else { - $previousLineWasNewline = false; - $previousLineWasTerminatedWithBackslash = false; - } - } - - try { - return Inline::parse(trim($value)); - } catch (ParseException $e) { - // fall-through to the ParseException thrown below - } - } - - throw new ParseException('Unable to parse.', $this->getRealCurrentLineNb() + 1, $this->currentLine, $this->filename); - } - } while ($this->moveToNextLine()); - - if (null !== $tag) { - $data = new TaggedValue($tag, $data); - } - - if (Yaml::PARSE_OBJECT_FOR_MAP & $flags && 'mapping' === $context && !\is_object($data)) { - $object = new \stdClass(); - - foreach ($data as $key => $value) { - $object->$key = $value; - } - - $data = $object; - } - - return empty($data) ? null : $data; - } - - private function parseBlock(int $offset, string $yaml, int $flags) - { - $skippedLineNumbers = $this->skippedLineNumbers; - - foreach ($this->locallySkippedLineNumbers as $lineNumber) { - if ($lineNumber < $offset) { - continue; - } - - $skippedLineNumbers[] = $lineNumber; - } - - $parser = new self(); - $parser->offset = $offset; - $parser->totalNumberOfLines = $this->totalNumberOfLines; - $parser->skippedLineNumbers = $skippedLineNumbers; - $parser->refs = &$this->refs; - $parser->refsBeingParsed = $this->refsBeingParsed; - - return $parser->doParse($yaml, $flags); - } - - /** - * Returns the current line number (takes the offset into account). - * - * @internal - */ - public function getRealCurrentLineNb(): int - { - $realCurrentLineNumber = $this->currentLineNb + $this->offset; - - foreach ($this->skippedLineNumbers as $skippedLineNumber) { - if ($skippedLineNumber > $realCurrentLineNumber) { - break; - } - - ++$realCurrentLineNumber; - } - - return $realCurrentLineNumber; - } - - /** - * Returns the current line indentation. - */ - private function getCurrentLineIndentation(): int - { - if (' ' !== ($this->currentLine[0] ?? '')) { - return 0; - } - - return \strlen($this->currentLine) - \strlen(ltrim($this->currentLine, ' ')); - } - - /** - * Returns the next embed block of YAML. - * - * @param int|null $indentation The indent level at which the block is to be read, or null for default - * @param bool $inSequence True if the enclosing data structure is a sequence - * - * @throws ParseException When indentation problem are detected - */ - private function getNextEmbedBlock(int $indentation = null, bool $inSequence = false): string - { - $oldLineIndentation = $this->getCurrentLineIndentation(); - - if (!$this->moveToNextLine()) { - return ''; - } - - if (null === $indentation) { - $newIndent = null; - $movements = 0; - - do { - $EOF = false; - - // empty and comment-like lines do not influence the indentation depth - if ($this->isCurrentLineEmpty() || $this->isCurrentLineComment()) { - $EOF = !$this->moveToNextLine(); - - if (!$EOF) { - ++$movements; - } - } else { - $newIndent = $this->getCurrentLineIndentation(); - } - } while (!$EOF && null === $newIndent); - - for ($i = 0; $i < $movements; ++$i) { - $this->moveToPreviousLine(); - } - - $unindentedEmbedBlock = $this->isStringUnIndentedCollectionItem(); - - if (!$this->isCurrentLineEmpty() && 0 === $newIndent && !$unindentedEmbedBlock) { - throw new ParseException('Indentation problem.', $this->getRealCurrentLineNb() + 1, $this->currentLine, $this->filename); - } - } else { - $newIndent = $indentation; - } - - $data = []; - - if ($this->getCurrentLineIndentation() >= $newIndent) { - $data[] = substr($this->currentLine, $newIndent ?? 0); - } elseif ($this->isCurrentLineEmpty() || $this->isCurrentLineComment()) { - $data[] = $this->currentLine; - } else { - $this->moveToPreviousLine(); - - return ''; - } - - if ($inSequence && $oldLineIndentation === $newIndent && isset($data[0][0]) && '-' === $data[0][0]) { - // the previous line contained a dash but no item content, this line is a sequence item with the same indentation - // and therefore no nested list or mapping - $this->moveToPreviousLine(); - - return ''; - } - - $isItUnindentedCollection = $this->isStringUnIndentedCollectionItem(); - $isItComment = $this->isCurrentLineComment(); - - while ($this->moveToNextLine()) { - if ($isItComment && !$isItUnindentedCollection) { - $isItUnindentedCollection = $this->isStringUnIndentedCollectionItem(); - $isItComment = $this->isCurrentLineComment(); - } - - $indent = $this->getCurrentLineIndentation(); - - if ($isItUnindentedCollection && !$this->isCurrentLineEmpty() && !$this->isStringUnIndentedCollectionItem() && $newIndent === $indent) { - $this->moveToPreviousLine(); - break; - } - - if ($this->isCurrentLineBlank()) { - $data[] = substr($this->currentLine, $newIndent); - continue; - } - - if ($indent >= $newIndent) { - $data[] = substr($this->currentLine, $newIndent); - } elseif ($this->isCurrentLineComment()) { - $data[] = $this->currentLine; - } elseif (0 == $indent) { - $this->moveToPreviousLine(); - - break; - } else { - throw new ParseException('Indentation problem.', $this->getRealCurrentLineNb() + 1, $this->currentLine, $this->filename); - } - } - - return implode("\n", $data); - } - - private function hasMoreLines(): bool - { - return (\count($this->lines) - 1) > $this->currentLineNb; - } - - /** - * Moves the parser to the next line. - */ - private function moveToNextLine(): bool - { - if ($this->currentLineNb >= $this->numberOfParsedLines - 1) { - return false; - } - - $this->currentLine = $this->lines[++$this->currentLineNb]; - - return true; - } - - /** - * Moves the parser to the previous line. - */ - private function moveToPreviousLine(): bool - { - if ($this->currentLineNb < 1) { - return false; - } - - $this->currentLine = $this->lines[--$this->currentLineNb]; - - return true; - } - - /** - * Parses a YAML value. - * - * @param string $value A YAML value - * @param int $flags A bit field of Yaml::PARSE_* constants to customize the YAML parser behavior - * @param string $context The parser context (either sequence or mapping) - * - * @return mixed - * - * @throws ParseException When reference does not exist - */ - private function parseValue(string $value, int $flags, string $context) - { - if (0 === strpos($value, '*')) { - if (false !== $pos = strpos($value, '#')) { - $value = substr($value, 1, $pos - 2); - } else { - $value = substr($value, 1); - } - - if (!\array_key_exists($value, $this->refs)) { - if (false !== $pos = array_search($value, $this->refsBeingParsed, true)) { - throw new ParseException(sprintf('Circular reference [%s] detected for reference "%s".', implode(', ', array_merge(\array_slice($this->refsBeingParsed, $pos), [$value])), $value), $this->currentLineNb + 1, $this->currentLine, $this->filename); - } - - throw new ParseException(sprintf('Reference "%s" does not exist.', $value), $this->currentLineNb + 1, $this->currentLine, $this->filename); - } - - return $this->refs[$value]; - } - - if (\in_array($value[0], ['!', '|', '>'], true) && self::preg_match('/^(?:'.self::TAG_PATTERN.' +)?'.self::BLOCK_SCALAR_HEADER_PATTERN.'$/', $value, $matches)) { - $modifiers = $matches['modifiers'] ?? ''; - - $data = $this->parseBlockScalar($matches['separator'], preg_replace('#\d+#', '', $modifiers), abs((int) $modifiers)); - - if ('' !== $matches['tag'] && '!' !== $matches['tag']) { - if ('!!binary' === $matches['tag']) { - return Inline::evaluateBinaryScalar($data); - } - - return new TaggedValue(substr($matches['tag'], 1), $data); - } - - return $data; - } - - try { - if ('' !== $value && '{' === $value[0]) { - $cursor = \strlen(rtrim($this->currentLine)) - \strlen(rtrim($value)); - - return Inline::parse($this->lexInlineMapping($cursor), $flags, $this->refs); - } elseif ('' !== $value && '[' === $value[0]) { - $cursor = \strlen(rtrim($this->currentLine)) - \strlen(rtrim($value)); - - return Inline::parse($this->lexInlineSequence($cursor), $flags, $this->refs); - } - - switch ($value[0] ?? '') { - case '"': - case "'": - $cursor = \strlen(rtrim($this->currentLine)) - \strlen(rtrim($value)); - $parsedValue = Inline::parse($this->lexInlineQuotedString($cursor), $flags, $this->refs); - - if (isset($this->currentLine[$cursor]) && preg_replace('/\s*(#.*)?$/A', '', substr($this->currentLine, $cursor))) { - throw new ParseException(sprintf('Unexpected characters near "%s".', substr($this->currentLine, $cursor))); - } - - return $parsedValue; - default: - $lines = []; - - while ($this->moveToNextLine()) { - // unquoted strings end before the first unindented line - if (0 === $this->getCurrentLineIndentation()) { - $this->moveToPreviousLine(); - - break; - } - - $lines[] = trim($this->currentLine); - } - - for ($i = 0, $linesCount = \count($lines), $previousLineBlank = false; $i < $linesCount; ++$i) { - if ('' === $lines[$i]) { - $value .= "\n"; - $previousLineBlank = true; - } elseif ($previousLineBlank) { - $value .= $lines[$i]; - $previousLineBlank = false; - } else { - $value .= ' '.$lines[$i]; - $previousLineBlank = false; - } - } - - Inline::$parsedLineNumber = $this->getRealCurrentLineNb(); - - $parsedValue = Inline::parse($value, $flags, $this->refs); - - if ('mapping' === $context && \is_string($parsedValue) && '"' !== $value[0] && "'" !== $value[0] && '[' !== $value[0] && '{' !== $value[0] && '!' !== $value[0] && false !== strpos($parsedValue, ': ')) { - throw new ParseException('A colon cannot be used in an unquoted mapping value.', $this->getRealCurrentLineNb() + 1, $value, $this->filename); - } - - return $parsedValue; - } - } catch (ParseException $e) { - $e->setParsedLine($this->getRealCurrentLineNb() + 1); - $e->setSnippet($this->currentLine); - - throw $e; - } - } - - /** - * Parses a block scalar. - * - * @param string $style The style indicator that was used to begin this block scalar (| or >) - * @param string $chomping The chomping indicator that was used to begin this block scalar (+ or -) - * @param int $indentation The indentation indicator that was used to begin this block scalar - */ - private function parseBlockScalar(string $style, string $chomping = '', int $indentation = 0): string - { - $notEOF = $this->moveToNextLine(); - if (!$notEOF) { - return ''; - } - - $isCurrentLineBlank = $this->isCurrentLineBlank(); - $blockLines = []; - - // leading blank lines are consumed before determining indentation - while ($notEOF && $isCurrentLineBlank) { - // newline only if not EOF - if ($notEOF = $this->moveToNextLine()) { - $blockLines[] = ''; - $isCurrentLineBlank = $this->isCurrentLineBlank(); - } - } - - // determine indentation if not specified - if (0 === $indentation) { - $currentLineLength = \strlen($this->currentLine); - - for ($i = 0; $i < $currentLineLength && ' ' === $this->currentLine[$i]; ++$i) { - ++$indentation; - } - } - - if ($indentation > 0) { - $pattern = sprintf('/^ {%d}(.*)$/', $indentation); - - while ( - $notEOF && ( - $isCurrentLineBlank || - self::preg_match($pattern, $this->currentLine, $matches) - ) - ) { - if ($isCurrentLineBlank && \strlen($this->currentLine) > $indentation) { - $blockLines[] = substr($this->currentLine, $indentation); - } elseif ($isCurrentLineBlank) { - $blockLines[] = ''; - } else { - $blockLines[] = $matches[1]; - } - - // newline only if not EOF - if ($notEOF = $this->moveToNextLine()) { - $isCurrentLineBlank = $this->isCurrentLineBlank(); - } - } - } elseif ($notEOF) { - $blockLines[] = ''; - } - - if ($notEOF) { - $blockLines[] = ''; - $this->moveToPreviousLine(); - } elseif (!$notEOF && !$this->isCurrentLineLastLineInDocument()) { - $blockLines[] = ''; - } - - // folded style - if ('>' === $style) { - $text = ''; - $previousLineIndented = false; - $previousLineBlank = false; - - for ($i = 0, $blockLinesCount = \count($blockLines); $i < $blockLinesCount; ++$i) { - if ('' === $blockLines[$i]) { - $text .= "\n"; - $previousLineIndented = false; - $previousLineBlank = true; - } elseif (' ' === $blockLines[$i][0]) { - $text .= "\n".$blockLines[$i]; - $previousLineIndented = true; - $previousLineBlank = false; - } elseif ($previousLineIndented) { - $text .= "\n".$blockLines[$i]; - $previousLineIndented = false; - $previousLineBlank = false; - } elseif ($previousLineBlank || 0 === $i) { - $text .= $blockLines[$i]; - $previousLineIndented = false; - $previousLineBlank = false; - } else { - $text .= ' '.$blockLines[$i]; - $previousLineIndented = false; - $previousLineBlank = false; - } - } - } else { - $text = implode("\n", $blockLines); - } - - // deal with trailing newlines - if ('' === $chomping) { - $text = preg_replace('/\n+$/', "\n", $text); - } elseif ('-' === $chomping) { - $text = preg_replace('/\n+$/', '', $text); - } - - return $text; - } - - /** - * Returns true if the next line is indented. - */ - private function isNextLineIndented(): bool - { - $currentIndentation = $this->getCurrentLineIndentation(); - $movements = 0; - - do { - $EOF = !$this->moveToNextLine(); - - if (!$EOF) { - ++$movements; - } - } while (!$EOF && ($this->isCurrentLineEmpty() || $this->isCurrentLineComment())); - - if ($EOF) { - for ($i = 0; $i < $movements; ++$i) { - $this->moveToPreviousLine(); - } - - return false; - } - - $ret = $this->getCurrentLineIndentation() > $currentIndentation; - - for ($i = 0; $i < $movements; ++$i) { - $this->moveToPreviousLine(); - } - - return $ret; - } - - /** - * Returns true if the current line is blank or if it is a comment line. - */ - private function isCurrentLineEmpty(): bool - { - return $this->isCurrentLineBlank() || $this->isCurrentLineComment(); - } - - /** - * Returns true if the current line is blank. - */ - private function isCurrentLineBlank(): bool - { - return '' === $this->currentLine || '' === trim($this->currentLine, ' '); - } - - /** - * Returns true if the current line is a comment line. - */ - private function isCurrentLineComment(): bool - { - // checking explicitly the first char of the trim is faster than loops or strpos - $ltrimmedLine = '' !== $this->currentLine && ' ' === $this->currentLine[0] ? ltrim($this->currentLine, ' ') : $this->currentLine; - - return '' !== $ltrimmedLine && '#' === $ltrimmedLine[0]; - } - - private function isCurrentLineLastLineInDocument(): bool - { - return ($this->offset + $this->currentLineNb) >= ($this->totalNumberOfLines - 1); - } - - /** - * Cleanups a YAML string to be parsed. - * - * @param string $value The input YAML string - */ - private function cleanup(string $value): string - { - $value = str_replace(["\r\n", "\r"], "\n", $value); - - // strip YAML header - $count = 0; - $value = preg_replace('#^\%YAML[: ][\d\.]+.*\n#u', '', $value, -1, $count); - $this->offset += $count; - - // remove leading comments - $trimmedValue = preg_replace('#^(\#.*?\n)+#s', '', $value, -1, $count); - if (1 === $count) { - // items have been removed, update the offset - $this->offset += substr_count($value, "\n") - substr_count($trimmedValue, "\n"); - $value = $trimmedValue; - } - - // remove start of the document marker (---) - $trimmedValue = preg_replace('#^\-\-\-.*?\n#s', '', $value, -1, $count); - if (1 === $count) { - // items have been removed, update the offset - $this->offset += substr_count($value, "\n") - substr_count($trimmedValue, "\n"); - $value = $trimmedValue; - - // remove end of the document marker (...) - $value = preg_replace('#\.\.\.\s*$#', '', $value); - } - - return $value; - } - - /** - * Returns true if the next line starts unindented collection. - */ - private function isNextLineUnIndentedCollection(): bool - { - $currentIndentation = $this->getCurrentLineIndentation(); - $movements = 0; - - do { - $EOF = !$this->moveToNextLine(); - - if (!$EOF) { - ++$movements; - } - } while (!$EOF && ($this->isCurrentLineEmpty() || $this->isCurrentLineComment())); - - if ($EOF) { - return false; - } - - $ret = $this->getCurrentLineIndentation() === $currentIndentation && $this->isStringUnIndentedCollectionItem(); - - for ($i = 0; $i < $movements; ++$i) { - $this->moveToPreviousLine(); - } - - return $ret; - } - - /** - * Returns true if the string is un-indented collection item. - */ - private function isStringUnIndentedCollectionItem(): bool - { - return '-' === rtrim($this->currentLine) || 0 === strpos($this->currentLine, '- '); - } - - /** - * A local wrapper for "preg_match" which will throw a ParseException if there - * is an internal error in the PCRE engine. - * - * This avoids us needing to check for "false" every time PCRE is used - * in the YAML engine - * - * @throws ParseException on a PCRE internal error - * - * @see preg_last_error() - * - * @internal - */ - public static function preg_match(string $pattern, string $subject, array &$matches = null, int $flags = 0, int $offset = 0): int - { - if (false === $ret = preg_match($pattern, $subject, $matches, $flags, $offset)) { - switch (preg_last_error()) { - case \PREG_INTERNAL_ERROR: - $error = 'Internal PCRE error.'; - break; - case \PREG_BACKTRACK_LIMIT_ERROR: - $error = 'pcre.backtrack_limit reached.'; - break; - case \PREG_RECURSION_LIMIT_ERROR: - $error = 'pcre.recursion_limit reached.'; - break; - case \PREG_BAD_UTF8_ERROR: - $error = 'Malformed UTF-8 data.'; - break; - case \PREG_BAD_UTF8_OFFSET_ERROR: - $error = 'Offset doesn\'t correspond to the begin of a valid UTF-8 code point.'; - break; - default: - $error = 'Error.'; - } - - throw new ParseException($error); - } - - return $ret; - } - - /** - * Trim the tag on top of the value. - * - * Prevent values such as "!foo {quz: bar}" to be considered as - * a mapping block. - */ - private function trimTag(string $value): string - { - if ('!' === $value[0]) { - return ltrim(substr($value, 1, strcspn($value, " \r\n", 1)), ' '); - } - - return $value; - } - - private function getLineTag(string $value, int $flags, bool $nextLineCheck = true): ?string - { - if ('' === $value || '!' !== $value[0] || 1 !== self::preg_match('/^'.self::TAG_PATTERN.' *( +#.*)?$/', $value, $matches)) { - return null; - } - - if ($nextLineCheck && !$this->isNextLineIndented()) { - return null; - } - - $tag = substr($matches['tag'], 1); - - // Built-in tags - if ($tag && '!' === $tag[0]) { - throw new ParseException(sprintf('The built-in tag "!%s" is not implemented.', $tag), $this->getRealCurrentLineNb() + 1, $value, $this->filename); - } - - if (Yaml::PARSE_CUSTOM_TAGS & $flags) { - return $tag; - } - - throw new ParseException(sprintf('Tags support is not enabled. You must use the flag "Yaml::PARSE_CUSTOM_TAGS" to use "%s".', $matches['tag']), $this->getRealCurrentLineNb() + 1, $value, $this->filename); - } - - private function lexInlineQuotedString(int &$cursor = 0): string - { - $quotation = $this->currentLine[$cursor]; - $value = $quotation; - ++$cursor; - - $previousLineWasNewline = true; - $previousLineWasTerminatedWithBackslash = false; - $lineNumber = 0; - - do { - if (++$lineNumber > 1) { - $cursor += strspn($this->currentLine, ' ', $cursor); - } - - if ($this->isCurrentLineBlank()) { - $value .= "\n"; - } elseif (!$previousLineWasNewline && !$previousLineWasTerminatedWithBackslash) { - $value .= ' '; - } - - for (; \strlen($this->currentLine) > $cursor; ++$cursor) { - switch ($this->currentLine[$cursor]) { - case '\\': - if ("'" === $quotation) { - $value .= '\\'; - } elseif (isset($this->currentLine[++$cursor])) { - $value .= '\\'.$this->currentLine[$cursor]; - } - - break; - case $quotation: - ++$cursor; - - if ("'" === $quotation && isset($this->currentLine[$cursor]) && "'" === $this->currentLine[$cursor]) { - $value .= "''"; - break; - } - - return $value.$quotation; - default: - $value .= $this->currentLine[$cursor]; - } - } - - if ($this->isCurrentLineBlank()) { - $previousLineWasNewline = true; - $previousLineWasTerminatedWithBackslash = false; - } elseif ('\\' === $this->currentLine[-1]) { - $previousLineWasNewline = false; - $previousLineWasTerminatedWithBackslash = true; - } else { - $previousLineWasNewline = false; - $previousLineWasTerminatedWithBackslash = false; - } - - if ($this->hasMoreLines()) { - $cursor = 0; - } - } while ($this->moveToNextLine()); - - throw new ParseException('Malformed inline YAML string.'); - } - - private function lexUnquotedString(int &$cursor): string - { - $offset = $cursor; - $cursor += strcspn($this->currentLine, '[]{},: ', $cursor); - - if ($cursor === $offset) { - throw new ParseException('Malformed unquoted YAML string.'); - } - - return substr($this->currentLine, $offset, $cursor - $offset); - } - - private function lexInlineMapping(int &$cursor = 0): string - { - return $this->lexInlineStructure($cursor, '}'); - } - - private function lexInlineSequence(int &$cursor = 0): string - { - return $this->lexInlineStructure($cursor, ']'); - } - - private function lexInlineStructure(int &$cursor, string $closingTag): string - { - $value = $this->currentLine[$cursor]; - ++$cursor; - - do { - $this->consumeWhitespaces($cursor); - - while (isset($this->currentLine[$cursor])) { - switch ($this->currentLine[$cursor]) { - case '"': - case "'": - $value .= $this->lexInlineQuotedString($cursor); - break; - case ':': - case ',': - $value .= $this->currentLine[$cursor]; - ++$cursor; - break; - case '{': - $value .= $this->lexInlineMapping($cursor); - break; - case '[': - $value .= $this->lexInlineSequence($cursor); - break; - case $closingTag: - $value .= $this->currentLine[$cursor]; - ++$cursor; - - return $value; - case '#': - break 2; - default: - $value .= $this->lexUnquotedString($cursor); - } - - if ($this->consumeWhitespaces($cursor)) { - $value .= ' '; - } - } - - if ($this->hasMoreLines()) { - $cursor = 0; - } - } while ($this->moveToNextLine()); - - throw new ParseException('Malformed inline YAML string.'); - } - - private function consumeWhitespaces(int &$cursor): bool - { - $whitespacesConsumed = 0; - - do { - $whitespaceOnlyTokenLength = strspn($this->currentLine, ' ', $cursor); - $whitespacesConsumed += $whitespaceOnlyTokenLength; - $cursor += $whitespaceOnlyTokenLength; - - if (isset($this->currentLine[$cursor])) { - return 0 < $whitespacesConsumed; - } - - if ($this->hasMoreLines()) { - $cursor = 0; - } - } while ($this->moveToNextLine()); - - return 0 < $whitespacesConsumed; - } -} diff --git a/system/vendor/symfony/yaml/README.md b/system/vendor/symfony/yaml/README.md deleted file mode 100644 index ac25024..0000000 --- a/system/vendor/symfony/yaml/README.md +++ /dev/null @@ -1,13 +0,0 @@ -Yaml Component -============== - -The Yaml component loads and dumps YAML files. - -Resources ---------- - - * [Documentation](https://symfony.com/doc/current/components/yaml.html) - * [Contributing](https://symfony.com/doc/current/contributing/index.html) - * [Report issues](https://github.com/symfony/symfony/issues) and - [send Pull Requests](https://github.com/symfony/symfony/pulls) - in the [main Symfony repository](https://github.com/symfony/symfony) diff --git a/system/vendor/symfony/yaml/Resources/bin/yaml-lint b/system/vendor/symfony/yaml/Resources/bin/yaml-lint deleted file mode 100644 index 143869e..0000000 --- a/system/vendor/symfony/yaml/Resources/bin/yaml-lint +++ /dev/null @@ -1,49 +0,0 @@ -#!/usr/bin/env php - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -if ('cli' !== \PHP_SAPI) { - throw new Exception('This script must be run from the command line.'); -} - -/** - * Runs the Yaml lint command. - * - * @author Jan Schädlich - */ - -use Symfony\Component\Console\Application; -use Symfony\Component\Yaml\Command\LintCommand; - -function includeIfExists(string $file): bool -{ - return file_exists($file) && include $file; -} - -if ( - !includeIfExists(__DIR__ . '/../../../../autoload.php') && - !includeIfExists(__DIR__ . '/../../vendor/autoload.php') && - !includeIfExists(__DIR__ . '/../../../../../../vendor/autoload.php') -) { - fwrite(STDERR, 'Install dependencies using Composer.'.PHP_EOL); - exit(1); -} - -if (!class_exists(Application::class)) { - fwrite(STDERR, 'You need the "symfony/console" component in order to run the Yaml linter.'.PHP_EOL); - exit(1); -} - -(new Application())->add($command = new LintCommand()) - ->getApplication() - ->setDefaultCommand($command->getName(), true) - ->run() -; diff --git a/system/vendor/symfony/yaml/Tag/TaggedValue.php b/system/vendor/symfony/yaml/Tag/TaggedValue.php deleted file mode 100644 index 4ea3406..0000000 --- a/system/vendor/symfony/yaml/Tag/TaggedValue.php +++ /dev/null @@ -1,38 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Yaml\Tag; - -/** - * @author Nicolas Grekas - * @author Guilhem N. - */ -final class TaggedValue -{ - private $tag; - private $value; - - public function __construct(string $tag, $value) - { - $this->tag = $tag; - $this->value = $value; - } - - public function getTag(): string - { - return $this->tag; - } - - public function getValue() - { - return $this->value; - } -} diff --git a/system/vendor/symfony/yaml/Unescaper.php b/system/vendor/symfony/yaml/Unescaper.php deleted file mode 100644 index d1ef041..0000000 --- a/system/vendor/symfony/yaml/Unescaper.php +++ /dev/null @@ -1,132 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Yaml; - -use Symfony\Component\Yaml\Exception\ParseException; - -/** - * Unescaper encapsulates unescaping rules for single and double-quoted - * YAML strings. - * - * @author Matthew Lewinski - * - * @internal - */ -class Unescaper -{ - /** - * Regex fragment that matches an escaped character in a double quoted string. - */ - public const REGEX_ESCAPED_CHARACTER = '\\\\(x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|U[0-9a-fA-F]{8}|.)'; - - /** - * Unescapes a single quoted string. - * - * @param string $value A single quoted string - */ - public function unescapeSingleQuotedString(string $value): string - { - return str_replace('\'\'', '\'', $value); - } - - /** - * Unescapes a double quoted string. - * - * @param string $value A double quoted string - */ - public function unescapeDoubleQuotedString(string $value): string - { - $callback = function ($match) { - return $this->unescapeCharacter($match[0]); - }; - - // evaluate the string - return preg_replace_callback('/'.self::REGEX_ESCAPED_CHARACTER.'/u', $callback, $value); - } - - /** - * Unescapes a character that was found in a double-quoted string. - * - * @param string $value An escaped character - */ - private function unescapeCharacter(string $value): string - { - switch ($value[1]) { - case '0': - return "\x0"; - case 'a': - return "\x7"; - case 'b': - return "\x8"; - case 't': - return "\t"; - case "\t": - return "\t"; - case 'n': - return "\n"; - case 'v': - return "\xB"; - case 'f': - return "\xC"; - case 'r': - return "\r"; - case 'e': - return "\x1B"; - case ' ': - return ' '; - case '"': - return '"'; - case '/': - return '/'; - case '\\': - return '\\'; - case 'N': - // U+0085 NEXT LINE - return "\xC2\x85"; - case '_': - // U+00A0 NO-BREAK SPACE - return "\xC2\xA0"; - case 'L': - // U+2028 LINE SEPARATOR - return "\xE2\x80\xA8"; - case 'P': - // U+2029 PARAGRAPH SEPARATOR - return "\xE2\x80\xA9"; - case 'x': - return self::utf8chr(hexdec(substr($value, 2, 2))); - case 'u': - return self::utf8chr(hexdec(substr($value, 2, 4))); - case 'U': - return self::utf8chr(hexdec(substr($value, 2, 8))); - default: - throw new ParseException(sprintf('Found unknown escape character "%s".', $value)); - } - } - - /** - * Get the UTF-8 character for the given code point. - */ - private static function utf8chr(int $c): string - { - if (0x80 > $c %= 0x200000) { - return \chr($c); - } - if (0x800 > $c) { - return \chr(0xC0 | $c >> 6).\chr(0x80 | $c & 0x3F); - } - if (0x10000 > $c) { - return \chr(0xE0 | $c >> 12).\chr(0x80 | $c >> 6 & 0x3F).\chr(0x80 | $c & 0x3F); - } - - return \chr(0xF0 | $c >> 18).\chr(0x80 | $c >> 12 & 0x3F).\chr(0x80 | $c >> 6 & 0x3F).\chr(0x80 | $c & 0x3F); - } -} diff --git a/system/vendor/symfony/yaml/Yaml.php b/system/vendor/symfony/yaml/Yaml.php deleted file mode 100644 index ea13045..0000000 --- a/system/vendor/symfony/yaml/Yaml.php +++ /dev/null @@ -1,100 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Yaml; - -use Symfony\Component\Yaml\Exception\ParseException; - -/** - * Yaml offers convenience methods to load and dump YAML. - * - * @author Fabien Potencier - * - * @final - */ -class Yaml -{ - public const DUMP_OBJECT = 1; - public const PARSE_EXCEPTION_ON_INVALID_TYPE = 2; - public const PARSE_OBJECT = 4; - public const PARSE_OBJECT_FOR_MAP = 8; - public const DUMP_EXCEPTION_ON_INVALID_TYPE = 16; - public const PARSE_DATETIME = 32; - public const DUMP_OBJECT_AS_MAP = 64; - public const DUMP_MULTI_LINE_LITERAL_BLOCK = 128; - public const PARSE_CONSTANT = 256; - public const PARSE_CUSTOM_TAGS = 512; - public const DUMP_EMPTY_ARRAY_AS_SEQUENCE = 1024; - public const DUMP_NULL_AS_TILDE = 2048; - - /** - * Parses a YAML file into a PHP value. - * - * Usage: - * - * $array = Yaml::parseFile('config.yml'); - * print_r($array); - * - * @param string $filename The path to the YAML file to be parsed - * @param int $flags A bit field of PARSE_* constants to customize the YAML parser behavior - * - * @return mixed - * - * @throws ParseException If the file could not be read or the YAML is not valid - */ - public static function parseFile(string $filename, int $flags = 0) - { - $yaml = new Parser(); - - return $yaml->parseFile($filename, $flags); - } - - /** - * Parses YAML into a PHP value. - * - * Usage: - * - * $array = Yaml::parse(file_get_contents('config.yml')); - * print_r($array); - * - * - * @param string $input A string containing YAML - * @param int $flags A bit field of PARSE_* constants to customize the YAML parser behavior - * - * @return mixed - * - * @throws ParseException If the YAML is not valid - */ - public static function parse(string $input, int $flags = 0) - { - $yaml = new Parser(); - - return $yaml->parse($input, $flags); - } - - /** - * Dumps a PHP value to a YAML string. - * - * The dump method, when supplied with an array, will do its best - * to convert the array into friendly YAML. - * - * @param mixed $input The PHP value - * @param int $inline The level where you switch to inline YAML - * @param int $indent The amount of spaces to use for indentation of nested nodes - * @param int $flags A bit field of DUMP_* constants to customize the dumped YAML string - */ - public static function dump($input, int $inline = 2, int $indent = 4, int $flags = 0): string - { - $yaml = new Dumper($indent); - - return $yaml->dump($input, $inline, 0, $flags); - } -} diff --git a/system/vendor/symfony/yaml/composer.json b/system/vendor/symfony/yaml/composer.json deleted file mode 100644 index 7fa6e2c..0000000 --- a/system/vendor/symfony/yaml/composer.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "name": "symfony/yaml", - "type": "library", - "description": "Loads and dumps YAML files", - "keywords": [], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-ctype": "^1.8" - }, - "require-dev": { - "symfony/console": "^5.3|^6.0" - }, - "conflict": { - "symfony/console": "<5.3" - }, - "suggest": { - "symfony/console": "For validating YAML files using the lint command" - }, - "autoload": { - "psr-4": { "Symfony\\Component\\Yaml\\": "" }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "bin": [ - "Resources/bin/yaml-lint" - ], - "minimum-stability": "dev" -} diff --git a/system/vendor/twig/twig/CHANGELOG b/system/vendor/twig/twig/CHANGELOG deleted file mode 100644 index 2b8341f..0000000 --- a/system/vendor/twig/twig/CHANGELOG +++ /dev/null @@ -1,195 +0,0 @@ -# 3.8.0 (2023-11-21) - - * Catch errors thrown during template rendering - * Fix IntlExtension::formatDateTime use of date formatter prototype - * Fix premature loop exit in Security Policy lookup of allowed methods/properties - * Remove NumberFormatter::TYPE_CURRENCY (deprecated in PHP 8.3) - * Restore return type annotations - * Allow Symfony 7 packages to be installed - * Deprecate `twig_test_iterable` function. Use the native `is_iterable` instead. - -# 3.7.1 (2023-08-28) - - * Fix some phpdocs - -# 3.7.0 (2023-07-26) - - * Add support for the ...spread operator on arrays and hashes - -# 3.6.1 (2023-06-08) - - * Suppress some native return type deprecation messages - -# 3.6.0 (2023-05-03) - - * Allow psr/container 2.0 - * Add the new PHP 8.0 IntlDateFormatter::RELATIVE_* constants for date formatting - * Make the Lexer initialize itself lazily - -# 3.5.1 (2023-02-08) - - * Arrow functions passed to the "reduce" filter now accept the current key as a third argument - * Restores the leniency of the matches twig comparison - * Fix error messages in sandboxed mode for "has some" and "has every" - -# 3.5.0 (2022-12-27) - - * Make Twig\ExpressionParser non-internal - * Add "has some" and "has every" operators - * Add Compile::reset() - * Throw a better runtime error when the "matches" regexp is not valid - * Add "twig *_names" intl functions - * Fix optimizing closures callbacks - * Add a better exception when getting an undefined constant via `constant` - * Fix `if` nodes when outside of a block and with an empty body - -# 3.4.3 (2022-09-28) - - * Fix a security issue on filesystem loader (possibility to load a template outside a configured directory) - -# 3.4.2 (2022-08-12) - - * Allow inherited magic method to still run with calling class - * Fix CallExpression::reflectCallable() throwing TypeError - * Fix typo in naming (currency_code) - -# 3.4.1 (2022-05-17) - -* Fix optimizing non-public named closures - -# 3.4.0 (2022-05-22) - - * Add support for named closures - -# 3.3.10 (2022-04-06) - - * Enable bytecode invalidation when auto_reload is enabled - -# 3.3.9 (2022-03-25) - - * Fix custom escapers when using multiple Twig environments - * Add support for "constant('class', object)" - * Do not reuse internally generated variable names during parsing - -# 3.3.8 (2022-02-04) - - * Fix a security issue when in a sandbox: the `sort` filter must require a Closure for the `arrow` parameter - * Fix deprecation notice on `round` - * Fix call to deprecated `convertToHtml` method - -# 3.3.7 (2022-01-03) - -* Allow more null support when Twig expects a string (for better 8.1 support) -* Only use Commonmark extensions if markdown enabled - -# 3.3.6 (2022-01-03) - -* Only use Commonmark extensions if markdown enabled - -# 3.3.5 (2022-01-03) - -* Allow CommonMark extensions to easily be added -* Allow null when Twig expects a string (for better 8.1 support) -* Make some performance optimizations -* Allow Symfony translation contract v3+ - -# 3.3.4 (2021-11-25) - - * Bump minimum supported Symfony component versions - * Fix a deprecated message - -# 3.3.3 (2021-09-17) - - * Allow Symfony 6 - * Improve compatibility with PHP 8.1 - * Explicitly specify the encoding for mb_ord in JS escaper - -# 3.3.2 (2021-05-16) - - * Revert "Throw a proper exception when a template name is an absolute path (as it has never been supported)" - -# 3.3.1 (2021-05-12) - - * Fix PHP 8.1 compatibility - * Throw a proper exception when a template name is an absolute path (as it has never been supported) - -# 3.3.0 (2021-02-08) - - * Fix macro calls in a "cache" tag - * Add the slug filter - * Allow extra bundle to be compatible with Twig 2 - -# 3.2.1 (2021-01-05) - - * Fix extra bundle compat with older versions of Symfony - -# 3.2.0 (2021-01-05) - - * Add the Cache extension in the "extra" repositories: "cache" tag - * Add "registerUndefinedTokenParserCallback" - * Mark built-in node visitors as @internal - * Fix "odd" not working for negative numbers - -# 3.1.1 (2020-10-27) - - * Fix "include(template_from_string())" - -# 3.1.0 (2020-10-21) - - * Fix sandbox support when using "include(template_from_string())" - * Make round brackets optional for one argument tests like "same as" or "divisible by" - * Add support for ES2015 style object initialisation shortcut { a } is the same as { 'a': a } - -# 3.0.5 (2020-08-05) - - * Fix twig_compare w.r.t. whitespace trimming - * Fix sandbox not disabled if syntax error occurs within {% sandbox %} tag - * Fix a regression when not using a space before an operator - * Restrict callables to closures in filters - * Allow trailing commas in argument lists (in calls as well as definitions) - -# 3.0.4 (2020-07-05) - - * Fix comparison operators - * Fix options not taken into account when using "Michelf\MarkdownExtra" - * Fix "Twig\Extra\Intl\IntlExtension::getCountryName()" to accept "null" as a first argument - * Throw exception in case non-Traversable data is passed to "filter" - * Fix context optimization on PHP 7.4 - * Fix PHP 8 compatibility - * Fix ambiguous syntax parsing - -# 3.0.3 (2020-02-11) - - * Add a check to ensure that iconv() is defined - -# 3.0.2 (2020-02-11) - - * Avoid exceptions when an intl resource is not found - * Fix implementation of case-insensitivity for method names - -# 3.0.1 (2019-12-28) - - * fixed Symfony 5.0 support for the HTML extra extension - -# 3.0.0 (2019-11-15) - - * fixed number formatter in Intl extra extension when using a formatter prototype - -# 3.0.0-BETA1 (2019-11-11) - - * removed the "if" condition support on the "for" tag - * made the in, <, >, <=, >=, ==, and != operators more strict when comparing strings and integers/floats - * removed the "filter" tag - * added type hints everywhere - * changed Environment::resolveTemplate() to always return a TemplateWrapper instance - * removed Template::__toString() - * removed Parser::isReservedMacroName() - * removed SanboxedPrintNode - * removed Node::setTemplateName() - * made classes maked as "@final" final - * removed InitRuntimeInterface, ExistsLoaderInterface, and SourceContextLoaderInterface - * removed the "spaceless" tag - * removed Twig\Environment::getBaseTemplateClass() and Twig\Environment::setBaseTemplateClass() - * removed the "base_template_class" option on Twig\Environment - * bumped minimum PHP version to 7.2 - * removed PSR-0 classes diff --git a/system/vendor/twig/twig/LICENSE b/system/vendor/twig/twig/LICENSE deleted file mode 100644 index fd8234e..0000000 --- a/system/vendor/twig/twig/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2009-present by the Twig Team. - -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of Twig nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/system/vendor/twig/twig/README.rst b/system/vendor/twig/twig/README.rst deleted file mode 100644 index fbe7e9a..0000000 --- a/system/vendor/twig/twig/README.rst +++ /dev/null @@ -1,23 +0,0 @@ -Twig, the flexible, fast, and secure template language for PHP -============================================================== - -Twig is a template language for PHP. - -Twig uses a syntax similar to the Django and Jinja template languages which -inspired the Twig runtime environment. - -Sponsors --------- - -.. raw:: html - - - Blackfire.io - - -More Information ----------------- - -Read the `documentation`_ for more information. - -.. _documentation: https://twig.symfony.com/documentation diff --git a/system/vendor/twig/twig/composer.json b/system/vendor/twig/twig/composer.json deleted file mode 100644 index 1b1726f..0000000 --- a/system/vendor/twig/twig/composer.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "name": "twig/twig", - "type": "library", - "description": "Twig, the flexible, fast, and secure template language for PHP", - "keywords": ["templating"], - "homepage": "https://twig.symfony.com", - "license": "BSD-3-Clause", - "minimum-stability": "dev", - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" - }, - { - "name": "Twig Team", - "role": "Contributors" - }, - { - "name": "Armin Ronacher", - "email": "armin.ronacher@active-4.com", - "role": "Project Founder" - } - ], - "require": { - "php": ">=7.2.5", - "symfony/polyfill-php80": "^1.22", - "symfony/polyfill-mbstring": "^1.3", - "symfony/polyfill-ctype": "^1.8" - }, - "require-dev": { - "symfony/phpunit-bridge": "^5.4.9|^6.3|^7.0", - "psr/container": "^1.0|^2.0" - }, - "autoload": { - "psr-4" : { - "Twig\\" : "src/" - } - }, - "autoload-dev": { - "psr-4" : { - "Twig\\Tests\\" : "tests/" - } - } -} diff --git a/system/vendor/twig/twig/src/Cache/CacheInterface.php b/system/vendor/twig/twig/src/Cache/CacheInterface.php deleted file mode 100644 index 6e8c409..0000000 --- a/system/vendor/twig/twig/src/Cache/CacheInterface.php +++ /dev/null @@ -1,46 +0,0 @@ - - */ -interface CacheInterface -{ - /** - * Generates a cache key for the given template class name. - */ - public function generateKey(string $name, string $className): string; - - /** - * Writes the compiled template to cache. - * - * @param string $content The template representation as a PHP class - */ - public function write(string $key, string $content): void; - - /** - * Loads a template from the cache. - */ - public function load(string $key): void; - - /** - * Returns the modification timestamp of a key. - */ - public function getTimestamp(string $key): int; -} diff --git a/system/vendor/twig/twig/src/Cache/FilesystemCache.php b/system/vendor/twig/twig/src/Cache/FilesystemCache.php deleted file mode 100644 index 4024adb..0000000 --- a/system/vendor/twig/twig/src/Cache/FilesystemCache.php +++ /dev/null @@ -1,87 +0,0 @@ - - */ -class FilesystemCache implements CacheInterface -{ - public const FORCE_BYTECODE_INVALIDATION = 1; - - private $directory; - private $options; - - public function __construct(string $directory, int $options = 0) - { - $this->directory = rtrim($directory, '\/').'/'; - $this->options = $options; - } - - public function generateKey(string $name, string $className): string - { - $hash = hash(\PHP_VERSION_ID < 80100 ? 'sha256' : 'xxh128', $className); - - return $this->directory.$hash[0].$hash[1].'/'.$hash.'.php'; - } - - public function load(string $key): void - { - if (is_file($key)) { - @include_once $key; - } - } - - public function write(string $key, string $content): void - { - $dir = \dirname($key); - if (!is_dir($dir)) { - if (false === @mkdir($dir, 0777, true)) { - clearstatcache(true, $dir); - if (!is_dir($dir)) { - throw new \RuntimeException(sprintf('Unable to create the cache directory (%s).', $dir)); - } - } - } elseif (!is_writable($dir)) { - throw new \RuntimeException(sprintf('Unable to write in the cache directory (%s).', $dir)); - } - - $tmpFile = tempnam($dir, basename($key)); - if (false !== @file_put_contents($tmpFile, $content) && @rename($tmpFile, $key)) { - @chmod($key, 0666 & ~umask()); - - if (self::FORCE_BYTECODE_INVALIDATION == ($this->options & self::FORCE_BYTECODE_INVALIDATION)) { - // Compile cached file into bytecode cache - if (\function_exists('opcache_invalidate') && filter_var(\ini_get('opcache.enable'), \FILTER_VALIDATE_BOOLEAN)) { - @opcache_invalidate($key, true); - } elseif (\function_exists('apc_compile_file')) { - apc_compile_file($key); - } - } - - return; - } - - throw new \RuntimeException(sprintf('Failed to write cache file "%s".', $key)); - } - - public function getTimestamp(string $key): int - { - if (!is_file($key)) { - return 0; - } - - return (int) @filemtime($key); - } -} diff --git a/system/vendor/twig/twig/src/Cache/NullCache.php b/system/vendor/twig/twig/src/Cache/NullCache.php deleted file mode 100644 index 8d20d59..0000000 --- a/system/vendor/twig/twig/src/Cache/NullCache.php +++ /dev/null @@ -1,38 +0,0 @@ - - */ -final class NullCache implements CacheInterface -{ - public function generateKey(string $name, string $className): string - { - return ''; - } - - public function write(string $key, string $content): void - { - } - - public function load(string $key): void - { - } - - public function getTimestamp(string $key): int - { - return 0; - } -} diff --git a/system/vendor/twig/twig/src/Compiler.php b/system/vendor/twig/twig/src/Compiler.php deleted file mode 100644 index eb652c6..0000000 --- a/system/vendor/twig/twig/src/Compiler.php +++ /dev/null @@ -1,223 +0,0 @@ - - */ -class Compiler -{ - private $lastLine; - private $source; - private $indentation; - private $env; - private $debugInfo = []; - private $sourceOffset; - private $sourceLine; - private $varNameSalt = 0; - - public function __construct(Environment $env) - { - $this->env = $env; - } - - public function getEnvironment(): Environment - { - return $this->env; - } - - public function getSource(): string - { - return $this->source; - } - - /** - * @return $this - */ - public function reset(int $indentation = 0) - { - $this->lastLine = null; - $this->source = ''; - $this->debugInfo = []; - $this->sourceOffset = 0; - // source code starts at 1 (as we then increment it when we encounter new lines) - $this->sourceLine = 1; - $this->indentation = $indentation; - $this->varNameSalt = 0; - - return $this; - } - - /** - * @return $this - */ - public function compile(Node $node, int $indentation = 0) - { - $this->reset($indentation); - $node->compile($this); - - return $this; - } - - /** - * @return $this - */ - public function subcompile(Node $node, bool $raw = true) - { - if (false === $raw) { - $this->source .= str_repeat(' ', $this->indentation * 4); - } - - $node->compile($this); - - return $this; - } - - /** - * Adds a raw string to the compiled code. - * - * @return $this - */ - public function raw(string $string) - { - $this->source .= $string; - - return $this; - } - - /** - * Writes a string to the compiled code by adding indentation. - * - * @return $this - */ - public function write(...$strings) - { - foreach ($strings as $string) { - $this->source .= str_repeat(' ', $this->indentation * 4).$string; - } - - return $this; - } - - /** - * Adds a quoted string to the compiled code. - * - * @return $this - */ - public function string(string $value) - { - $this->source .= sprintf('"%s"', addcslashes($value, "\0\t\"\$\\")); - - return $this; - } - - /** - * Returns a PHP representation of a given value. - * - * @return $this - */ - public function repr($value) - { - if (\is_int($value) || \is_float($value)) { - if (false !== $locale = setlocale(\LC_NUMERIC, '0')) { - setlocale(\LC_NUMERIC, 'C'); - } - - $this->raw(var_export($value, true)); - - if (false !== $locale) { - setlocale(\LC_NUMERIC, $locale); - } - } elseif (null === $value) { - $this->raw('null'); - } elseif (\is_bool($value)) { - $this->raw($value ? 'true' : 'false'); - } elseif (\is_array($value)) { - $this->raw('array('); - $first = true; - foreach ($value as $key => $v) { - if (!$first) { - $this->raw(', '); - } - $first = false; - $this->repr($key); - $this->raw(' => '); - $this->repr($v); - } - $this->raw(')'); - } else { - $this->string($value); - } - - return $this; - } - - /** - * @return $this - */ - public function addDebugInfo(Node $node) - { - if ($node->getTemplateLine() != $this->lastLine) { - $this->write(sprintf("// line %d\n", $node->getTemplateLine())); - - $this->sourceLine += substr_count($this->source, "\n", $this->sourceOffset); - $this->sourceOffset = \strlen($this->source); - $this->debugInfo[$this->sourceLine] = $node->getTemplateLine(); - - $this->lastLine = $node->getTemplateLine(); - } - - return $this; - } - - public function getDebugInfo(): array - { - ksort($this->debugInfo); - - return $this->debugInfo; - } - - /** - * @return $this - */ - public function indent(int $step = 1) - { - $this->indentation += $step; - - return $this; - } - - /** - * @return $this - * - * @throws \LogicException When trying to outdent too much so the indentation would become negative - */ - public function outdent(int $step = 1) - { - // can't outdent by more steps than the current indentation level - if ($this->indentation < $step) { - throw new \LogicException('Unable to call outdent() as the indentation would become negative.'); - } - - $this->indentation -= $step; - - return $this; - } - - public function getVarName(): string - { - return sprintf('__internal_compile_%d', $this->varNameSalt++); - } -} diff --git a/system/vendor/twig/twig/src/Environment.php b/system/vendor/twig/twig/src/Environment.php deleted file mode 100644 index d7d51cd..0000000 --- a/system/vendor/twig/twig/src/Environment.php +++ /dev/null @@ -1,840 +0,0 @@ - - */ -class Environment -{ - public const VERSION = '3.8.0'; - public const VERSION_ID = 30800; - public const MAJOR_VERSION = 3; - public const MINOR_VERSION = 8; - public const RELEASE_VERSION = 0; - public const EXTRA_VERSION = ''; - - private $charset; - private $loader; - private $debug; - private $autoReload; - private $cache; - private $lexer; - private $parser; - private $compiler; - /** @var array */ - private $globals = []; - private $resolvedGlobals; - private $loadedTemplates; - private $strictVariables; - private $templateClassPrefix = '__TwigTemplate_'; - private $originalCache; - private $extensionSet; - private $runtimeLoaders = []; - private $runtimes = []; - private $optionsHash; - - /** - * Constructor. - * - * Available options: - * - * * debug: When set to true, it automatically set "auto_reload" to true as - * well (default to false). - * - * * charset: The charset used by the templates (default to UTF-8). - * - * * cache: An absolute path where to store the compiled templates, - * a \Twig\Cache\CacheInterface implementation, - * or false to disable compilation cache (default). - * - * * auto_reload: Whether to reload the template if the original source changed. - * If you don't provide the auto_reload option, it will be - * determined automatically based on the debug value. - * - * * strict_variables: Whether to ignore invalid variables in templates - * (default to false). - * - * * autoescape: Whether to enable auto-escaping (default to html): - * * false: disable auto-escaping - * * html, js: set the autoescaping to one of the supported strategies - * * name: set the autoescaping strategy based on the template name extension - * * PHP callback: a PHP callback that returns an escaping strategy based on the template "name" - * - * * optimizations: A flag that indicates which optimizations to apply - * (default to -1 which means that all optimizations are enabled; - * set it to 0 to disable). - */ - public function __construct(LoaderInterface $loader, $options = []) - { - $this->setLoader($loader); - - $options = array_merge([ - 'debug' => false, - 'charset' => 'UTF-8', - 'strict_variables' => false, - 'autoescape' => 'html', - 'cache' => false, - 'auto_reload' => null, - 'optimizations' => -1, - ], $options); - - $this->debug = (bool) $options['debug']; - $this->setCharset($options['charset'] ?? 'UTF-8'); - $this->autoReload = null === $options['auto_reload'] ? $this->debug : (bool) $options['auto_reload']; - $this->strictVariables = (bool) $options['strict_variables']; - $this->setCache($options['cache']); - $this->extensionSet = new ExtensionSet(); - - $this->addExtension(new CoreExtension()); - $this->addExtension(new EscaperExtension($options['autoescape'])); - $this->addExtension(new OptimizerExtension($options['optimizations'])); - } - - /** - * Enables debugging mode. - */ - public function enableDebug() - { - $this->debug = true; - $this->updateOptionsHash(); - } - - /** - * Disables debugging mode. - */ - public function disableDebug() - { - $this->debug = false; - $this->updateOptionsHash(); - } - - /** - * Checks if debug mode is enabled. - * - * @return bool true if debug mode is enabled, false otherwise - */ - public function isDebug() - { - return $this->debug; - } - - /** - * Enables the auto_reload option. - */ - public function enableAutoReload() - { - $this->autoReload = true; - } - - /** - * Disables the auto_reload option. - */ - public function disableAutoReload() - { - $this->autoReload = false; - } - - /** - * Checks if the auto_reload option is enabled. - * - * @return bool true if auto_reload is enabled, false otherwise - */ - public function isAutoReload() - { - return $this->autoReload; - } - - /** - * Enables the strict_variables option. - */ - public function enableStrictVariables() - { - $this->strictVariables = true; - $this->updateOptionsHash(); - } - - /** - * Disables the strict_variables option. - */ - public function disableStrictVariables() - { - $this->strictVariables = false; - $this->updateOptionsHash(); - } - - /** - * Checks if the strict_variables option is enabled. - * - * @return bool true if strict_variables is enabled, false otherwise - */ - public function isStrictVariables() - { - return $this->strictVariables; - } - - /** - * Gets the current cache implementation. - * - * @param bool $original Whether to return the original cache option or the real cache instance - * - * @return CacheInterface|string|false A Twig\Cache\CacheInterface implementation, - * an absolute path to the compiled templates, - * or false to disable cache - */ - public function getCache($original = true) - { - return $original ? $this->originalCache : $this->cache; - } - - /** - * Sets the current cache implementation. - * - * @param CacheInterface|string|false $cache A Twig\Cache\CacheInterface implementation, - * an absolute path to the compiled templates, - * or false to disable cache - */ - public function setCache($cache) - { - if (\is_string($cache)) { - $this->originalCache = $cache; - $this->cache = new FilesystemCache($cache, $this->autoReload ? FilesystemCache::FORCE_BYTECODE_INVALIDATION : 0); - } elseif (false === $cache) { - $this->originalCache = $cache; - $this->cache = new NullCache(); - } elseif ($cache instanceof CacheInterface) { - $this->originalCache = $this->cache = $cache; - } else { - throw new \LogicException('Cache can only be a string, false, or a \Twig\Cache\CacheInterface implementation.'); - } - } - - /** - * Gets the template class associated with the given string. - * - * The generated template class is based on the following parameters: - * - * * The cache key for the given template; - * * The currently enabled extensions; - * * Whether the Twig C extension is available or not; - * * PHP version; - * * Twig version; - * * Options with what environment was created. - * - * @param string $name The name for which to calculate the template class name - * @param int|null $index The index if it is an embedded template - * - * @internal - */ - public function getTemplateClass(string $name, int $index = null): string - { - $key = $this->getLoader()->getCacheKey($name).$this->optionsHash; - - return $this->templateClassPrefix.hash(\PHP_VERSION_ID < 80100 ? 'sha256' : 'xxh128', $key).(null === $index ? '' : '___'.$index); - } - - /** - * Renders a template. - * - * @param string|TemplateWrapper $name The template name - * - * @throws LoaderError When the template cannot be found - * @throws SyntaxError When an error occurred during compilation - * @throws RuntimeError When an error occurred during rendering - */ - public function render($name, array $context = []): string - { - return $this->load($name)->render($context); - } - - /** - * Displays a template. - * - * @param string|TemplateWrapper $name The template name - * - * @throws LoaderError When the template cannot be found - * @throws SyntaxError When an error occurred during compilation - * @throws RuntimeError When an error occurred during rendering - */ - public function display($name, array $context = []): void - { - $this->load($name)->display($context); - } - - /** - * Loads a template. - * - * @param string|TemplateWrapper $name The template name - * - * @throws LoaderError When the template cannot be found - * @throws RuntimeError When a previously generated cache is corrupted - * @throws SyntaxError When an error occurred during compilation - */ - public function load($name): TemplateWrapper - { - if ($name instanceof TemplateWrapper) { - return $name; - } - - return new TemplateWrapper($this, $this->loadTemplate($this->getTemplateClass($name), $name)); - } - - /** - * Loads a template internal representation. - * - * This method is for internal use only and should never be called - * directly. - * - * @param string $name The template name - * @param int $index The index if it is an embedded template - * - * @throws LoaderError When the template cannot be found - * @throws RuntimeError When a previously generated cache is corrupted - * @throws SyntaxError When an error occurred during compilation - * - * @internal - */ - public function loadTemplate(string $cls, string $name, int $index = null): Template - { - $mainCls = $cls; - if (null !== $index) { - $cls .= '___'.$index; - } - - if (isset($this->loadedTemplates[$cls])) { - return $this->loadedTemplates[$cls]; - } - - if (!class_exists($cls, false)) { - $key = $this->cache->generateKey($name, $mainCls); - - if (!$this->isAutoReload() || $this->isTemplateFresh($name, $this->cache->getTimestamp($key))) { - $this->cache->load($key); - } - - if (!class_exists($cls, false)) { - $source = $this->getLoader()->getSourceContext($name); - $content = $this->compileSource($source); - $this->cache->write($key, $content); - $this->cache->load($key); - - if (!class_exists($mainCls, false)) { - /* Last line of defense if either $this->bcWriteCacheFile was used, - * $this->cache is implemented as a no-op or we have a race condition - * where the cache was cleared between the above calls to write to and load from - * the cache. - */ - eval('?>'.$content); - } - - if (!class_exists($cls, false)) { - throw new RuntimeError(sprintf('Failed to load Twig template "%s", index "%s": cache might be corrupted.', $name, $index), -1, $source); - } - } - } - - $this->extensionSet->initRuntime(); - - return $this->loadedTemplates[$cls] = new $cls($this); - } - - /** - * Creates a template from source. - * - * This method should not be used as a generic way to load templates. - * - * @param string $template The template source - * @param string $name An optional name of the template to be used in error messages - * - * @throws LoaderError When the template cannot be found - * @throws SyntaxError When an error occurred during compilation - */ - public function createTemplate(string $template, string $name = null): TemplateWrapper - { - $hash = hash(\PHP_VERSION_ID < 80100 ? 'sha256' : 'xxh128', $template, false); - if (null !== $name) { - $name = sprintf('%s (string template %s)', $name, $hash); - } else { - $name = sprintf('__string_template__%s', $hash); - } - - $loader = new ChainLoader([ - new ArrayLoader([$name => $template]), - $current = $this->getLoader(), - ]); - - $this->setLoader($loader); - try { - return new TemplateWrapper($this, $this->loadTemplate($this->getTemplateClass($name), $name)); - } finally { - $this->setLoader($current); - } - } - - /** - * Returns true if the template is still fresh. - * - * Besides checking the loader for freshness information, - * this method also checks if the enabled extensions have - * not changed. - * - * @param int $time The last modification time of the cached template - */ - public function isTemplateFresh(string $name, int $time): bool - { - return $this->extensionSet->getLastModified() <= $time && $this->getLoader()->isFresh($name, $time); - } - - /** - * Tries to load a template consecutively from an array. - * - * Similar to load() but it also accepts instances of \Twig\Template and - * \Twig\TemplateWrapper, and an array of templates where each is tried to be loaded. - * - * @param string|TemplateWrapper|array $names A template or an array of templates to try consecutively - * - * @throws LoaderError When none of the templates can be found - * @throws SyntaxError When an error occurred during compilation - */ - public function resolveTemplate($names): TemplateWrapper - { - if (!\is_array($names)) { - return $this->load($names); - } - - $count = \count($names); - foreach ($names as $name) { - if ($name instanceof Template) { - return $name; - } - if ($name instanceof TemplateWrapper) { - return $name; - } - - if (1 !== $count && !$this->getLoader()->exists($name)) { - continue; - } - - return $this->load($name); - } - - throw new LoaderError(sprintf('Unable to find one of the following templates: "%s".', implode('", "', $names))); - } - - public function setLexer(Lexer $lexer) - { - $this->lexer = $lexer; - } - - /** - * @throws SyntaxError When the code is syntactically wrong - */ - public function tokenize(Source $source): TokenStream - { - if (null === $this->lexer) { - $this->lexer = new Lexer($this); - } - - return $this->lexer->tokenize($source); - } - - public function setParser(Parser $parser) - { - $this->parser = $parser; - } - - /** - * Converts a token stream to a node tree. - * - * @throws SyntaxError When the token stream is syntactically or semantically wrong - */ - public function parse(TokenStream $stream): ModuleNode - { - if (null === $this->parser) { - $this->parser = new Parser($this); - } - - return $this->parser->parse($stream); - } - - public function setCompiler(Compiler $compiler) - { - $this->compiler = $compiler; - } - - /** - * Compiles a node and returns the PHP code. - */ - public function compile(Node $node): string - { - if (null === $this->compiler) { - $this->compiler = new Compiler($this); - } - - return $this->compiler->compile($node)->getSource(); - } - - /** - * Compiles a template source code. - * - * @throws SyntaxError When there was an error during tokenizing, parsing or compiling - */ - public function compileSource(Source $source): string - { - try { - return $this->compile($this->parse($this->tokenize($source))); - } catch (Error $e) { - $e->setSourceContext($source); - throw $e; - } catch (\Exception $e) { - throw new SyntaxError(sprintf('An exception has been thrown during the compilation of a template ("%s").', $e->getMessage()), -1, $source, $e); - } - } - - public function setLoader(LoaderInterface $loader) - { - $this->loader = $loader; - } - - public function getLoader(): LoaderInterface - { - return $this->loader; - } - - public function setCharset(string $charset) - { - if ('UTF8' === $charset = null === $charset ? null : strtoupper($charset)) { - // iconv on Windows requires "UTF-8" instead of "UTF8" - $charset = 'UTF-8'; - } - - $this->charset = $charset; - } - - public function getCharset(): string - { - return $this->charset; - } - - public function hasExtension(string $class): bool - { - return $this->extensionSet->hasExtension($class); - } - - public function addRuntimeLoader(RuntimeLoaderInterface $loader) - { - $this->runtimeLoaders[] = $loader; - } - - /** - * @template TExtension of ExtensionInterface - * - * @param class-string $class - * - * @return TExtension - */ - public function getExtension(string $class): ExtensionInterface - { - return $this->extensionSet->getExtension($class); - } - - /** - * Returns the runtime implementation of a Twig element (filter/function/tag/test). - * - * @template TRuntime of object - * - * @param class-string $class A runtime class name - * - * @return TRuntime The runtime implementation - * - * @throws RuntimeError When the template cannot be found - */ - public function getRuntime(string $class) - { - if (isset($this->runtimes[$class])) { - return $this->runtimes[$class]; - } - - foreach ($this->runtimeLoaders as $loader) { - if (null !== $runtime = $loader->load($class)) { - return $this->runtimes[$class] = $runtime; - } - } - - throw new RuntimeError(sprintf('Unable to load the "%s" runtime.', $class)); - } - - public function addExtension(ExtensionInterface $extension) - { - $this->extensionSet->addExtension($extension); - $this->updateOptionsHash(); - } - - /** - * @param ExtensionInterface[] $extensions An array of extensions - */ - public function setExtensions(array $extensions) - { - $this->extensionSet->setExtensions($extensions); - $this->updateOptionsHash(); - } - - /** - * @return ExtensionInterface[] An array of extensions (keys are for internal usage only and should not be relied on) - */ - public function getExtensions(): array - { - return $this->extensionSet->getExtensions(); - } - - public function addTokenParser(TokenParserInterface $parser) - { - $this->extensionSet->addTokenParser($parser); - } - - /** - * @return TokenParserInterface[] - * - * @internal - */ - public function getTokenParsers(): array - { - return $this->extensionSet->getTokenParsers(); - } - - /** - * @internal - */ - public function getTokenParser(string $name): ?TokenParserInterface - { - return $this->extensionSet->getTokenParser($name); - } - - public function registerUndefinedTokenParserCallback(callable $callable): void - { - $this->extensionSet->registerUndefinedTokenParserCallback($callable); - } - - public function addNodeVisitor(NodeVisitorInterface $visitor) - { - $this->extensionSet->addNodeVisitor($visitor); - } - - /** - * @return NodeVisitorInterface[] - * - * @internal - */ - public function getNodeVisitors(): array - { - return $this->extensionSet->getNodeVisitors(); - } - - public function addFilter(TwigFilter $filter) - { - $this->extensionSet->addFilter($filter); - } - - /** - * @internal - */ - public function getFilter(string $name): ?TwigFilter - { - return $this->extensionSet->getFilter($name); - } - - public function registerUndefinedFilterCallback(callable $callable): void - { - $this->extensionSet->registerUndefinedFilterCallback($callable); - } - - /** - * Gets the registered Filters. - * - * Be warned that this method cannot return filters defined with registerUndefinedFilterCallback. - * - * @return TwigFilter[] - * - * @see registerUndefinedFilterCallback - * - * @internal - */ - public function getFilters(): array - { - return $this->extensionSet->getFilters(); - } - - public function addTest(TwigTest $test) - { - $this->extensionSet->addTest($test); - } - - /** - * @return TwigTest[] - * - * @internal - */ - public function getTests(): array - { - return $this->extensionSet->getTests(); - } - - /** - * @internal - */ - public function getTest(string $name): ?TwigTest - { - return $this->extensionSet->getTest($name); - } - - public function addFunction(TwigFunction $function) - { - $this->extensionSet->addFunction($function); - } - - /** - * @internal - */ - public function getFunction(string $name): ?TwigFunction - { - return $this->extensionSet->getFunction($name); - } - - public function registerUndefinedFunctionCallback(callable $callable): void - { - $this->extensionSet->registerUndefinedFunctionCallback($callable); - } - - /** - * Gets registered functions. - * - * Be warned that this method cannot return functions defined with registerUndefinedFunctionCallback. - * - * @return TwigFunction[] - * - * @see registerUndefinedFunctionCallback - * - * @internal - */ - public function getFunctions(): array - { - return $this->extensionSet->getFunctions(); - } - - /** - * Registers a Global. - * - * New globals can be added before compiling or rendering a template; - * but after, you can only update existing globals. - * - * @param mixed $value The global value - */ - public function addGlobal(string $name, $value) - { - if ($this->extensionSet->isInitialized() && !\array_key_exists($name, $this->getGlobals())) { - throw new \LogicException(sprintf('Unable to add global "%s" as the runtime or the extensions have already been initialized.', $name)); - } - - if (null !== $this->resolvedGlobals) { - $this->resolvedGlobals[$name] = $value; - } else { - $this->globals[$name] = $value; - } - } - - /** - * @internal - * - * @return array - */ - public function getGlobals(): array - { - if ($this->extensionSet->isInitialized()) { - if (null === $this->resolvedGlobals) { - $this->resolvedGlobals = array_merge($this->extensionSet->getGlobals(), $this->globals); - } - - return $this->resolvedGlobals; - } - - return array_merge($this->extensionSet->getGlobals(), $this->globals); - } - - public function mergeGlobals(array $context): array - { - // we don't use array_merge as the context being generally - // bigger than globals, this code is faster. - foreach ($this->getGlobals() as $key => $value) { - if (!\array_key_exists($key, $context)) { - $context[$key] = $value; - } - } - - return $context; - } - - /** - * @internal - * - * @return array}> - */ - public function getUnaryOperators(): array - { - return $this->extensionSet->getUnaryOperators(); - } - - /** - * @internal - * - * @return array, associativity: ExpressionParser::OPERATOR_*}> - */ - public function getBinaryOperators(): array - { - return $this->extensionSet->getBinaryOperators(); - } - - private function updateOptionsHash(): void - { - $this->optionsHash = implode(':', [ - $this->extensionSet->getSignature(), - \PHP_MAJOR_VERSION, - \PHP_MINOR_VERSION, - self::VERSION, - (int) $this->debug, - (int) $this->strictVariables, - ]); - } -} diff --git a/system/vendor/twig/twig/src/Error/Error.php b/system/vendor/twig/twig/src/Error/Error.php deleted file mode 100644 index bca1fa6..0000000 --- a/system/vendor/twig/twig/src/Error/Error.php +++ /dev/null @@ -1,227 +0,0 @@ - - */ -class Error extends \Exception -{ - private $lineno; - private $name; - private $rawMessage; - private $sourcePath; - private $sourceCode; - - /** - * Constructor. - * - * By default, automatic guessing is enabled. - * - * @param string $message The error message - * @param int $lineno The template line where the error occurred - * @param Source|null $source The source context where the error occurred - */ - public function __construct(string $message, int $lineno = -1, Source $source = null, \Throwable $previous = null) - { - parent::__construct('', 0, $previous); - - if (null === $source) { - $name = null; - } else { - $name = $source->getName(); - $this->sourceCode = $source->getCode(); - $this->sourcePath = $source->getPath(); - } - - $this->lineno = $lineno; - $this->name = $name; - $this->rawMessage = $message; - $this->updateRepr(); - } - - public function getRawMessage(): string - { - return $this->rawMessage; - } - - public function getTemplateLine(): int - { - return $this->lineno; - } - - public function setTemplateLine(int $lineno): void - { - $this->lineno = $lineno; - - $this->updateRepr(); - } - - public function getSourceContext(): ?Source - { - return $this->name ? new Source($this->sourceCode, $this->name, $this->sourcePath) : null; - } - - public function setSourceContext(Source $source = null): void - { - if (null === $source) { - $this->sourceCode = $this->name = $this->sourcePath = null; - } else { - $this->sourceCode = $source->getCode(); - $this->name = $source->getName(); - $this->sourcePath = $source->getPath(); - } - - $this->updateRepr(); - } - - public function guess(): void - { - $this->guessTemplateInfo(); - $this->updateRepr(); - } - - public function appendMessage($rawMessage): void - { - $this->rawMessage .= $rawMessage; - $this->updateRepr(); - } - - private function updateRepr(): void - { - $this->message = $this->rawMessage; - - if ($this->sourcePath && $this->lineno > 0) { - $this->file = $this->sourcePath; - $this->line = $this->lineno; - - return; - } - - $dot = false; - if (str_ends_with($this->message, '.')) { - $this->message = substr($this->message, 0, -1); - $dot = true; - } - - $questionMark = false; - if (str_ends_with($this->message, '?')) { - $this->message = substr($this->message, 0, -1); - $questionMark = true; - } - - if ($this->name) { - if (\is_string($this->name) || (\is_object($this->name) && method_exists($this->name, '__toString'))) { - $name = sprintf('"%s"', $this->name); - } else { - $name = json_encode($this->name); - } - $this->message .= sprintf(' in %s', $name); - } - - if ($this->lineno && $this->lineno >= 0) { - $this->message .= sprintf(' at line %d', $this->lineno); - } - - if ($dot) { - $this->message .= '.'; - } - - if ($questionMark) { - $this->message .= '?'; - } - } - - private function guessTemplateInfo(): void - { - $template = null; - $templateClass = null; - - $backtrace = debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS | \DEBUG_BACKTRACE_PROVIDE_OBJECT); - foreach ($backtrace as $trace) { - if (isset($trace['object']) && $trace['object'] instanceof Template) { - $currentClass = \get_class($trace['object']); - $isEmbedContainer = null === $templateClass ? false : str_starts_with($templateClass, $currentClass); - if (null === $this->name || ($this->name == $trace['object']->getTemplateName() && !$isEmbedContainer)) { - $template = $trace['object']; - $templateClass = \get_class($trace['object']); - } - } - } - - // update template name - if (null !== $template && null === $this->name) { - $this->name = $template->getTemplateName(); - } - - // update template path if any - if (null !== $template && null === $this->sourcePath) { - $src = $template->getSourceContext(); - $this->sourceCode = $src->getCode(); - $this->sourcePath = $src->getPath(); - } - - if (null === $template || $this->lineno > -1) { - return; - } - - $r = new \ReflectionObject($template); - $file = $r->getFileName(); - - $exceptions = [$e = $this]; - while ($e = $e->getPrevious()) { - $exceptions[] = $e; - } - - while ($e = array_pop($exceptions)) { - $traces = $e->getTrace(); - array_unshift($traces, ['file' => $e->getFile(), 'line' => $e->getLine()]); - - while ($trace = array_shift($traces)) { - if (!isset($trace['file']) || !isset($trace['line']) || $file != $trace['file']) { - continue; - } - - foreach ($template->getDebugInfo() as $codeLine => $templateLine) { - if ($codeLine <= $trace['line']) { - // update template line - $this->lineno = $templateLine; - - return; - } - } - } - } - } -} diff --git a/system/vendor/twig/twig/src/Error/LoaderError.php b/system/vendor/twig/twig/src/Error/LoaderError.php deleted file mode 100644 index 7c8c23c..0000000 --- a/system/vendor/twig/twig/src/Error/LoaderError.php +++ /dev/null @@ -1,21 +0,0 @@ - - */ -class LoaderError extends Error -{ -} diff --git a/system/vendor/twig/twig/src/Error/RuntimeError.php b/system/vendor/twig/twig/src/Error/RuntimeError.php deleted file mode 100644 index f6b8476..0000000 --- a/system/vendor/twig/twig/src/Error/RuntimeError.php +++ /dev/null @@ -1,22 +0,0 @@ - - */ -class RuntimeError extends Error -{ -} diff --git a/system/vendor/twig/twig/src/Error/SyntaxError.php b/system/vendor/twig/twig/src/Error/SyntaxError.php deleted file mode 100644 index 77c437c..0000000 --- a/system/vendor/twig/twig/src/Error/SyntaxError.php +++ /dev/null @@ -1,46 +0,0 @@ - - */ -class SyntaxError extends Error -{ - /** - * Tweaks the error message to include suggestions. - * - * @param string $name The original name of the item that does not exist - * @param array $items An array of possible items - */ - public function addSuggestions(string $name, array $items): void - { - $alternatives = []; - foreach ($items as $item) { - $lev = levenshtein($name, $item); - if ($lev <= \strlen($name) / 3 || str_contains($item, $name)) { - $alternatives[$item] = $lev; - } - } - - if (!$alternatives) { - return; - } - - asort($alternatives); - - $this->appendMessage(sprintf(' Did you mean "%s"?', implode('", "', array_keys($alternatives)))); - } -} diff --git a/system/vendor/twig/twig/src/ExpressionParser.php b/system/vendor/twig/twig/src/ExpressionParser.php deleted file mode 100644 index 13e0f08..0000000 --- a/system/vendor/twig/twig/src/ExpressionParser.php +++ /dev/null @@ -1,841 +0,0 @@ - - */ -class ExpressionParser -{ - public const OPERATOR_LEFT = 1; - public const OPERATOR_RIGHT = 2; - - private $parser; - private $env; - /** @var array}> */ - private $unaryOperators; - /** @var array, associativity: self::OPERATOR_*}> */ - private $binaryOperators; - - public function __construct(Parser $parser, Environment $env) - { - $this->parser = $parser; - $this->env = $env; - $this->unaryOperators = $env->getUnaryOperators(); - $this->binaryOperators = $env->getBinaryOperators(); - } - - public function parseExpression($precedence = 0, $allowArrow = false) - { - if ($allowArrow && $arrow = $this->parseArrow()) { - return $arrow; - } - - $expr = $this->getPrimary(); - $token = $this->parser->getCurrentToken(); - while ($this->isBinary($token) && $this->binaryOperators[$token->getValue()]['precedence'] >= $precedence) { - $op = $this->binaryOperators[$token->getValue()]; - $this->parser->getStream()->next(); - - if ('is not' === $token->getValue()) { - $expr = $this->parseNotTestExpression($expr); - } elseif ('is' === $token->getValue()) { - $expr = $this->parseTestExpression($expr); - } elseif (isset($op['callable'])) { - $expr = $op['callable']($this->parser, $expr); - } else { - $expr1 = $this->parseExpression(self::OPERATOR_LEFT === $op['associativity'] ? $op['precedence'] + 1 : $op['precedence'], true); - $class = $op['class']; - $expr = new $class($expr, $expr1, $token->getLine()); - } - - $token = $this->parser->getCurrentToken(); - } - - if (0 === $precedence) { - return $this->parseConditionalExpression($expr); - } - - return $expr; - } - - /** - * @return ArrowFunctionExpression|null - */ - private function parseArrow() - { - $stream = $this->parser->getStream(); - - // short array syntax (one argument, no parentheses)? - if ($stream->look(1)->test(/* Token::ARROW_TYPE */ 12)) { - $line = $stream->getCurrent()->getLine(); - $token = $stream->expect(/* Token::NAME_TYPE */ 5); - $names = [new AssignNameExpression($token->getValue(), $token->getLine())]; - $stream->expect(/* Token::ARROW_TYPE */ 12); - - return new ArrowFunctionExpression($this->parseExpression(0), new Node($names), $line); - } - - // first, determine if we are parsing an arrow function by finding => (long form) - $i = 0; - if (!$stream->look($i)->test(/* Token::PUNCTUATION_TYPE */ 9, '(')) { - return null; - } - ++$i; - while (true) { - // variable name - ++$i; - if (!$stream->look($i)->test(/* Token::PUNCTUATION_TYPE */ 9, ',')) { - break; - } - ++$i; - } - if (!$stream->look($i)->test(/* Token::PUNCTUATION_TYPE */ 9, ')')) { - return null; - } - ++$i; - if (!$stream->look($i)->test(/* Token::ARROW_TYPE */ 12)) { - return null; - } - - // yes, let's parse it properly - $token = $stream->expect(/* Token::PUNCTUATION_TYPE */ 9, '('); - $line = $token->getLine(); - - $names = []; - while (true) { - $token = $stream->expect(/* Token::NAME_TYPE */ 5); - $names[] = new AssignNameExpression($token->getValue(), $token->getLine()); - - if (!$stream->nextIf(/* Token::PUNCTUATION_TYPE */ 9, ',')) { - break; - } - } - $stream->expect(/* Token::PUNCTUATION_TYPE */ 9, ')'); - $stream->expect(/* Token::ARROW_TYPE */ 12); - - return new ArrowFunctionExpression($this->parseExpression(0), new Node($names), $line); - } - - private function getPrimary(): AbstractExpression - { - $token = $this->parser->getCurrentToken(); - - if ($this->isUnary($token)) { - $operator = $this->unaryOperators[$token->getValue()]; - $this->parser->getStream()->next(); - $expr = $this->parseExpression($operator['precedence']); - $class = $operator['class']; - - return $this->parsePostfixExpression(new $class($expr, $token->getLine())); - } elseif ($token->test(/* Token::PUNCTUATION_TYPE */ 9, '(')) { - $this->parser->getStream()->next(); - $expr = $this->parseExpression(); - $this->parser->getStream()->expect(/* Token::PUNCTUATION_TYPE */ 9, ')', 'An opened parenthesis is not properly closed'); - - return $this->parsePostfixExpression($expr); - } - - return $this->parsePrimaryExpression(); - } - - private function parseConditionalExpression($expr): AbstractExpression - { - while ($this->parser->getStream()->nextIf(/* Token::PUNCTUATION_TYPE */ 9, '?')) { - if (!$this->parser->getStream()->nextIf(/* Token::PUNCTUATION_TYPE */ 9, ':')) { - $expr2 = $this->parseExpression(); - if ($this->parser->getStream()->nextIf(/* Token::PUNCTUATION_TYPE */ 9, ':')) { - // Ternary operator (expr ? expr2 : expr3) - $expr3 = $this->parseExpression(); - } else { - // Ternary without else (expr ? expr2) - $expr3 = new ConstantExpression('', $this->parser->getCurrentToken()->getLine()); - } - } else { - // Ternary without then (expr ?: expr3) - $expr2 = $expr; - $expr3 = $this->parseExpression(); - } - - $expr = new ConditionalExpression($expr, $expr2, $expr3, $this->parser->getCurrentToken()->getLine()); - } - - return $expr; - } - - private function isUnary(Token $token): bool - { - return $token->test(/* Token::OPERATOR_TYPE */ 8) && isset($this->unaryOperators[$token->getValue()]); - } - - private function isBinary(Token $token): bool - { - return $token->test(/* Token::OPERATOR_TYPE */ 8) && isset($this->binaryOperators[$token->getValue()]); - } - - public function parsePrimaryExpression() - { - $token = $this->parser->getCurrentToken(); - switch ($token->getType()) { - case /* Token::NAME_TYPE */ 5: - $this->parser->getStream()->next(); - switch ($token->getValue()) { - case 'true': - case 'TRUE': - $node = new ConstantExpression(true, $token->getLine()); - break; - - case 'false': - case 'FALSE': - $node = new ConstantExpression(false, $token->getLine()); - break; - - case 'none': - case 'NONE': - case 'null': - case 'NULL': - $node = new ConstantExpression(null, $token->getLine()); - break; - - default: - if ('(' === $this->parser->getCurrentToken()->getValue()) { - $node = $this->getFunctionNode($token->getValue(), $token->getLine()); - } else { - $node = new NameExpression($token->getValue(), $token->getLine()); - } - } - break; - - case /* Token::NUMBER_TYPE */ 6: - $this->parser->getStream()->next(); - $node = new ConstantExpression($token->getValue(), $token->getLine()); - break; - - case /* Token::STRING_TYPE */ 7: - case /* Token::INTERPOLATION_START_TYPE */ 10: - $node = $this->parseStringExpression(); - break; - - case /* Token::OPERATOR_TYPE */ 8: - if (preg_match(Lexer::REGEX_NAME, $token->getValue(), $matches) && $matches[0] == $token->getValue()) { - // in this context, string operators are variable names - $this->parser->getStream()->next(); - $node = new NameExpression($token->getValue(), $token->getLine()); - break; - } - - if (isset($this->unaryOperators[$token->getValue()])) { - $class = $this->unaryOperators[$token->getValue()]['class']; - if (!\in_array($class, [NegUnary::class, PosUnary::class])) { - throw new SyntaxError(sprintf('Unexpected unary operator "%s".', $token->getValue()), $token->getLine(), $this->parser->getStream()->getSourceContext()); - } - - $this->parser->getStream()->next(); - $expr = $this->parsePrimaryExpression(); - - $node = new $class($expr, $token->getLine()); - break; - } - - // no break - default: - if ($token->test(/* Token::PUNCTUATION_TYPE */ 9, '[')) { - $node = $this->parseArrayExpression(); - } elseif ($token->test(/* Token::PUNCTUATION_TYPE */ 9, '{')) { - $node = $this->parseHashExpression(); - } elseif ($token->test(/* Token::OPERATOR_TYPE */ 8, '=') && ('==' === $this->parser->getStream()->look(-1)->getValue() || '!=' === $this->parser->getStream()->look(-1)->getValue())) { - throw new SyntaxError(sprintf('Unexpected operator of value "%s". Did you try to use "===" or "!==" for strict comparison? Use "is same as(value)" instead.', $token->getValue()), $token->getLine(), $this->parser->getStream()->getSourceContext()); - } else { - throw new SyntaxError(sprintf('Unexpected token "%s" of value "%s".', Token::typeToEnglish($token->getType()), $token->getValue()), $token->getLine(), $this->parser->getStream()->getSourceContext()); - } - } - - return $this->parsePostfixExpression($node); - } - - public function parseStringExpression() - { - $stream = $this->parser->getStream(); - - $nodes = []; - // a string cannot be followed by another string in a single expression - $nextCanBeString = true; - while (true) { - if ($nextCanBeString && $token = $stream->nextIf(/* Token::STRING_TYPE */ 7)) { - $nodes[] = new ConstantExpression($token->getValue(), $token->getLine()); - $nextCanBeString = false; - } elseif ($stream->nextIf(/* Token::INTERPOLATION_START_TYPE */ 10)) { - $nodes[] = $this->parseExpression(); - $stream->expect(/* Token::INTERPOLATION_END_TYPE */ 11); - $nextCanBeString = true; - } else { - break; - } - } - - $expr = array_shift($nodes); - foreach ($nodes as $node) { - $expr = new ConcatBinary($expr, $node, $node->getTemplateLine()); - } - - return $expr; - } - - public function parseArrayExpression() - { - $stream = $this->parser->getStream(); - $stream->expect(/* Token::PUNCTUATION_TYPE */ 9, '[', 'An array element was expected'); - - $node = new ArrayExpression([], $stream->getCurrent()->getLine()); - $first = true; - while (!$stream->test(/* Token::PUNCTUATION_TYPE */ 9, ']')) { - if (!$first) { - $stream->expect(/* Token::PUNCTUATION_TYPE */ 9, ',', 'An array element must be followed by a comma'); - - // trailing ,? - if ($stream->test(/* Token::PUNCTUATION_TYPE */ 9, ']')) { - break; - } - } - $first = false; - - if ($stream->test(/* Token::SPREAD_TYPE */ 13)) { - $stream->next(); - $expr = $this->parseExpression(); - $expr->setAttribute('spread', true); - $node->addElement($expr); - } else { - $node->addElement($this->parseExpression()); - } - } - $stream->expect(/* Token::PUNCTUATION_TYPE */ 9, ']', 'An opened array is not properly closed'); - - return $node; - } - - public function parseHashExpression() - { - $stream = $this->parser->getStream(); - $stream->expect(/* Token::PUNCTUATION_TYPE */ 9, '{', 'A hash element was expected'); - - $node = new ArrayExpression([], $stream->getCurrent()->getLine()); - $first = true; - while (!$stream->test(/* Token::PUNCTUATION_TYPE */ 9, '}')) { - if (!$first) { - $stream->expect(/* Token::PUNCTUATION_TYPE */ 9, ',', 'A hash value must be followed by a comma'); - - // trailing ,? - if ($stream->test(/* Token::PUNCTUATION_TYPE */ 9, '}')) { - break; - } - } - $first = false; - - if ($stream->test(/* Token::SPREAD_TYPE */ 13)) { - $stream->next(); - $value = $this->parseExpression(); - $value->setAttribute('spread', true); - $node->addElement($value); - continue; - } - - // a hash key can be: - // - // * a number -- 12 - // * a string -- 'a' - // * a name, which is equivalent to a string -- a - // * an expression, which must be enclosed in parentheses -- (1 + 2) - if ($token = $stream->nextIf(/* Token::NAME_TYPE */ 5)) { - $key = new ConstantExpression($token->getValue(), $token->getLine()); - - // {a} is a shortcut for {a:a} - if ($stream->test(Token::PUNCTUATION_TYPE, [',', '}'])) { - $value = new NameExpression($key->getAttribute('value'), $key->getTemplateLine()); - $node->addElement($value, $key); - continue; - } - } elseif (($token = $stream->nextIf(/* Token::STRING_TYPE */ 7)) || $token = $stream->nextIf(/* Token::NUMBER_TYPE */ 6)) { - $key = new ConstantExpression($token->getValue(), $token->getLine()); - } elseif ($stream->test(/* Token::PUNCTUATION_TYPE */ 9, '(')) { - $key = $this->parseExpression(); - } else { - $current = $stream->getCurrent(); - - throw new SyntaxError(sprintf('A hash key must be a quoted string, a number, a name, or an expression enclosed in parentheses (unexpected token "%s" of value "%s".', Token::typeToEnglish($current->getType()), $current->getValue()), $current->getLine(), $stream->getSourceContext()); - } - - $stream->expect(/* Token::PUNCTUATION_TYPE */ 9, ':', 'A hash key must be followed by a colon (:)'); - $value = $this->parseExpression(); - - $node->addElement($value, $key); - } - $stream->expect(/* Token::PUNCTUATION_TYPE */ 9, '}', 'An opened hash is not properly closed'); - - return $node; - } - - public function parsePostfixExpression($node) - { - while (true) { - $token = $this->parser->getCurrentToken(); - if (/* Token::PUNCTUATION_TYPE */ 9 == $token->getType()) { - if ('.' == $token->getValue() || '[' == $token->getValue()) { - $node = $this->parseSubscriptExpression($node); - } elseif ('|' == $token->getValue()) { - $node = $this->parseFilterExpression($node); - } else { - break; - } - } else { - break; - } - } - - return $node; - } - - public function getFunctionNode($name, $line) - { - switch ($name) { - case 'parent': - $this->parseArguments(); - if (!\count($this->parser->getBlockStack())) { - throw new SyntaxError('Calling "parent" outside a block is forbidden.', $line, $this->parser->getStream()->getSourceContext()); - } - - if (!$this->parser->getParent() && !$this->parser->hasTraits()) { - throw new SyntaxError('Calling "parent" on a template that does not extend nor "use" another template is forbidden.', $line, $this->parser->getStream()->getSourceContext()); - } - - return new ParentExpression($this->parser->peekBlockStack(), $line); - case 'block': - $args = $this->parseArguments(); - if (\count($args) < 1) { - throw new SyntaxError('The "block" function takes one argument (the block name).', $line, $this->parser->getStream()->getSourceContext()); - } - - return new BlockReferenceExpression($args->getNode(0), \count($args) > 1 ? $args->getNode(1) : null, $line); - case 'attribute': - $args = $this->parseArguments(); - if (\count($args) < 2) { - throw new SyntaxError('The "attribute" function takes at least two arguments (the variable and the attributes).', $line, $this->parser->getStream()->getSourceContext()); - } - - return new GetAttrExpression($args->getNode(0), $args->getNode(1), \count($args) > 2 ? $args->getNode(2) : null, Template::ANY_CALL, $line); - default: - if (null !== $alias = $this->parser->getImportedSymbol('function', $name)) { - $arguments = new ArrayExpression([], $line); - foreach ($this->parseArguments() as $n) { - $arguments->addElement($n); - } - - $node = new MethodCallExpression($alias['node'], $alias['name'], $arguments, $line); - $node->setAttribute('safe', true); - - return $node; - } - - $args = $this->parseArguments(true); - $class = $this->getFunctionNodeClass($name, $line); - - return new $class($name, $args, $line); - } - } - - public function parseSubscriptExpression($node) - { - $stream = $this->parser->getStream(); - $token = $stream->next(); - $lineno = $token->getLine(); - $arguments = new ArrayExpression([], $lineno); - $type = Template::ANY_CALL; - if ('.' == $token->getValue()) { - $token = $stream->next(); - if ( - /* Token::NAME_TYPE */ 5 == $token->getType() - || - /* Token::NUMBER_TYPE */ 6 == $token->getType() - || - (/* Token::OPERATOR_TYPE */ 8 == $token->getType() && preg_match(Lexer::REGEX_NAME, $token->getValue())) - ) { - $arg = new ConstantExpression($token->getValue(), $lineno); - - if ($stream->test(/* Token::PUNCTUATION_TYPE */ 9, '(')) { - $type = Template::METHOD_CALL; - foreach ($this->parseArguments() as $n) { - $arguments->addElement($n); - } - } - } else { - throw new SyntaxError(sprintf('Expected name or number, got value "%s" of type %s.', $token->getValue(), Token::typeToEnglish($token->getType())), $lineno, $stream->getSourceContext()); - } - - if ($node instanceof NameExpression && null !== $this->parser->getImportedSymbol('template', $node->getAttribute('name'))) { - $name = $arg->getAttribute('value'); - - $node = new MethodCallExpression($node, 'macro_'.$name, $arguments, $lineno); - $node->setAttribute('safe', true); - - return $node; - } - } else { - $type = Template::ARRAY_CALL; - - // slice? - $slice = false; - if ($stream->test(/* Token::PUNCTUATION_TYPE */ 9, ':')) { - $slice = true; - $arg = new ConstantExpression(0, $token->getLine()); - } else { - $arg = $this->parseExpression(); - } - - if ($stream->nextIf(/* Token::PUNCTUATION_TYPE */ 9, ':')) { - $slice = true; - } - - if ($slice) { - if ($stream->test(/* Token::PUNCTUATION_TYPE */ 9, ']')) { - $length = new ConstantExpression(null, $token->getLine()); - } else { - $length = $this->parseExpression(); - } - - $class = $this->getFilterNodeClass('slice', $token->getLine()); - $arguments = new Node([$arg, $length]); - $filter = new $class($node, new ConstantExpression('slice', $token->getLine()), $arguments, $token->getLine()); - - $stream->expect(/* Token::PUNCTUATION_TYPE */ 9, ']'); - - return $filter; - } - - $stream->expect(/* Token::PUNCTUATION_TYPE */ 9, ']'); - } - - return new GetAttrExpression($node, $arg, $arguments, $type, $lineno); - } - - public function parseFilterExpression($node) - { - $this->parser->getStream()->next(); - - return $this->parseFilterExpressionRaw($node); - } - - public function parseFilterExpressionRaw($node, $tag = null) - { - while (true) { - $token = $this->parser->getStream()->expect(/* Token::NAME_TYPE */ 5); - - $name = new ConstantExpression($token->getValue(), $token->getLine()); - if (!$this->parser->getStream()->test(/* Token::PUNCTUATION_TYPE */ 9, '(')) { - $arguments = new Node(); - } else { - $arguments = $this->parseArguments(true, false, true); - } - - $class = $this->getFilterNodeClass($name->getAttribute('value'), $token->getLine()); - - $node = new $class($node, $name, $arguments, $token->getLine(), $tag); - - if (!$this->parser->getStream()->test(/* Token::PUNCTUATION_TYPE */ 9, '|')) { - break; - } - - $this->parser->getStream()->next(); - } - - return $node; - } - - /** - * Parses arguments. - * - * @param bool $namedArguments Whether to allow named arguments or not - * @param bool $definition Whether we are parsing arguments for a function definition - * - * @return Node - * - * @throws SyntaxError - */ - public function parseArguments($namedArguments = false, $definition = false, $allowArrow = false) - { - $args = []; - $stream = $this->parser->getStream(); - - $stream->expect(/* Token::PUNCTUATION_TYPE */ 9, '(', 'A list of arguments must begin with an opening parenthesis'); - while (!$stream->test(/* Token::PUNCTUATION_TYPE */ 9, ')')) { - if (!empty($args)) { - $stream->expect(/* Token::PUNCTUATION_TYPE */ 9, ',', 'Arguments must be separated by a comma'); - - // if the comma above was a trailing comma, early exit the argument parse loop - if ($stream->test(/* Token::PUNCTUATION_TYPE */ 9, ')')) { - break; - } - } - - if ($definition) { - $token = $stream->expect(/* Token::NAME_TYPE */ 5, null, 'An argument must be a name'); - $value = new NameExpression($token->getValue(), $this->parser->getCurrentToken()->getLine()); - } else { - $value = $this->parseExpression(0, $allowArrow); - } - - $name = null; - if ($namedArguments && $token = $stream->nextIf(/* Token::OPERATOR_TYPE */ 8, '=')) { - if (!$value instanceof NameExpression) { - throw new SyntaxError(sprintf('A parameter name must be a string, "%s" given.', \get_class($value)), $token->getLine(), $stream->getSourceContext()); - } - $name = $value->getAttribute('name'); - - if ($definition) { - $value = $this->parsePrimaryExpression(); - - if (!$this->checkConstantExpression($value)) { - throw new SyntaxError('A default value for an argument must be a constant (a boolean, a string, a number, or an array).', $token->getLine(), $stream->getSourceContext()); - } - } else { - $value = $this->parseExpression(0, $allowArrow); - } - } - - if ($definition) { - if (null === $name) { - $name = $value->getAttribute('name'); - $value = new ConstantExpression(null, $this->parser->getCurrentToken()->getLine()); - } - $args[$name] = $value; - } else { - if (null === $name) { - $args[] = $value; - } else { - $args[$name] = $value; - } - } - } - $stream->expect(/* Token::PUNCTUATION_TYPE */ 9, ')', 'A list of arguments must be closed by a parenthesis'); - - return new Node($args); - } - - public function parseAssignmentExpression() - { - $stream = $this->parser->getStream(); - $targets = []; - while (true) { - $token = $this->parser->getCurrentToken(); - if ($stream->test(/* Token::OPERATOR_TYPE */ 8) && preg_match(Lexer::REGEX_NAME, $token->getValue())) { - // in this context, string operators are variable names - $this->parser->getStream()->next(); - } else { - $stream->expect(/* Token::NAME_TYPE */ 5, null, 'Only variables can be assigned to'); - } - $value = $token->getValue(); - if (\in_array(strtr($value, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'), ['true', 'false', 'none', 'null'])) { - throw new SyntaxError(sprintf('You cannot assign a value to "%s".', $value), $token->getLine(), $stream->getSourceContext()); - } - $targets[] = new AssignNameExpression($value, $token->getLine()); - - if (!$stream->nextIf(/* Token::PUNCTUATION_TYPE */ 9, ',')) { - break; - } - } - - return new Node($targets); - } - - public function parseMultitargetExpression() - { - $targets = []; - while (true) { - $targets[] = $this->parseExpression(); - if (!$this->parser->getStream()->nextIf(/* Token::PUNCTUATION_TYPE */ 9, ',')) { - break; - } - } - - return new Node($targets); - } - - private function parseNotTestExpression(Node $node): NotUnary - { - return new NotUnary($this->parseTestExpression($node), $this->parser->getCurrentToken()->getLine()); - } - - private function parseTestExpression(Node $node): TestExpression - { - $stream = $this->parser->getStream(); - list($name, $test) = $this->getTest($node->getTemplateLine()); - - $class = $this->getTestNodeClass($test); - $arguments = null; - if ($stream->test(/* Token::PUNCTUATION_TYPE */ 9, '(')) { - $arguments = $this->parseArguments(true); - } elseif ($test->hasOneMandatoryArgument()) { - $arguments = new Node([0 => $this->parsePrimaryExpression()]); - } - - if ('defined' === $name && $node instanceof NameExpression && null !== $alias = $this->parser->getImportedSymbol('function', $node->getAttribute('name'))) { - $node = new MethodCallExpression($alias['node'], $alias['name'], new ArrayExpression([], $node->getTemplateLine()), $node->getTemplateLine()); - $node->setAttribute('safe', true); - } - - return new $class($node, $name, $arguments, $this->parser->getCurrentToken()->getLine()); - } - - private function getTest(int $line): array - { - $stream = $this->parser->getStream(); - $name = $stream->expect(/* Token::NAME_TYPE */ 5)->getValue(); - - if ($test = $this->env->getTest($name)) { - return [$name, $test]; - } - - if ($stream->test(/* Token::NAME_TYPE */ 5)) { - // try 2-words tests - $name = $name.' '.$this->parser->getCurrentToken()->getValue(); - - if ($test = $this->env->getTest($name)) { - $stream->next(); - - return [$name, $test]; - } - } - - $e = new SyntaxError(sprintf('Unknown "%s" test.', $name), $line, $stream->getSourceContext()); - $e->addSuggestions($name, array_keys($this->env->getTests())); - - throw $e; - } - - private function getTestNodeClass(TwigTest $test): string - { - if ($test->isDeprecated()) { - $stream = $this->parser->getStream(); - $message = sprintf('Twig Test "%s" is deprecated', $test->getName()); - - if ($test->getDeprecatedVersion()) { - $message .= sprintf(' since version %s', $test->getDeprecatedVersion()); - } - if ($test->getAlternative()) { - $message .= sprintf('. Use "%s" instead', $test->getAlternative()); - } - $src = $stream->getSourceContext(); - $message .= sprintf(' in %s at line %d.', $src->getPath() ?: $src->getName(), $stream->getCurrent()->getLine()); - - @trigger_error($message, \E_USER_DEPRECATED); - } - - return $test->getNodeClass(); - } - - private function getFunctionNodeClass(string $name, int $line): string - { - if (!$function = $this->env->getFunction($name)) { - $e = new SyntaxError(sprintf('Unknown "%s" function.', $name), $line, $this->parser->getStream()->getSourceContext()); - $e->addSuggestions($name, array_keys($this->env->getFunctions())); - - throw $e; - } - - if ($function->isDeprecated()) { - $message = sprintf('Twig Function "%s" is deprecated', $function->getName()); - if ($function->getDeprecatedVersion()) { - $message .= sprintf(' since version %s', $function->getDeprecatedVersion()); - } - if ($function->getAlternative()) { - $message .= sprintf('. Use "%s" instead', $function->getAlternative()); - } - $src = $this->parser->getStream()->getSourceContext(); - $message .= sprintf(' in %s at line %d.', $src->getPath() ?: $src->getName(), $line); - - @trigger_error($message, \E_USER_DEPRECATED); - } - - return $function->getNodeClass(); - } - - private function getFilterNodeClass(string $name, int $line): string - { - if (!$filter = $this->env->getFilter($name)) { - $e = new SyntaxError(sprintf('Unknown "%s" filter.', $name), $line, $this->parser->getStream()->getSourceContext()); - $e->addSuggestions($name, array_keys($this->env->getFilters())); - - throw $e; - } - - if ($filter->isDeprecated()) { - $message = sprintf('Twig Filter "%s" is deprecated', $filter->getName()); - if ($filter->getDeprecatedVersion()) { - $message .= sprintf(' since version %s', $filter->getDeprecatedVersion()); - } - if ($filter->getAlternative()) { - $message .= sprintf('. Use "%s" instead', $filter->getAlternative()); - } - $src = $this->parser->getStream()->getSourceContext(); - $message .= sprintf(' in %s at line %d.', $src->getPath() ?: $src->getName(), $line); - - @trigger_error($message, \E_USER_DEPRECATED); - } - - return $filter->getNodeClass(); - } - - // checks that the node only contains "constant" elements - private function checkConstantExpression(Node $node): bool - { - if (!($node instanceof ConstantExpression || $node instanceof ArrayExpression - || $node instanceof NegUnary || $node instanceof PosUnary - )) { - return false; - } - - foreach ($node as $n) { - if (!$this->checkConstantExpression($n)) { - return false; - } - } - - return true; - } -} diff --git a/system/vendor/twig/twig/src/Extension/AbstractExtension.php b/system/vendor/twig/twig/src/Extension/AbstractExtension.php deleted file mode 100644 index 422925f..0000000 --- a/system/vendor/twig/twig/src/Extension/AbstractExtension.php +++ /dev/null @@ -1,45 +0,0 @@ -dateFormats[0] = $format; - } - - if (null !== $dateIntervalFormat) { - $this->dateFormats[1] = $dateIntervalFormat; - } - } - - /** - * Gets the default format to be used by the date filter. - * - * @return array The default date format string and the default date interval format string - */ - public function getDateFormat() - { - return $this->dateFormats; - } - - /** - * Sets the default timezone to be used by the date filter. - * - * @param \DateTimeZone|string $timezone The default timezone string or a \DateTimeZone object - */ - public function setTimezone($timezone) - { - $this->timezone = $timezone instanceof \DateTimeZone ? $timezone : new \DateTimeZone($timezone); - } - - /** - * Gets the default timezone to be used by the date filter. - * - * @return \DateTimeZone The default timezone currently in use - */ - public function getTimezone() - { - if (null === $this->timezone) { - $this->timezone = new \DateTimeZone(date_default_timezone_get()); - } - - return $this->timezone; - } - - /** - * Sets the default format to be used by the number_format filter. - * - * @param int $decimal the number of decimal places to use - * @param string $decimalPoint the character(s) to use for the decimal point - * @param string $thousandSep the character(s) to use for the thousands separator - */ - public function setNumberFormat($decimal, $decimalPoint, $thousandSep) - { - $this->numberFormat = [$decimal, $decimalPoint, $thousandSep]; - } - - /** - * Get the default format used by the number_format filter. - * - * @return array The arguments for number_format() - */ - public function getNumberFormat() - { - return $this->numberFormat; - } - - public function getTokenParsers(): array - { - return [ - new ApplyTokenParser(), - new ForTokenParser(), - new IfTokenParser(), - new ExtendsTokenParser(), - new IncludeTokenParser(), - new BlockTokenParser(), - new UseTokenParser(), - new MacroTokenParser(), - new ImportTokenParser(), - new FromTokenParser(), - new SetTokenParser(), - new FlushTokenParser(), - new DoTokenParser(), - new EmbedTokenParser(), - new WithTokenParser(), - new DeprecatedTokenParser(), - ]; - } - - public function getFilters(): array - { - return [ - // formatting filters - new TwigFilter('date', 'twig_date_format_filter', ['needs_environment' => true]), - new TwigFilter('date_modify', 'twig_date_modify_filter', ['needs_environment' => true]), - new TwigFilter('format', 'twig_sprintf'), - new TwigFilter('replace', 'twig_replace_filter'), - new TwigFilter('number_format', 'twig_number_format_filter', ['needs_environment' => true]), - new TwigFilter('abs', 'abs'), - new TwigFilter('round', 'twig_round'), - - // encoding - new TwigFilter('url_encode', 'twig_urlencode_filter'), - new TwigFilter('json_encode', 'json_encode'), - new TwigFilter('convert_encoding', 'twig_convert_encoding'), - - // string filters - new TwigFilter('title', 'twig_title_string_filter', ['needs_environment' => true]), - new TwigFilter('capitalize', 'twig_capitalize_string_filter', ['needs_environment' => true]), - new TwigFilter('upper', 'twig_upper_filter', ['needs_environment' => true]), - new TwigFilter('lower', 'twig_lower_filter', ['needs_environment' => true]), - new TwigFilter('striptags', 'twig_striptags'), - new TwigFilter('trim', 'twig_trim_filter'), - new TwigFilter('nl2br', 'twig_nl2br', ['pre_escape' => 'html', 'is_safe' => ['html']]), - new TwigFilter('spaceless', 'twig_spaceless', ['is_safe' => ['html']]), - - // array helpers - new TwigFilter('join', 'twig_join_filter'), - new TwigFilter('split', 'twig_split_filter', ['needs_environment' => true]), - new TwigFilter('sort', 'twig_sort_filter', ['needs_environment' => true]), - new TwigFilter('merge', 'twig_array_merge'), - new TwigFilter('batch', 'twig_array_batch'), - new TwigFilter('column', 'twig_array_column'), - new TwigFilter('filter', 'twig_array_filter', ['needs_environment' => true]), - new TwigFilter('map', 'twig_array_map', ['needs_environment' => true]), - new TwigFilter('reduce', 'twig_array_reduce', ['needs_environment' => true]), - - // string/array filters - new TwigFilter('reverse', 'twig_reverse_filter', ['needs_environment' => true]), - new TwigFilter('length', 'twig_length_filter', ['needs_environment' => true]), - new TwigFilter('slice', 'twig_slice', ['needs_environment' => true]), - new TwigFilter('first', 'twig_first', ['needs_environment' => true]), - new TwigFilter('last', 'twig_last', ['needs_environment' => true]), - - // iteration and runtime - new TwigFilter('default', '_twig_default_filter', ['node_class' => DefaultFilter::class]), - new TwigFilter('keys', 'twig_get_array_keys_filter'), - ]; - } - - public function getFunctions(): array - { - return [ - new TwigFunction('max', 'max'), - new TwigFunction('min', 'min'), - new TwigFunction('range', 'range'), - new TwigFunction('constant', 'twig_constant'), - new TwigFunction('cycle', 'twig_cycle'), - new TwigFunction('random', 'twig_random', ['needs_environment' => true]), - new TwigFunction('date', 'twig_date_converter', ['needs_environment' => true]), - new TwigFunction('include', 'twig_include', ['needs_environment' => true, 'needs_context' => true, 'is_safe' => ['all']]), - new TwigFunction('source', 'twig_source', ['needs_environment' => true, 'is_safe' => ['all']]), - ]; - } - - public function getTests(): array - { - return [ - new TwigTest('even', null, ['node_class' => EvenTest::class]), - new TwigTest('odd', null, ['node_class' => OddTest::class]), - new TwigTest('defined', null, ['node_class' => DefinedTest::class]), - new TwigTest('same as', null, ['node_class' => SameasTest::class, 'one_mandatory_argument' => true]), - new TwigTest('none', null, ['node_class' => NullTest::class]), - new TwigTest('null', null, ['node_class' => NullTest::class]), - new TwigTest('divisible by', null, ['node_class' => DivisiblebyTest::class, 'one_mandatory_argument' => true]), - new TwigTest('constant', null, ['node_class' => ConstantTest::class]), - new TwigTest('empty', 'twig_test_empty'), - new TwigTest('iterable', 'is_iterable'), - ]; - } - - public function getNodeVisitors(): array - { - return [new MacroAutoImportNodeVisitor()]; - } - - public function getOperators(): array - { - return [ - [ - 'not' => ['precedence' => 50, 'class' => NotUnary::class], - '-' => ['precedence' => 500, 'class' => NegUnary::class], - '+' => ['precedence' => 500, 'class' => PosUnary::class], - ], - [ - 'or' => ['precedence' => 10, 'class' => OrBinary::class, 'associativity' => ExpressionParser::OPERATOR_LEFT], - 'and' => ['precedence' => 15, 'class' => AndBinary::class, 'associativity' => ExpressionParser::OPERATOR_LEFT], - 'b-or' => ['precedence' => 16, 'class' => BitwiseOrBinary::class, 'associativity' => ExpressionParser::OPERATOR_LEFT], - 'b-xor' => ['precedence' => 17, 'class' => BitwiseXorBinary::class, 'associativity' => ExpressionParser::OPERATOR_LEFT], - 'b-and' => ['precedence' => 18, 'class' => BitwiseAndBinary::class, 'associativity' => ExpressionParser::OPERATOR_LEFT], - '==' => ['precedence' => 20, 'class' => EqualBinary::class, 'associativity' => ExpressionParser::OPERATOR_LEFT], - '!=' => ['precedence' => 20, 'class' => NotEqualBinary::class, 'associativity' => ExpressionParser::OPERATOR_LEFT], - '<=>' => ['precedence' => 20, 'class' => SpaceshipBinary::class, 'associativity' => ExpressionParser::OPERATOR_LEFT], - '<' => ['precedence' => 20, 'class' => LessBinary::class, 'associativity' => ExpressionParser::OPERATOR_LEFT], - '>' => ['precedence' => 20, 'class' => GreaterBinary::class, 'associativity' => ExpressionParser::OPERATOR_LEFT], - '>=' => ['precedence' => 20, 'class' => GreaterEqualBinary::class, 'associativity' => ExpressionParser::OPERATOR_LEFT], - '<=' => ['precedence' => 20, 'class' => LessEqualBinary::class, 'associativity' => ExpressionParser::OPERATOR_LEFT], - 'not in' => ['precedence' => 20, 'class' => NotInBinary::class, 'associativity' => ExpressionParser::OPERATOR_LEFT], - 'in' => ['precedence' => 20, 'class' => InBinary::class, 'associativity' => ExpressionParser::OPERATOR_LEFT], - 'matches' => ['precedence' => 20, 'class' => MatchesBinary::class, 'associativity' => ExpressionParser::OPERATOR_LEFT], - 'starts with' => ['precedence' => 20, 'class' => StartsWithBinary::class, 'associativity' => ExpressionParser::OPERATOR_LEFT], - 'ends with' => ['precedence' => 20, 'class' => EndsWithBinary::class, 'associativity' => ExpressionParser::OPERATOR_LEFT], - 'has some' => ['precedence' => 20, 'class' => HasSomeBinary::class, 'associativity' => ExpressionParser::OPERATOR_LEFT], - 'has every' => ['precedence' => 20, 'class' => HasEveryBinary::class, 'associativity' => ExpressionParser::OPERATOR_LEFT], - '..' => ['precedence' => 25, 'class' => RangeBinary::class, 'associativity' => ExpressionParser::OPERATOR_LEFT], - '+' => ['precedence' => 30, 'class' => AddBinary::class, 'associativity' => ExpressionParser::OPERATOR_LEFT], - '-' => ['precedence' => 30, 'class' => SubBinary::class, 'associativity' => ExpressionParser::OPERATOR_LEFT], - '~' => ['precedence' => 40, 'class' => ConcatBinary::class, 'associativity' => ExpressionParser::OPERATOR_LEFT], - '*' => ['precedence' => 60, 'class' => MulBinary::class, 'associativity' => ExpressionParser::OPERATOR_LEFT], - '/' => ['precedence' => 60, 'class' => DivBinary::class, 'associativity' => ExpressionParser::OPERATOR_LEFT], - '//' => ['precedence' => 60, 'class' => FloorDivBinary::class, 'associativity' => ExpressionParser::OPERATOR_LEFT], - '%' => ['precedence' => 60, 'class' => ModBinary::class, 'associativity' => ExpressionParser::OPERATOR_LEFT], - 'is' => ['precedence' => 100, 'associativity' => ExpressionParser::OPERATOR_LEFT], - 'is not' => ['precedence' => 100, 'associativity' => ExpressionParser::OPERATOR_LEFT], - '**' => ['precedence' => 200, 'class' => PowerBinary::class, 'associativity' => ExpressionParser::OPERATOR_RIGHT], - '??' => ['precedence' => 300, 'class' => NullCoalesceExpression::class, 'associativity' => ExpressionParser::OPERATOR_RIGHT], - ], - ]; - } -} -} - -namespace { - use Twig\Environment; - use Twig\Error\LoaderError; - use Twig\Error\RuntimeError; - use Twig\Extension\CoreExtension; - use Twig\Extension\SandboxExtension; - use Twig\Markup; - use Twig\Source; - use Twig\Template; - use Twig\TemplateWrapper; - -/** - * Cycles over a value. - * - * @param \ArrayAccess|array $values - * @param int $position The cycle position - * - * @return string The next value in the cycle - */ -function twig_cycle($values, $position) -{ - if (!\is_array($values) && !$values instanceof \ArrayAccess) { - return $values; - } - - return $values[$position % \count($values)]; -} - -/** - * Returns a random value depending on the supplied parameter type: - * - a random item from a \Traversable or array - * - a random character from a string - * - a random integer between 0 and the integer parameter. - * - * @param \Traversable|array|int|float|string $values The values to pick a random item from - * @param int|null $max Maximum value used when $values is an int - * - * @return mixed A random value from the given sequence - * - * @throws RuntimeError when $values is an empty array (does not apply to an empty string which is returned as is) - */ -function twig_random(Environment $env, $values = null, $max = null) -{ - if (null === $values) { - return null === $max ? mt_rand() : mt_rand(0, (int) $max); - } - - if (\is_int($values) || \is_float($values)) { - if (null === $max) { - if ($values < 0) { - $max = 0; - $min = $values; - } else { - $max = $values; - $min = 0; - } - } else { - $min = $values; - } - - return mt_rand((int) $min, (int) $max); - } - - if (\is_string($values)) { - if ('' === $values) { - return ''; - } - - $charset = $env->getCharset(); - - if ('UTF-8' !== $charset) { - $values = twig_convert_encoding($values, 'UTF-8', $charset); - } - - // unicode version of str_split() - // split at all positions, but not after the start and not before the end - $values = preg_split('/(? $value) { - $values[$i] = twig_convert_encoding($value, $charset, 'UTF-8'); - } - } - } - - if (!is_iterable($values)) { - return $values; - } - - $values = twig_to_array($values); - - if (0 === \count($values)) { - throw new RuntimeError('The random function cannot pick from an empty array.'); - } - - return $values[array_rand($values, 1)]; -} - -/** - * Converts a date to the given format. - * - * {{ post.published_at|date("m/d/Y") }} - * - * @param \DateTimeInterface|\DateInterval|string $date A date - * @param string|null $format The target format, null to use the default - * @param \DateTimeZone|string|false|null $timezone The target timezone, null to use the default, false to leave unchanged - * - * @return string The formatted date - */ -function twig_date_format_filter(Environment $env, $date, $format = null, $timezone = null) -{ - if (null === $format) { - $formats = $env->getExtension(CoreExtension::class)->getDateFormat(); - $format = $date instanceof \DateInterval ? $formats[1] : $formats[0]; - } - - if ($date instanceof \DateInterval) { - return $date->format($format); - } - - return twig_date_converter($env, $date, $timezone)->format($format); -} - -/** - * Returns a new date object modified. - * - * {{ post.published_at|date_modify("-1day")|date("m/d/Y") }} - * - * @param \DateTimeInterface|string $date A date - * @param string $modifier A modifier string - * - * @return \DateTimeInterface - */ -function twig_date_modify_filter(Environment $env, $date, $modifier) -{ - $date = twig_date_converter($env, $date, false); - - return $date->modify($modifier); -} - -/** - * Returns a formatted string. - * - * @param string|null $format - * @param ...$values - * - * @return string - */ -function twig_sprintf($format, ...$values) -{ - return sprintf($format ?? '', ...$values); -} - -/** - * Converts an input to a \DateTime instance. - * - * {% if date(user.created_at) < date('+2days') %} - * {# do something #} - * {% endif %} - * - * @param \DateTimeInterface|string|null $date A date or null to use the current time - * @param \DateTimeZone|string|false|null $timezone The target timezone, null to use the default, false to leave unchanged - * - * @return \DateTimeInterface - */ -function twig_date_converter(Environment $env, $date = null, $timezone = null) -{ - // determine the timezone - if (false !== $timezone) { - if (null === $timezone) { - $timezone = $env->getExtension(CoreExtension::class)->getTimezone(); - } elseif (!$timezone instanceof \DateTimeZone) { - $timezone = new \DateTimeZone($timezone); - } - } - - // immutable dates - if ($date instanceof \DateTimeImmutable) { - return false !== $timezone ? $date->setTimezone($timezone) : $date; - } - - if ($date instanceof \DateTimeInterface) { - $date = clone $date; - if (false !== $timezone) { - $date->setTimezone($timezone); - } - - return $date; - } - - if (null === $date || 'now' === $date) { - if (null === $date) { - $date = 'now'; - } - - return new \DateTime($date, false !== $timezone ? $timezone : $env->getExtension(CoreExtension::class)->getTimezone()); - } - - $asString = (string) $date; - if (ctype_digit($asString) || (!empty($asString) && '-' === $asString[0] && ctype_digit(substr($asString, 1)))) { - $date = new \DateTime('@'.$date); - } else { - $date = new \DateTime($date, $env->getExtension(CoreExtension::class)->getTimezone()); - } - - if (false !== $timezone) { - $date->setTimezone($timezone); - } - - return $date; -} - -/** - * Replaces strings within a string. - * - * @param string|null $str String to replace in - * @param array|\Traversable $from Replace values - * - * @return string - */ -function twig_replace_filter($str, $from) -{ - if (!is_iterable($from)) { - throw new RuntimeError(sprintf('The "replace" filter expects an array or "Traversable" as replace values, got "%s".', \is_object($from) ? \get_class($from) : \gettype($from))); - } - - return strtr($str ?? '', twig_to_array($from)); -} - -/** - * Rounds a number. - * - * @param int|float|string|null $value The value to round - * @param int|float $precision The rounding precision - * @param string $method The method to use for rounding - * - * @return int|float The rounded number - */ -function twig_round($value, $precision = 0, $method = 'common') -{ - $value = (float) $value; - - if ('common' === $method) { - return round($value, $precision); - } - - if ('ceil' !== $method && 'floor' !== $method) { - throw new RuntimeError('The round filter only supports the "common", "ceil", and "floor" methods.'); - } - - return $method($value * 10 ** $precision) / 10 ** $precision; -} - -/** - * Number format filter. - * - * All of the formatting options can be left null, in that case the defaults will - * be used. Supplying any of the parameters will override the defaults set in the - * environment object. - * - * @param mixed $number A float/int/string of the number to format - * @param int $decimal the number of decimal points to display - * @param string $decimalPoint the character(s) to use for the decimal point - * @param string $thousandSep the character(s) to use for the thousands separator - * - * @return string The formatted number - */ -function twig_number_format_filter(Environment $env, $number, $decimal = null, $decimalPoint = null, $thousandSep = null) -{ - $defaults = $env->getExtension(CoreExtension::class)->getNumberFormat(); - if (null === $decimal) { - $decimal = $defaults[0]; - } - - if (null === $decimalPoint) { - $decimalPoint = $defaults[1]; - } - - if (null === $thousandSep) { - $thousandSep = $defaults[2]; - } - - return number_format((float) $number, $decimal, $decimalPoint, $thousandSep); -} - -/** - * URL encodes (RFC 3986) a string as a path segment or an array as a query string. - * - * @param string|array|null $url A URL or an array of query parameters - * - * @return string The URL encoded value - */ -function twig_urlencode_filter($url) -{ - if (\is_array($url)) { - return http_build_query($url, '', '&', \PHP_QUERY_RFC3986); - } - - return rawurlencode($url ?? ''); -} - -/** - * Merges any number of arrays or Traversable objects. - * - * {% set items = { 'apple': 'fruit', 'orange': 'fruit' } %} - * - * {% set items = items|merge({ 'peugeot': 'car' }, { 'banana': 'fruit' }) %} - * - * {# items now contains { 'apple': 'fruit', 'orange': 'fruit', 'peugeot': 'car', 'banana': 'fruit' } #} - * - * @param array|\Traversable ...$arrays Any number of arrays or Traversable objects to merge - * - * @return array The merged array - */ -function twig_array_merge(...$arrays) -{ - $result = []; - - foreach ($arrays as $argNumber => $array) { - if (!is_iterable($array)) { - throw new RuntimeError(sprintf('The merge filter only works with arrays or "Traversable", got "%s" for argument %d.', \gettype($array), $argNumber + 1)); - } - - $result = array_merge($result, twig_to_array($array)); - } - - return $result; -} - - -/** - * Slices a variable. - * - * @param mixed $item A variable - * @param int $start Start of the slice - * @param int $length Size of the slice - * @param bool $preserveKeys Whether to preserve key or not (when the input is an array) - * - * @return mixed The sliced variable - */ -function twig_slice(Environment $env, $item, $start, $length = null, $preserveKeys = false) -{ - if ($item instanceof \Traversable) { - while ($item instanceof \IteratorAggregate) { - $item = $item->getIterator(); - } - - if ($start >= 0 && $length >= 0 && $item instanceof \Iterator) { - try { - return iterator_to_array(new \LimitIterator($item, $start, $length ?? -1), $preserveKeys); - } catch (\OutOfBoundsException $e) { - return []; - } - } - - $item = iterator_to_array($item, $preserveKeys); - } - - if (\is_array($item)) { - return \array_slice($item, $start, $length, $preserveKeys); - } - - return mb_substr((string) $item, $start, $length, $env->getCharset()); -} - -/** - * Returns the first element of the item. - * - * @param mixed $item A variable - * - * @return mixed The first element of the item - */ -function twig_first(Environment $env, $item) -{ - $elements = twig_slice($env, $item, 0, 1, false); - - return \is_string($elements) ? $elements : current($elements); -} - -/** - * Returns the last element of the item. - * - * @param mixed $item A variable - * - * @return mixed The last element of the item - */ -function twig_last(Environment $env, $item) -{ - $elements = twig_slice($env, $item, -1, 1, false); - - return \is_string($elements) ? $elements : current($elements); -} - -/** - * Joins the values to a string. - * - * The separators between elements are empty strings per default, you can define them with the optional parameters. - * - * {{ [1, 2, 3]|join(', ', ' and ') }} - * {# returns 1, 2 and 3 #} - * - * {{ [1, 2, 3]|join('|') }} - * {# returns 1|2|3 #} - * - * {{ [1, 2, 3]|join }} - * {# returns 123 #} - * - * @param array $value An array - * @param string $glue The separator - * @param string|null $and The separator for the last pair - * - * @return string The concatenated string - */ -function twig_join_filter($value, $glue = '', $and = null) -{ - if (!is_iterable($value)) { - $value = (array) $value; - } - - $value = twig_to_array($value, false); - - if (0 === \count($value)) { - return ''; - } - - if (null === $and || $and === $glue) { - return implode($glue, $value); - } - - if (1 === \count($value)) { - return $value[0]; - } - - return implode($glue, \array_slice($value, 0, -1)).$and.$value[\count($value) - 1]; -} - -/** - * Splits the string into an array. - * - * {{ "one,two,three"|split(',') }} - * {# returns [one, two, three] #} - * - * {{ "one,two,three,four,five"|split(',', 3) }} - * {# returns [one, two, "three,four,five"] #} - * - * {{ "123"|split('') }} - * {# returns [1, 2, 3] #} - * - * {{ "aabbcc"|split('', 2) }} - * {# returns [aa, bb, cc] #} - * - * @param string|null $value A string - * @param string $delimiter The delimiter - * @param int $limit The limit - * - * @return array The split string as an array - */ -function twig_split_filter(Environment $env, $value, $delimiter, $limit = null) -{ - $value = $value ?? ''; - - if ('' !== $delimiter) { - return null === $limit ? explode($delimiter, $value) : explode($delimiter, $value, $limit); - } - - if ($limit <= 1) { - return preg_split('/(?getCharset()); - if ($length < $limit) { - return [$value]; - } - - $r = []; - for ($i = 0; $i < $length; $i += $limit) { - $r[] = mb_substr($value, $i, $limit, $env->getCharset()); - } - - return $r; -} - -// The '_default' filter is used internally to avoid using the ternary operator -// which costs a lot for big contexts (before PHP 5.4). So, on average, -// a function call is cheaper. -/** - * @internal - */ -function _twig_default_filter($value, $default = '') -{ - if (twig_test_empty($value)) { - return $default; - } - - return $value; -} - -/** - * Returns the keys for the given array. - * - * It is useful when you want to iterate over the keys of an array: - * - * {% for key in array|keys %} - * {# ... #} - * {% endfor %} - * - * @param array $array An array - * - * @return array The keys - */ -function twig_get_array_keys_filter($array) -{ - if ($array instanceof \Traversable) { - while ($array instanceof \IteratorAggregate) { - $array = $array->getIterator(); - } - - $keys = []; - if ($array instanceof \Iterator) { - $array->rewind(); - while ($array->valid()) { - $keys[] = $array->key(); - $array->next(); - } - - return $keys; - } - - foreach ($array as $key => $item) { - $keys[] = $key; - } - - return $keys; - } - - if (!\is_array($array)) { - return []; - } - - return array_keys($array); -} - -/** - * Reverses a variable. - * - * @param array|\Traversable|string|null $item An array, a \Traversable instance, or a string - * @param bool $preserveKeys Whether to preserve key or not - * - * @return mixed The reversed input - */ -function twig_reverse_filter(Environment $env, $item, $preserveKeys = false) -{ - if ($item instanceof \Traversable) { - return array_reverse(iterator_to_array($item), $preserveKeys); - } - - if (\is_array($item)) { - return array_reverse($item, $preserveKeys); - } - - $string = (string) $item; - - $charset = $env->getCharset(); - - if ('UTF-8' !== $charset) { - $string = twig_convert_encoding($string, 'UTF-8', $charset); - } - - preg_match_all('/./us', $string, $matches); - - $string = implode('', array_reverse($matches[0])); - - if ('UTF-8' !== $charset) { - $string = twig_convert_encoding($string, $charset, 'UTF-8'); - } - - return $string; -} - -/** - * Sorts an array. - * - * @param array|\Traversable $array - * - * @return array - */ -function twig_sort_filter(Environment $env, $array, $arrow = null) -{ - if ($array instanceof \Traversable) { - $array = iterator_to_array($array); - } elseif (!\is_array($array)) { - throw new RuntimeError(sprintf('The sort filter only works with arrays or "Traversable", got "%s".', \gettype($array))); - } - - if (null !== $arrow) { - twig_check_arrow_in_sandbox($env, $arrow, 'sort', 'filter'); - - uasort($array, $arrow); - } else { - asort($array); - } - - return $array; -} - -/** - * @internal - */ -function twig_in_filter($value, $compare) -{ - if ($value instanceof Markup) { - $value = (string) $value; - } - if ($compare instanceof Markup) { - $compare = (string) $compare; - } - - if (\is_string($compare)) { - if (\is_string($value) || \is_int($value) || \is_float($value)) { - return '' === $value || str_contains($compare, (string) $value); - } - - return false; - } - - if (!is_iterable($compare)) { - return false; - } - - if (\is_object($value) || \is_resource($value)) { - if (!\is_array($compare)) { - foreach ($compare as $item) { - if ($item === $value) { - return true; - } - } - - return false; - } - - return \in_array($value, $compare, true); - } - - foreach ($compare as $item) { - if (0 === twig_compare($value, $item)) { - return true; - } - } - - return false; -} - -/** - * Compares two values using a more strict version of the PHP non-strict comparison operator. - * - * @see https://wiki.php.net/rfc/string_to_number_comparison - * @see https://wiki.php.net/rfc/trailing_whitespace_numerics - * - * @internal - */ -function twig_compare($a, $b) -{ - // int <=> string - if (\is_int($a) && \is_string($b)) { - $bTrim = trim($b, " \t\n\r\v\f"); - if (!is_numeric($bTrim)) { - return (string) $a <=> $b; - } - if ((int) $bTrim == $bTrim) { - return $a <=> (int) $bTrim; - } else { - return (float) $a <=> (float) $bTrim; - } - } - if (\is_string($a) && \is_int($b)) { - $aTrim = trim($a, " \t\n\r\v\f"); - if (!is_numeric($aTrim)) { - return $a <=> (string) $b; - } - if ((int) $aTrim == $aTrim) { - return (int) $aTrim <=> $b; - } else { - return (float) $aTrim <=> (float) $b; - } - } - - // float <=> string - if (\is_float($a) && \is_string($b)) { - if (is_nan($a)) { - return 1; - } - $bTrim = trim($b, " \t\n\r\v\f"); - if (!is_numeric($bTrim)) { - return (string) $a <=> $b; - } - - return $a <=> (float) $bTrim; - } - if (\is_string($a) && \is_float($b)) { - if (is_nan($b)) { - return 1; - } - $aTrim = trim($a, " \t\n\r\v\f"); - if (!is_numeric($aTrim)) { - return $a <=> (string) $b; - } - - return (float) $aTrim <=> $b; - } - - // fallback to <=> - return $a <=> $b; -} - -/** - * @return int - * - * @throws RuntimeError When an invalid pattern is used - */ -function twig_matches(string $regexp, ?string $str) -{ - set_error_handler(function ($t, $m) use ($regexp) { - throw new RuntimeError(sprintf('Regexp "%s" passed to "matches" is not valid', $regexp).substr($m, 12)); - }); - try { - return preg_match($regexp, $str ?? ''); - } finally { - restore_error_handler(); - } -} - -/** - * Returns a trimmed string. - * - * @param string|null $string - * @param string|null $characterMask - * @param string $side - * - * @return string - * - * @throws RuntimeError When an invalid trimming side is used (not a string or not 'left', 'right', or 'both') - */ -function twig_trim_filter($string, $characterMask = null, $side = 'both') -{ - if (null === $characterMask) { - $characterMask = " \t\n\r\0\x0B"; - } - - switch ($side) { - case 'both': - return trim($string ?? '', $characterMask); - case 'left': - return ltrim($string ?? '', $characterMask); - case 'right': - return rtrim($string ?? '', $characterMask); - default: - throw new RuntimeError('Trimming side must be "left", "right" or "both".'); - } -} - -/** - * Inserts HTML line breaks before all newlines in a string. - * - * @param string|null $string - * - * @return string - */ -function twig_nl2br($string) -{ - return nl2br($string ?? ''); -} - -/** - * Removes whitespaces between HTML tags. - * - * @param string|null $string - * - * @return string - */ -function twig_spaceless($content) -{ - return trim(preg_replace('/>\s+<', $content ?? '')); -} - -/** - * @param string|null $string - * @param string $to - * @param string $from - * - * @return string - */ -function twig_convert_encoding($string, $to, $from) -{ - if (!\function_exists('iconv')) { - throw new RuntimeError('Unable to convert encoding: required function iconv() does not exist. You should install ext-iconv or symfony/polyfill-iconv.'); - } - - return iconv($from, $to, $string ?? ''); -} - -/** - * Returns the length of a variable. - * - * @param mixed $thing A variable - * - * @return int The length of the value - */ -function twig_length_filter(Environment $env, $thing) -{ - if (null === $thing) { - return 0; - } - - if (\is_scalar($thing)) { - return mb_strlen($thing, $env->getCharset()); - } - - if ($thing instanceof \Countable || \is_array($thing) || $thing instanceof \SimpleXMLElement) { - return \count($thing); - } - - if ($thing instanceof \Traversable) { - return iterator_count($thing); - } - - if (method_exists($thing, '__toString') && !$thing instanceof \Countable) { - return mb_strlen((string) $thing, $env->getCharset()); - } - - return 1; -} - -/** - * Converts a string to uppercase. - * - * @param string|null $string A string - * - * @return string The uppercased string - */ -function twig_upper_filter(Environment $env, $string) -{ - return mb_strtoupper($string ?? '', $env->getCharset()); -} - -/** - * Converts a string to lowercase. - * - * @param string|null $string A string - * - * @return string The lowercased string - */ -function twig_lower_filter(Environment $env, $string) -{ - return mb_strtolower($string ?? '', $env->getCharset()); -} - -/** - * Strips HTML and PHP tags from a string. - * - * @param string|null $string - * @param string[]|string|null $string - * - * @return string - */ -function twig_striptags($string, $allowable_tags = null) -{ - return strip_tags($string ?? '', $allowable_tags); -} - -/** - * Returns a titlecased string. - * - * @param string|null $string A string - * - * @return string The titlecased string - */ -function twig_title_string_filter(Environment $env, $string) -{ - if (null !== $charset = $env->getCharset()) { - return mb_convert_case($string ?? '', \MB_CASE_TITLE, $charset); - } - - return ucwords(strtolower($string ?? '')); -} - -/** - * Returns a capitalized string. - * - * @param string|null $string A string - * - * @return string The capitalized string - */ -function twig_capitalize_string_filter(Environment $env, $string) -{ - $charset = $env->getCharset(); - - return mb_strtoupper(mb_substr($string ?? '', 0, 1, $charset), $charset).mb_strtolower(mb_substr($string ?? '', 1, null, $charset), $charset); -} - -/** - * @internal - */ -function twig_call_macro(Template $template, string $method, array $args, int $lineno, array $context, Source $source) -{ - if (!method_exists($template, $method)) { - $parent = $template; - while ($parent = $parent->getParent($context)) { - if (method_exists($parent, $method)) { - return $parent->$method(...$args); - } - } - - throw new RuntimeError(sprintf('Macro "%s" is not defined in template "%s".', substr($method, \strlen('macro_')), $template->getTemplateName()), $lineno, $source); - } - - return $template->$method(...$args); -} - -/** - * @internal - */ -function twig_ensure_traversable($seq) -{ - if (is_iterable($seq)) { - return $seq; - } - - return []; -} - -/** - * @internal - */ -function twig_to_array($seq, $preserveKeys = true) -{ - if ($seq instanceof \Traversable) { - return iterator_to_array($seq, $preserveKeys); - } - - if (!\is_array($seq)) { - return $seq; - } - - return $preserveKeys ? $seq : array_values($seq); -} - -/** - * Checks if a variable is empty. - * - * {# evaluates to true if the foo variable is null, false, or the empty string #} - * {% if foo is empty %} - * {# ... #} - * {% endif %} - * - * @param mixed $value A variable - * - * @return bool true if the value is empty, false otherwise - */ -function twig_test_empty($value) -{ - if ($value instanceof \Countable) { - return 0 === \count($value); - } - - if ($value instanceof \Traversable) { - return !iterator_count($value); - } - - if (\is_object($value) && method_exists($value, '__toString')) { - return '' === (string) $value; - } - - return '' === $value || false === $value || null === $value || [] === $value; -} - -/** - * Checks if a variable is traversable. - * - * {# evaluates to true if the foo variable is an array or a traversable object #} - * {% if foo is iterable %} - * {# ... #} - * {% endif %} - * - * @param mixed $value A variable - * - * @return bool true if the value is traversable - * - * @deprecated since Twig 3.8, to be removed in 4.0 (use the native "is_iterable" function instead) - */ -function twig_test_iterable($value) -{ - return is_iterable($value); -} - -/** - * Renders a template. - * - * @param array $context - * @param string|array|TemplateWrapper $template The template to render or an array of templates to try consecutively - * @param array $variables The variables to pass to the template - * @param bool $withContext - * @param bool $ignoreMissing Whether to ignore missing templates or not - * @param bool $sandboxed Whether to sandbox the template or not - * - * @return string The rendered template - */ -function twig_include(Environment $env, $context, $template, $variables = [], $withContext = true, $ignoreMissing = false, $sandboxed = false) -{ - $alreadySandboxed = false; - $sandbox = null; - if ($withContext) { - $variables = array_merge($context, $variables); - } - - if ($isSandboxed = $sandboxed && $env->hasExtension(SandboxExtension::class)) { - $sandbox = $env->getExtension(SandboxExtension::class); - if (!$alreadySandboxed = $sandbox->isSandboxed()) { - $sandbox->enableSandbox(); - } - - foreach ((\is_array($template) ? $template : [$template]) as $name) { - // if a Template instance is passed, it might have been instantiated outside of a sandbox, check security - if ($name instanceof TemplateWrapper || $name instanceof Template) { - $name->unwrap()->checkSecurity(); - } - } - } - - try { - $loaded = null; - try { - $loaded = $env->resolveTemplate($template); - } catch (LoaderError $e) { - if (!$ignoreMissing) { - throw $e; - } - } - - return $loaded ? $loaded->render($variables) : ''; - } finally { - if ($isSandboxed && !$alreadySandboxed) { - $sandbox->disableSandbox(); - } - } -} - -/** - * Returns a template content without rendering it. - * - * @param string $name The template name - * @param bool $ignoreMissing Whether to ignore missing templates or not - * - * @return string The template source - */ -function twig_source(Environment $env, $name, $ignoreMissing = false) -{ - $loader = $env->getLoader(); - try { - return $loader->getSourceContext($name)->getCode(); - } catch (LoaderError $e) { - if (!$ignoreMissing) { - throw $e; - } - } -} - -/** - * Provides the ability to get constants from instances as well as class/global constants. - * - * @param string $constant The name of the constant - * @param object|null $object The object to get the constant from - * - * @return string - */ -function twig_constant($constant, $object = null) -{ - if (null !== $object) { - if ('class' === $constant) { - return \get_class($object); - } - - $constant = \get_class($object).'::'.$constant; - } - - if (!\defined($constant)) { - throw new RuntimeError(sprintf('Constant "%s" is undefined.', $constant)); - } - - return \constant($constant); -} - -/** - * Checks if a constant exists. - * - * @param string $constant The name of the constant - * @param object|null $object The object to get the constant from - * - * @return bool - */ -function twig_constant_is_defined($constant, $object = null) -{ - if (null !== $object) { - if ('class' === $constant) { - return true; - } - - $constant = \get_class($object).'::'.$constant; - } - - return \defined($constant); -} - -/** - * Batches item. - * - * @param array $items An array of items - * @param int $size The size of the batch - * @param mixed $fill A value used to fill missing items - * - * @return array - */ -function twig_array_batch($items, $size, $fill = null, $preserveKeys = true) -{ - if (!is_iterable($items)) { - throw new RuntimeError(sprintf('The "batch" filter expects an array or "Traversable", got "%s".', \is_object($items) ? \get_class($items) : \gettype($items))); - } - - $size = ceil($size); - - $result = array_chunk(twig_to_array($items, $preserveKeys), $size, $preserveKeys); - - if (null !== $fill && $result) { - $last = \count($result) - 1; - if ($fillCount = $size - \count($result[$last])) { - for ($i = 0; $i < $fillCount; ++$i) { - $result[$last][] = $fill; - } - } - } - - return $result; -} - -/** - * Returns the attribute value for a given array/object. - * - * @param mixed $object The object or array from where to get the item - * @param mixed $item The item to get from the array or object - * @param array $arguments An array of arguments to pass if the item is an object method - * @param string $type The type of attribute (@see \Twig\Template constants) - * @param bool $isDefinedTest Whether this is only a defined check - * @param bool $ignoreStrictCheck Whether to ignore the strict attribute check or not - * @param int $lineno The template line where the attribute was called - * - * @return mixed The attribute value, or a Boolean when $isDefinedTest is true, or null when the attribute is not set and $ignoreStrictCheck is true - * - * @throws RuntimeError if the attribute does not exist and Twig is running in strict mode and $isDefinedTest is false - * - * @internal - */ -function twig_get_attribute(Environment $env, Source $source, $object, $item, array $arguments = [], $type = /* Template::ANY_CALL */ 'any', $isDefinedTest = false, $ignoreStrictCheck = false, $sandboxed = false, int $lineno = -1) -{ - // array - if (/* Template::METHOD_CALL */ 'method' !== $type) { - $arrayItem = \is_bool($item) || \is_float($item) ? (int) $item : $item; - - if (((\is_array($object) || $object instanceof \ArrayObject) && (isset($object[$arrayItem]) || \array_key_exists($arrayItem, (array) $object))) - || ($object instanceof ArrayAccess && isset($object[$arrayItem])) - ) { - if ($isDefinedTest) { - return true; - } - - return $object[$arrayItem]; - } - - if (/* Template::ARRAY_CALL */ 'array' === $type || !\is_object($object)) { - if ($isDefinedTest) { - return false; - } - - if ($ignoreStrictCheck || !$env->isStrictVariables()) { - return; - } - - if ($object instanceof ArrayAccess) { - $message = sprintf('Key "%s" in object with ArrayAccess of class "%s" does not exist.', $arrayItem, \get_class($object)); - } elseif (\is_object($object)) { - $message = sprintf('Impossible to access a key "%s" on an object of class "%s" that does not implement ArrayAccess interface.', $item, \get_class($object)); - } elseif (\is_array($object)) { - if (empty($object)) { - $message = sprintf('Key "%s" does not exist as the array is empty.', $arrayItem); - } else { - $message = sprintf('Key "%s" for array with keys "%s" does not exist.', $arrayItem, implode(', ', array_keys($object))); - } - } elseif (/* Template::ARRAY_CALL */ 'array' === $type) { - if (null === $object) { - $message = sprintf('Impossible to access a key ("%s") on a null variable.', $item); - } else { - $message = sprintf('Impossible to access a key ("%s") on a %s variable ("%s").', $item, \gettype($object), $object); - } - } elseif (null === $object) { - $message = sprintf('Impossible to access an attribute ("%s") on a null variable.', $item); - } else { - $message = sprintf('Impossible to access an attribute ("%s") on a %s variable ("%s").', $item, \gettype($object), $object); - } - - throw new RuntimeError($message, $lineno, $source); - } - } - - if (!\is_object($object)) { - if ($isDefinedTest) { - return false; - } - - if ($ignoreStrictCheck || !$env->isStrictVariables()) { - return; - } - - if (null === $object) { - $message = sprintf('Impossible to invoke a method ("%s") on a null variable.', $item); - } elseif (\is_array($object)) { - $message = sprintf('Impossible to invoke a method ("%s") on an array.', $item); - } else { - $message = sprintf('Impossible to invoke a method ("%s") on a %s variable ("%s").', $item, \gettype($object), $object); - } - - throw new RuntimeError($message, $lineno, $source); - } - - if ($object instanceof Template) { - throw new RuntimeError('Accessing \Twig\Template attributes is forbidden.', $lineno, $source); - } - - // object property - if (/* Template::METHOD_CALL */ 'method' !== $type) { - if (isset($object->$item) || \array_key_exists((string) $item, (array) $object)) { - if ($isDefinedTest) { - return true; - } - - if ($sandboxed) { - $env->getExtension(SandboxExtension::class)->checkPropertyAllowed($object, $item, $lineno, $source); - } - - return $object->$item; - } - } - - static $cache = []; - - $class = \get_class($object); - - // object method - // precedence: getXxx() > isXxx() > hasXxx() - if (!isset($cache[$class])) { - $methods = get_class_methods($object); - sort($methods); - $lcMethods = array_map(function ($value) { return strtr($value, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'); }, $methods); - $classCache = []; - foreach ($methods as $i => $method) { - $classCache[$method] = $method; - $classCache[$lcName = $lcMethods[$i]] = $method; - - if ('g' === $lcName[0] && str_starts_with($lcName, 'get')) { - $name = substr($method, 3); - $lcName = substr($lcName, 3); - } elseif ('i' === $lcName[0] && str_starts_with($lcName, 'is')) { - $name = substr($method, 2); - $lcName = substr($lcName, 2); - } elseif ('h' === $lcName[0] && str_starts_with($lcName, 'has')) { - $name = substr($method, 3); - $lcName = substr($lcName, 3); - if (\in_array('is'.$lcName, $lcMethods)) { - continue; - } - } else { - continue; - } - - // skip get() and is() methods (in which case, $name is empty) - if ($name) { - if (!isset($classCache[$name])) { - $classCache[$name] = $method; - } - - if (!isset($classCache[$lcName])) { - $classCache[$lcName] = $method; - } - } - } - $cache[$class] = $classCache; - } - - $call = false; - if (isset($cache[$class][$item])) { - $method = $cache[$class][$item]; - } elseif (isset($cache[$class][$lcItem = strtr($item, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')])) { - $method = $cache[$class][$lcItem]; - } elseif (isset($cache[$class]['__call'])) { - $method = $item; - $call = true; - } else { - if ($isDefinedTest) { - return false; - } - - if ($ignoreStrictCheck || !$env->isStrictVariables()) { - return; - } - - throw new RuntimeError(sprintf('Neither the property "%1$s" nor one of the methods "%1$s()", "get%1$s()"/"is%1$s()"/"has%1$s()" or "__call()" exist and have public access in class "%2$s".', $item, $class), $lineno, $source); - } - - if ($isDefinedTest) { - return true; - } - - if ($sandboxed) { - $env->getExtension(SandboxExtension::class)->checkMethodAllowed($object, $method, $lineno, $source); - } - - // Some objects throw exceptions when they have __call, and the method we try - // to call is not supported. If ignoreStrictCheck is true, we should return null. - try { - $ret = $object->$method(...$arguments); - } catch (\BadMethodCallException $e) { - if ($call && ($ignoreStrictCheck || !$env->isStrictVariables())) { - return; - } - throw $e; - } - - return $ret; -} - -/** - * Returns the values from a single column in the input array. - * - *
- *  {% set items = [{ 'fruit' : 'apple'}, {'fruit' : 'orange' }] %}
- *
- *  {% set fruits = items|column('fruit') %}
- *
- *  {# fruits now contains ['apple', 'orange'] #}
- * 
- * - * @param array|Traversable $array An array - * @param mixed $name The column name - * @param mixed $index The column to use as the index/keys for the returned array - * - * @return array The array of values - */ -function twig_array_column($array, $name, $index = null): array -{ - if ($array instanceof Traversable) { - $array = iterator_to_array($array); - } elseif (!\is_array($array)) { - throw new RuntimeError(sprintf('The column filter only works with arrays or "Traversable", got "%s" as first argument.', \gettype($array))); - } - - return array_column($array, $name, $index); -} - -function twig_array_filter(Environment $env, $array, $arrow) -{ - if (!is_iterable($array)) { - throw new RuntimeError(sprintf('The "filter" filter expects an array or "Traversable", got "%s".', \is_object($array) ? \get_class($array) : \gettype($array))); - } - - twig_check_arrow_in_sandbox($env, $arrow, 'filter', 'filter'); - - if (\is_array($array)) { - return array_filter($array, $arrow, \ARRAY_FILTER_USE_BOTH); - } - - // the IteratorIterator wrapping is needed as some internal PHP classes are \Traversable but do not implement \Iterator - return new \CallbackFilterIterator(new \IteratorIterator($array), $arrow); -} - -function twig_array_map(Environment $env, $array, $arrow) -{ - twig_check_arrow_in_sandbox($env, $arrow, 'map', 'filter'); - - $r = []; - foreach ($array as $k => $v) { - $r[$k] = $arrow($v, $k); - } - - return $r; -} - -function twig_array_reduce(Environment $env, $array, $arrow, $initial = null) -{ - twig_check_arrow_in_sandbox($env, $arrow, 'reduce', 'filter'); - - if (!\is_array($array) && !$array instanceof \Traversable) { - throw new RuntimeError(sprintf('The "reduce" filter only works with arrays or "Traversable", got "%s" as first argument.', \gettype($array))); - } - - $accumulator = $initial; - foreach ($array as $key => $value) { - $accumulator = $arrow($accumulator, $value, $key); - } - - return $accumulator; -} - -function twig_array_some(Environment $env, $array, $arrow) -{ - twig_check_arrow_in_sandbox($env, $arrow, 'has some', 'operator'); - - foreach ($array as $k => $v) { - if ($arrow($v, $k)) { - return true; - } - } - - return false; -} - -function twig_array_every(Environment $env, $array, $arrow) -{ - twig_check_arrow_in_sandbox($env, $arrow, 'has every', 'operator'); - - foreach ($array as $k => $v) { - if (!$arrow($v, $k)) { - return false; - } - } - - return true; -} - -function twig_check_arrow_in_sandbox(Environment $env, $arrow, $thing, $type) -{ - if (!$arrow instanceof Closure && $env->hasExtension('\Twig\Extension\SandboxExtension') && $env->getExtension('\Twig\Extension\SandboxExtension')->isSandboxed()) { - throw new RuntimeError(sprintf('The callable passed to the "%s" %s must be a Closure in sandbox mode.', $thing, $type)); - } -} -} diff --git a/system/vendor/twig/twig/src/Extension/DebugExtension.php b/system/vendor/twig/twig/src/Extension/DebugExtension.php deleted file mode 100644 index c0f10d5..0000000 --- a/system/vendor/twig/twig/src/Extension/DebugExtension.php +++ /dev/null @@ -1,64 +0,0 @@ - $isDumpOutputHtmlSafe ? ['html'] : [], 'needs_context' => true, 'needs_environment' => true, 'is_variadic' => true]), - ]; - } -} -} - -namespace { -use Twig\Environment; -use Twig\Template; -use Twig\TemplateWrapper; - -function twig_var_dump(Environment $env, $context, ...$vars) -{ - if (!$env->isDebug()) { - return; - } - - ob_start(); - - if (!$vars) { - $vars = []; - foreach ($context as $key => $value) { - if (!$value instanceof Template && !$value instanceof TemplateWrapper) { - $vars[$key] = $value; - } - } - - var_dump($vars); - } else { - var_dump(...$vars); - } - - return ob_get_clean(); -} -} diff --git a/system/vendor/twig/twig/src/Extension/EscaperExtension.php b/system/vendor/twig/twig/src/Extension/EscaperExtension.php deleted file mode 100644 index ef8879d..0000000 --- a/system/vendor/twig/twig/src/Extension/EscaperExtension.php +++ /dev/null @@ -1,416 +0,0 @@ -setDefaultStrategy($defaultStrategy); - } - - public function getTokenParsers(): array - { - return [new AutoEscapeTokenParser()]; - } - - public function getNodeVisitors(): array - { - return [new EscaperNodeVisitor()]; - } - - public function getFilters(): array - { - return [ - new TwigFilter('escape', 'twig_escape_filter', ['needs_environment' => true, 'is_safe_callback' => 'twig_escape_filter_is_safe']), - new TwigFilter('e', 'twig_escape_filter', ['needs_environment' => true, 'is_safe_callback' => 'twig_escape_filter_is_safe']), - new TwigFilter('raw', 'twig_raw_filter', ['is_safe' => ['all']]), - ]; - } - - /** - * Sets the default strategy to use when not defined by the user. - * - * The strategy can be a valid PHP callback that takes the template - * name as an argument and returns the strategy to use. - * - * @param string|false|callable $defaultStrategy An escaping strategy - */ - public function setDefaultStrategy($defaultStrategy): void - { - if ('name' === $defaultStrategy) { - $defaultStrategy = [FileExtensionEscapingStrategy::class, 'guess']; - } - - $this->defaultStrategy = $defaultStrategy; - } - - /** - * Gets the default strategy to use when not defined by the user. - * - * @param string $name The template name - * - * @return string|false The default strategy to use for the template - */ - public function getDefaultStrategy(string $name) - { - // disable string callables to avoid calling a function named html or js, - // or any other upcoming escaping strategy - if (!\is_string($this->defaultStrategy) && false !== $this->defaultStrategy) { - return \call_user_func($this->defaultStrategy, $name); - } - - return $this->defaultStrategy; - } - - /** - * Defines a new escaper to be used via the escape filter. - * - * @param string $strategy The strategy name that should be used as a strategy in the escape call - * @param callable $callable A valid PHP callable - */ - public function setEscaper($strategy, callable $callable) - { - $this->escapers[$strategy] = $callable; - } - - /** - * Gets all defined escapers. - * - * @return callable[] An array of escapers - */ - public function getEscapers() - { - return $this->escapers; - } - - public function setSafeClasses(array $safeClasses = []) - { - $this->safeClasses = []; - $this->safeLookup = []; - foreach ($safeClasses as $class => $strategies) { - $this->addSafeClass($class, $strategies); - } - } - - public function addSafeClass(string $class, array $strategies) - { - $class = ltrim($class, '\\'); - if (!isset($this->safeClasses[$class])) { - $this->safeClasses[$class] = []; - } - $this->safeClasses[$class] = array_merge($this->safeClasses[$class], $strategies); - - foreach ($strategies as $strategy) { - $this->safeLookup[$strategy][$class] = true; - } - } -} -} - -namespace { -use Twig\Environment; -use Twig\Error\RuntimeError; -use Twig\Extension\EscaperExtension; -use Twig\Markup; -use Twig\Node\Expression\ConstantExpression; -use Twig\Node\Node; - -/** - * Marks a variable as being safe. - * - * @param string $string A PHP variable - */ -function twig_raw_filter($string) -{ - return $string; -} - -/** - * Escapes a string. - * - * @param mixed $string The value to be escaped - * @param string $strategy The escaping strategy - * @param string $charset The charset - * @param bool $autoescape Whether the function is called by the auto-escaping feature (true) or by the developer (false) - * - * @return string - */ -function twig_escape_filter(Environment $env, $string, $strategy = 'html', $charset = null, $autoescape = false) -{ - if ($autoescape && $string instanceof Markup) { - return $string; - } - - if (!\is_string($string)) { - if (\is_object($string) && method_exists($string, '__toString')) { - if ($autoescape) { - $c = \get_class($string); - $ext = $env->getExtension(EscaperExtension::class); - if (!isset($ext->safeClasses[$c])) { - $ext->safeClasses[$c] = []; - foreach (class_parents($string) + class_implements($string) as $class) { - if (isset($ext->safeClasses[$class])) { - $ext->safeClasses[$c] = array_unique(array_merge($ext->safeClasses[$c], $ext->safeClasses[$class])); - foreach ($ext->safeClasses[$class] as $s) { - $ext->safeLookup[$s][$c] = true; - } - } - } - } - if (isset($ext->safeLookup[$strategy][$c]) || isset($ext->safeLookup['all'][$c])) { - return (string) $string; - } - } - - $string = (string) $string; - } elseif (\in_array($strategy, ['html', 'js', 'css', 'html_attr', 'url'])) { - return $string; - } - } - - if ('' === $string) { - return ''; - } - - if (null === $charset) { - $charset = $env->getCharset(); - } - - switch ($strategy) { - case 'html': - // see https://www.php.net/htmlspecialchars - - // Using a static variable to avoid initializing the array - // each time the function is called. Moving the declaration on the - // top of the function slow downs other escaping strategies. - static $htmlspecialcharsCharsets = [ - 'ISO-8859-1' => true, 'ISO8859-1' => true, - 'ISO-8859-15' => true, 'ISO8859-15' => true, - 'utf-8' => true, 'UTF-8' => true, - 'CP866' => true, 'IBM866' => true, '866' => true, - 'CP1251' => true, 'WINDOWS-1251' => true, 'WIN-1251' => true, - '1251' => true, - 'CP1252' => true, 'WINDOWS-1252' => true, '1252' => true, - 'KOI8-R' => true, 'KOI8-RU' => true, 'KOI8R' => true, - 'BIG5' => true, '950' => true, - 'GB2312' => true, '936' => true, - 'BIG5-HKSCS' => true, - 'SHIFT_JIS' => true, 'SJIS' => true, '932' => true, - 'EUC-JP' => true, 'EUCJP' => true, - 'ISO8859-5' => true, 'ISO-8859-5' => true, 'MACROMAN' => true, - ]; - - if (isset($htmlspecialcharsCharsets[$charset])) { - return htmlspecialchars($string, \ENT_QUOTES | \ENT_SUBSTITUTE, $charset); - } - - if (isset($htmlspecialcharsCharsets[strtoupper($charset)])) { - // cache the lowercase variant for future iterations - $htmlspecialcharsCharsets[$charset] = true; - - return htmlspecialchars($string, \ENT_QUOTES | \ENT_SUBSTITUTE, $charset); - } - - $string = twig_convert_encoding($string, 'UTF-8', $charset); - $string = htmlspecialchars($string, \ENT_QUOTES | \ENT_SUBSTITUTE, 'UTF-8'); - - return iconv('UTF-8', $charset, $string); - - case 'js': - // escape all non-alphanumeric characters - // into their \x or \uHHHH representations - if ('UTF-8' !== $charset) { - $string = twig_convert_encoding($string, 'UTF-8', $charset); - } - - if (!preg_match('//u', $string)) { - throw new RuntimeError('The string to escape is not a valid UTF-8 string.'); - } - - $string = preg_replace_callback('#[^a-zA-Z0-9,\._]#Su', function ($matches) { - $char = $matches[0]; - - /* - * A few characters have short escape sequences in JSON and JavaScript. - * Escape sequences supported only by JavaScript, not JSON, are omitted. - * \" is also supported but omitted, because the resulting string is not HTML safe. - */ - static $shortMap = [ - '\\' => '\\\\', - '/' => '\\/', - "\x08" => '\b', - "\x0C" => '\f', - "\x0A" => '\n', - "\x0D" => '\r', - "\x09" => '\t', - ]; - - if (isset($shortMap[$char])) { - return $shortMap[$char]; - } - - $codepoint = mb_ord($char, 'UTF-8'); - if (0x10000 > $codepoint) { - return sprintf('\u%04X', $codepoint); - } - - // Split characters outside the BMP into surrogate pairs - // https://tools.ietf.org/html/rfc2781.html#section-2.1 - $u = $codepoint - 0x10000; - $high = 0xD800 | ($u >> 10); - $low = 0xDC00 | ($u & 0x3FF); - - return sprintf('\u%04X\u%04X', $high, $low); - }, $string); - - if ('UTF-8' !== $charset) { - $string = iconv('UTF-8', $charset, $string); - } - - return $string; - - case 'css': - if ('UTF-8' !== $charset) { - $string = twig_convert_encoding($string, 'UTF-8', $charset); - } - - if (!preg_match('//u', $string)) { - throw new RuntimeError('The string to escape is not a valid UTF-8 string.'); - } - - $string = preg_replace_callback('#[^a-zA-Z0-9]#Su', function ($matches) { - $char = $matches[0]; - - return sprintf('\\%X ', 1 === \strlen($char) ? \ord($char) : mb_ord($char, 'UTF-8')); - }, $string); - - if ('UTF-8' !== $charset) { - $string = iconv('UTF-8', $charset, $string); - } - - return $string; - - case 'html_attr': - if ('UTF-8' !== $charset) { - $string = twig_convert_encoding($string, 'UTF-8', $charset); - } - - if (!preg_match('//u', $string)) { - throw new RuntimeError('The string to escape is not a valid UTF-8 string.'); - } - - $string = preg_replace_callback('#[^a-zA-Z0-9,\.\-_]#Su', function ($matches) { - /** - * This function is adapted from code coming from Zend Framework. - * - * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (https://www.zend.com) - * @license https://framework.zend.com/license/new-bsd New BSD License - */ - $chr = $matches[0]; - $ord = \ord($chr); - - /* - * The following replaces characters undefined in HTML with the - * hex entity for the Unicode replacement character. - */ - if (($ord <= 0x1F && "\t" != $chr && "\n" != $chr && "\r" != $chr) || ($ord >= 0x7F && $ord <= 0x9F)) { - return '�'; - } - - /* - * Check if the current character to escape has a name entity we should - * replace it with while grabbing the hex value of the character. - */ - if (1 === \strlen($chr)) { - /* - * While HTML supports far more named entities, the lowest common denominator - * has become HTML5's XML Serialisation which is restricted to the those named - * entities that XML supports. Using HTML entities would result in this error: - * XML Parsing Error: undefined entity - */ - static $entityMap = [ - 34 => '"', /* quotation mark */ - 38 => '&', /* ampersand */ - 60 => '<', /* less-than sign */ - 62 => '>', /* greater-than sign */ - ]; - - if (isset($entityMap[$ord])) { - return $entityMap[$ord]; - } - - return sprintf('&#x%02X;', $ord); - } - - /* - * Per OWASP recommendations, we'll use hex entities for any other - * characters where a named entity does not exist. - */ - return sprintf('&#x%04X;', mb_ord($chr, 'UTF-8')); - }, $string); - - if ('UTF-8' !== $charset) { - $string = iconv('UTF-8', $charset, $string); - } - - return $string; - - case 'url': - return rawurlencode($string); - - default: - $escapers = $env->getExtension(EscaperExtension::class)->getEscapers(); - if (\array_key_exists($strategy, $escapers)) { - return $escapers[$strategy]($env, $string, $charset); - } - - $validStrategies = implode(', ', array_merge(['html', 'js', 'url', 'css', 'html_attr'], array_keys($escapers))); - - throw new RuntimeError(sprintf('Invalid escaping strategy "%s" (valid ones: %s).', $strategy, $validStrategies)); - } -} - -/** - * @internal - */ -function twig_escape_filter_is_safe(Node $filterArgs) -{ - foreach ($filterArgs as $arg) { - if ($arg instanceof ConstantExpression) { - return [$arg->getAttribute('value')]; - } - - return []; - } - - return ['html']; -} -} diff --git a/system/vendor/twig/twig/src/Extension/ExtensionInterface.php b/system/vendor/twig/twig/src/Extension/ExtensionInterface.php deleted file mode 100644 index ab9c2c3..0000000 --- a/system/vendor/twig/twig/src/Extension/ExtensionInterface.php +++ /dev/null @@ -1,76 +0,0 @@ - - */ -interface ExtensionInterface -{ - /** - * Returns the token parser instances to add to the existing list. - * - * @return TokenParserInterface[] - */ - public function getTokenParsers(); - - /** - * Returns the node visitor instances to add to the existing list. - * - * @return NodeVisitorInterface[] - */ - public function getNodeVisitors(); - - /** - * Returns a list of filters to add to the existing list. - * - * @return TwigFilter[] - */ - public function getFilters(); - - /** - * Returns a list of tests to add to the existing list. - * - * @return TwigTest[] - */ - public function getTests(); - - /** - * Returns a list of functions to add to the existing list. - * - * @return TwigFunction[] - */ - public function getFunctions(); - - /** - * Returns a list of operators to add to the existing list. - * - * @return array First array of unary operators, second array of binary operators - * - * @psalm-return array{ - * array}>, - * array, associativity: ExpressionParser::OPERATOR_*}> - * } - */ - public function getOperators(); -} diff --git a/system/vendor/twig/twig/src/Extension/GlobalsInterface.php b/system/vendor/twig/twig/src/Extension/GlobalsInterface.php deleted file mode 100644 index 6f1dfe8..0000000 --- a/system/vendor/twig/twig/src/Extension/GlobalsInterface.php +++ /dev/null @@ -1,28 +0,0 @@ - - */ -interface GlobalsInterface -{ - /** - * @return array - */ - public function getGlobals(): array; -} diff --git a/system/vendor/twig/twig/src/Extension/OptimizerExtension.php b/system/vendor/twig/twig/src/Extension/OptimizerExtension.php deleted file mode 100644 index 965bfdb..0000000 --- a/system/vendor/twig/twig/src/Extension/OptimizerExtension.php +++ /dev/null @@ -1,29 +0,0 @@ -optimizers = $optimizers; - } - - public function getNodeVisitors(): array - { - return [new OptimizerNodeVisitor($this->optimizers)]; - } -} diff --git a/system/vendor/twig/twig/src/Extension/ProfilerExtension.php b/system/vendor/twig/twig/src/Extension/ProfilerExtension.php deleted file mode 100644 index 43e4a44..0000000 --- a/system/vendor/twig/twig/src/Extension/ProfilerExtension.php +++ /dev/null @@ -1,52 +0,0 @@ -actives[] = $profile; - } - - /** - * @return void - */ - public function enter(Profile $profile) - { - $this->actives[0]->addProfile($profile); - array_unshift($this->actives, $profile); - } - - /** - * @return void - */ - public function leave(Profile $profile) - { - $profile->leave(); - array_shift($this->actives); - - if (1 === \count($this->actives)) { - $this->actives[0]->leave(); - } - } - - public function getNodeVisitors(): array - { - return [new ProfilerNodeVisitor(static::class)]; - } -} diff --git a/system/vendor/twig/twig/src/Extension/RuntimeExtensionInterface.php b/system/vendor/twig/twig/src/Extension/RuntimeExtensionInterface.php deleted file mode 100644 index 63bc3b1..0000000 --- a/system/vendor/twig/twig/src/Extension/RuntimeExtensionInterface.php +++ /dev/null @@ -1,19 +0,0 @@ - - */ -interface RuntimeExtensionInterface -{ -} diff --git a/system/vendor/twig/twig/src/Extension/SandboxExtension.php b/system/vendor/twig/twig/src/Extension/SandboxExtension.php deleted file mode 100644 index c861159..0000000 --- a/system/vendor/twig/twig/src/Extension/SandboxExtension.php +++ /dev/null @@ -1,123 +0,0 @@ -policy = $policy; - $this->sandboxedGlobally = $sandboxed; - } - - public function getTokenParsers(): array - { - return [new SandboxTokenParser()]; - } - - public function getNodeVisitors(): array - { - return [new SandboxNodeVisitor()]; - } - - public function enableSandbox(): void - { - $this->sandboxed = true; - } - - public function disableSandbox(): void - { - $this->sandboxed = false; - } - - public function isSandboxed(): bool - { - return $this->sandboxedGlobally || $this->sandboxed; - } - - public function isSandboxedGlobally(): bool - { - return $this->sandboxedGlobally; - } - - public function setSecurityPolicy(SecurityPolicyInterface $policy) - { - $this->policy = $policy; - } - - public function getSecurityPolicy(): SecurityPolicyInterface - { - return $this->policy; - } - - public function checkSecurity($tags, $filters, $functions): void - { - if ($this->isSandboxed()) { - $this->policy->checkSecurity($tags, $filters, $functions); - } - } - - public function checkMethodAllowed($obj, $method, int $lineno = -1, Source $source = null): void - { - if ($this->isSandboxed()) { - try { - $this->policy->checkMethodAllowed($obj, $method); - } catch (SecurityNotAllowedMethodError $e) { - $e->setSourceContext($source); - $e->setTemplateLine($lineno); - - throw $e; - } - } - } - - public function checkPropertyAllowed($obj, $property, int $lineno = -1, Source $source = null): void - { - if ($this->isSandboxed()) { - try { - $this->policy->checkPropertyAllowed($obj, $property); - } catch (SecurityNotAllowedPropertyError $e) { - $e->setSourceContext($source); - $e->setTemplateLine($lineno); - - throw $e; - } - } - } - - public function ensureToStringAllowed($obj, int $lineno = -1, Source $source = null) - { - if ($this->isSandboxed() && \is_object($obj) && method_exists($obj, '__toString')) { - try { - $this->policy->checkMethodAllowed($obj, '__toString'); - } catch (SecurityNotAllowedMethodError $e) { - $e->setSourceContext($source); - $e->setTemplateLine($lineno); - - throw $e; - } - } - - return $obj; - } -} diff --git a/system/vendor/twig/twig/src/Extension/StagingExtension.php b/system/vendor/twig/twig/src/Extension/StagingExtension.php deleted file mode 100644 index 0ea47f9..0000000 --- a/system/vendor/twig/twig/src/Extension/StagingExtension.php +++ /dev/null @@ -1,100 +0,0 @@ - - * - * @internal - */ -final class StagingExtension extends AbstractExtension -{ - private $functions = []; - private $filters = []; - private $visitors = []; - private $tokenParsers = []; - private $tests = []; - - public function addFunction(TwigFunction $function): void - { - if (isset($this->functions[$function->getName()])) { - throw new \LogicException(sprintf('Function "%s" is already registered.', $function->getName())); - } - - $this->functions[$function->getName()] = $function; - } - - public function getFunctions(): array - { - return $this->functions; - } - - public function addFilter(TwigFilter $filter): void - { - if (isset($this->filters[$filter->getName()])) { - throw new \LogicException(sprintf('Filter "%s" is already registered.', $filter->getName())); - } - - $this->filters[$filter->getName()] = $filter; - } - - public function getFilters(): array - { - return $this->filters; - } - - public function addNodeVisitor(NodeVisitorInterface $visitor): void - { - $this->visitors[] = $visitor; - } - - public function getNodeVisitors(): array - { - return $this->visitors; - } - - public function addTokenParser(TokenParserInterface $parser): void - { - if (isset($this->tokenParsers[$parser->getTag()])) { - throw new \LogicException(sprintf('Tag "%s" is already registered.', $parser->getTag())); - } - - $this->tokenParsers[$parser->getTag()] = $parser; - } - - public function getTokenParsers(): array - { - return $this->tokenParsers; - } - - public function addTest(TwigTest $test): void - { - if (isset($this->tests[$test->getName()])) { - throw new \LogicException(sprintf('Test "%s" is already registered.', $test->getName())); - } - - $this->tests[$test->getName()] = $test; - } - - public function getTests(): array - { - return $this->tests; - } -} diff --git a/system/vendor/twig/twig/src/Extension/StringLoaderExtension.php b/system/vendor/twig/twig/src/Extension/StringLoaderExtension.php deleted file mode 100644 index 7b45147..0000000 --- a/system/vendor/twig/twig/src/Extension/StringLoaderExtension.php +++ /dev/null @@ -1,42 +0,0 @@ - true]), - ]; - } -} -} - -namespace { -use Twig\Environment; -use Twig\TemplateWrapper; - -/** - * Loads a template from a string. - * - * {{ include(template_from_string("Hello {{ name }}")) }} - * - * @param string $template A template as a string or object implementing __toString() - * @param string $name An optional name of the template to be used in error messages - */ -function twig_template_from_string(Environment $env, $template, string $name = null): TemplateWrapper -{ - return $env->createTemplate((string) $template, $name); -} -} diff --git a/system/vendor/twig/twig/src/ExtensionSet.php b/system/vendor/twig/twig/src/ExtensionSet.php deleted file mode 100644 index d32200c..0000000 --- a/system/vendor/twig/twig/src/ExtensionSet.php +++ /dev/null @@ -1,480 +0,0 @@ - - * - * @internal - */ -final class ExtensionSet -{ - private $extensions; - private $initialized = false; - private $runtimeInitialized = false; - private $staging; - private $parsers; - private $visitors; - /** @var array */ - private $filters; - /** @var array */ - private $tests; - /** @var array */ - private $functions; - /** @var array}> */ - private $unaryOperators; - /** @var array, associativity: ExpressionParser::OPERATOR_*}> */ - private $binaryOperators; - /** @var array */ - private $globals; - private $functionCallbacks = []; - private $filterCallbacks = []; - private $parserCallbacks = []; - private $lastModified = 0; - - public function __construct() - { - $this->staging = new StagingExtension(); - } - - public function initRuntime() - { - $this->runtimeInitialized = true; - } - - public function hasExtension(string $class): bool - { - return isset($this->extensions[ltrim($class, '\\')]); - } - - public function getExtension(string $class): ExtensionInterface - { - $class = ltrim($class, '\\'); - - if (!isset($this->extensions[$class])) { - throw new RuntimeError(sprintf('The "%s" extension is not enabled.', $class)); - } - - return $this->extensions[$class]; - } - - /** - * @param ExtensionInterface[] $extensions - */ - public function setExtensions(array $extensions): void - { - foreach ($extensions as $extension) { - $this->addExtension($extension); - } - } - - /** - * @return ExtensionInterface[] - */ - public function getExtensions(): array - { - return $this->extensions; - } - - public function getSignature(): string - { - return json_encode(array_keys($this->extensions)); - } - - public function isInitialized(): bool - { - return $this->initialized || $this->runtimeInitialized; - } - - public function getLastModified(): int - { - if (0 !== $this->lastModified) { - return $this->lastModified; - } - - foreach ($this->extensions as $extension) { - $r = new \ReflectionObject($extension); - if (is_file($r->getFileName()) && ($extensionTime = filemtime($r->getFileName())) > $this->lastModified) { - $this->lastModified = $extensionTime; - } - } - - return $this->lastModified; - } - - public function addExtension(ExtensionInterface $extension): void - { - $class = \get_class($extension); - - if ($this->initialized) { - throw new \LogicException(sprintf('Unable to register extension "%s" as extensions have already been initialized.', $class)); - } - - if (isset($this->extensions[$class])) { - throw new \LogicException(sprintf('Unable to register extension "%s" as it is already registered.', $class)); - } - - $this->extensions[$class] = $extension; - } - - public function addFunction(TwigFunction $function): void - { - if ($this->initialized) { - throw new \LogicException(sprintf('Unable to add function "%s" as extensions have already been initialized.', $function->getName())); - } - - $this->staging->addFunction($function); - } - - /** - * @return TwigFunction[] - */ - public function getFunctions(): array - { - if (!$this->initialized) { - $this->initExtensions(); - } - - return $this->functions; - } - - public function getFunction(string $name): ?TwigFunction - { - if (!$this->initialized) { - $this->initExtensions(); - } - - if (isset($this->functions[$name])) { - return $this->functions[$name]; - } - - foreach ($this->functions as $pattern => $function) { - $pattern = str_replace('\\*', '(.*?)', preg_quote($pattern, '#'), $count); - - if ($count && preg_match('#^'.$pattern.'$#', $name, $matches)) { - array_shift($matches); - $function->setArguments($matches); - - return $function; - } - } - - foreach ($this->functionCallbacks as $callback) { - if (false !== $function = $callback($name)) { - return $function; - } - } - - return null; - } - - public function registerUndefinedFunctionCallback(callable $callable): void - { - $this->functionCallbacks[] = $callable; - } - - public function addFilter(TwigFilter $filter): void - { - if ($this->initialized) { - throw new \LogicException(sprintf('Unable to add filter "%s" as extensions have already been initialized.', $filter->getName())); - } - - $this->staging->addFilter($filter); - } - - /** - * @return TwigFilter[] - */ - public function getFilters(): array - { - if (!$this->initialized) { - $this->initExtensions(); - } - - return $this->filters; - } - - public function getFilter(string $name): ?TwigFilter - { - if (!$this->initialized) { - $this->initExtensions(); - } - - if (isset($this->filters[$name])) { - return $this->filters[$name]; - } - - foreach ($this->filters as $pattern => $filter) { - $pattern = str_replace('\\*', '(.*?)', preg_quote($pattern, '#'), $count); - - if ($count && preg_match('#^'.$pattern.'$#', $name, $matches)) { - array_shift($matches); - $filter->setArguments($matches); - - return $filter; - } - } - - foreach ($this->filterCallbacks as $callback) { - if (false !== $filter = $callback($name)) { - return $filter; - } - } - - return null; - } - - public function registerUndefinedFilterCallback(callable $callable): void - { - $this->filterCallbacks[] = $callable; - } - - public function addNodeVisitor(NodeVisitorInterface $visitor): void - { - if ($this->initialized) { - throw new \LogicException('Unable to add a node visitor as extensions have already been initialized.'); - } - - $this->staging->addNodeVisitor($visitor); - } - - /** - * @return NodeVisitorInterface[] - */ - public function getNodeVisitors(): array - { - if (!$this->initialized) { - $this->initExtensions(); - } - - return $this->visitors; - } - - public function addTokenParser(TokenParserInterface $parser): void - { - if ($this->initialized) { - throw new \LogicException('Unable to add a token parser as extensions have already been initialized.'); - } - - $this->staging->addTokenParser($parser); - } - - /** - * @return TokenParserInterface[] - */ - public function getTokenParsers(): array - { - if (!$this->initialized) { - $this->initExtensions(); - } - - return $this->parsers; - } - - public function getTokenParser(string $name): ?TokenParserInterface - { - if (!$this->initialized) { - $this->initExtensions(); - } - - if (isset($this->parsers[$name])) { - return $this->parsers[$name]; - } - - foreach ($this->parserCallbacks as $callback) { - if (false !== $parser = $callback($name)) { - return $parser; - } - } - - return null; - } - - public function registerUndefinedTokenParserCallback(callable $callable): void - { - $this->parserCallbacks[] = $callable; - } - - /** - * @return array - */ - public function getGlobals(): array - { - if (null !== $this->globals) { - return $this->globals; - } - - $globals = []; - foreach ($this->extensions as $extension) { - if (!$extension instanceof GlobalsInterface) { - continue; - } - - $extGlobals = $extension->getGlobals(); - if (!\is_array($extGlobals)) { - throw new \UnexpectedValueException(sprintf('"%s::getGlobals()" must return an array of globals.', \get_class($extension))); - } - - $globals = array_merge($globals, $extGlobals); - } - - if ($this->initialized) { - $this->globals = $globals; - } - - return $globals; - } - - public function addTest(TwigTest $test): void - { - if ($this->initialized) { - throw new \LogicException(sprintf('Unable to add test "%s" as extensions have already been initialized.', $test->getName())); - } - - $this->staging->addTest($test); - } - - /** - * @return TwigTest[] - */ - public function getTests(): array - { - if (!$this->initialized) { - $this->initExtensions(); - } - - return $this->tests; - } - - public function getTest(string $name): ?TwigTest - { - if (!$this->initialized) { - $this->initExtensions(); - } - - if (isset($this->tests[$name])) { - return $this->tests[$name]; - } - - foreach ($this->tests as $pattern => $test) { - $pattern = str_replace('\\*', '(.*?)', preg_quote($pattern, '#'), $count); - - if ($count) { - if (preg_match('#^'.$pattern.'$#', $name, $matches)) { - array_shift($matches); - $test->setArguments($matches); - - return $test; - } - } - } - - return null; - } - - /** - * @return array}> - */ - public function getUnaryOperators(): array - { - if (!$this->initialized) { - $this->initExtensions(); - } - - return $this->unaryOperators; - } - - /** - * @return array, associativity: ExpressionParser::OPERATOR_*}> - */ - public function getBinaryOperators(): array - { - if (!$this->initialized) { - $this->initExtensions(); - } - - return $this->binaryOperators; - } - - private function initExtensions(): void - { - $this->parsers = []; - $this->filters = []; - $this->functions = []; - $this->tests = []; - $this->visitors = []; - $this->unaryOperators = []; - $this->binaryOperators = []; - - foreach ($this->extensions as $extension) { - $this->initExtension($extension); - } - $this->initExtension($this->staging); - // Done at the end only, so that an exception during initialization does not mark the environment as initialized when catching the exception - $this->initialized = true; - } - - private function initExtension(ExtensionInterface $extension): void - { - // filters - foreach ($extension->getFilters() as $filter) { - $this->filters[$filter->getName()] = $filter; - } - - // functions - foreach ($extension->getFunctions() as $function) { - $this->functions[$function->getName()] = $function; - } - - // tests - foreach ($extension->getTests() as $test) { - $this->tests[$test->getName()] = $test; - } - - // token parsers - foreach ($extension->getTokenParsers() as $parser) { - if (!$parser instanceof TokenParserInterface) { - throw new \LogicException('getTokenParsers() must return an array of \Twig\TokenParser\TokenParserInterface.'); - } - - $this->parsers[$parser->getTag()] = $parser; - } - - // node visitors - foreach ($extension->getNodeVisitors() as $visitor) { - $this->visitors[] = $visitor; - } - - // operators - if ($operators = $extension->getOperators()) { - if (!\is_array($operators)) { - throw new \InvalidArgumentException(sprintf('"%s::getOperators()" must return an array with operators, got "%s".', \get_class($extension), \is_object($operators) ? \get_class($operators) : \gettype($operators).(\is_resource($operators) ? '' : '#'.$operators))); - } - - if (2 !== \count($operators)) { - throw new \InvalidArgumentException(sprintf('"%s::getOperators()" must return an array of 2 elements, got %d.', \get_class($extension), \count($operators))); - } - - $this->unaryOperators = array_merge($this->unaryOperators, $operators[0]); - $this->binaryOperators = array_merge($this->binaryOperators, $operators[1]); - } - } -} diff --git a/system/vendor/twig/twig/src/FileExtensionEscapingStrategy.php b/system/vendor/twig/twig/src/FileExtensionEscapingStrategy.php deleted file mode 100644 index 812071b..0000000 --- a/system/vendor/twig/twig/src/FileExtensionEscapingStrategy.php +++ /dev/null @@ -1,60 +0,0 @@ - - */ -class FileExtensionEscapingStrategy -{ - /** - * Guesses the best autoescaping strategy based on the file name. - * - * @param string $name The template name - * - * @return string|false The escaping strategy name to use or false to disable - */ - public static function guess(string $name) - { - if (\in_array(substr($name, -1), ['/', '\\'])) { - return 'html'; // return html for directories - } - - if (str_ends_with($name, '.twig')) { - $name = substr($name, 0, -5); - } - - $extension = pathinfo($name, \PATHINFO_EXTENSION); - - switch ($extension) { - case 'js': - return 'js'; - - case 'css': - return 'css'; - - case 'txt': - return false; - - default: - return 'html'; - } - } -} diff --git a/system/vendor/twig/twig/src/Lexer.php b/system/vendor/twig/twig/src/Lexer.php deleted file mode 100644 index b23080f..0000000 --- a/system/vendor/twig/twig/src/Lexer.php +++ /dev/null @@ -1,519 +0,0 @@ - - */ -class Lexer -{ - private $isInitialized = false; - - private $tokens; - private $code; - private $cursor; - private $lineno; - private $end; - private $state; - private $states; - private $brackets; - private $env; - private $source; - private $options; - private $regexes; - private $position; - private $positions; - private $currentVarBlockLine; - - public const STATE_DATA = 0; - public const STATE_BLOCK = 1; - public const STATE_VAR = 2; - public const STATE_STRING = 3; - public const STATE_INTERPOLATION = 4; - - public const REGEX_NAME = '/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/A'; - public const REGEX_NUMBER = '/[0-9]+(?:\.[0-9]+)?([Ee][\+\-][0-9]+)?/A'; - public const REGEX_STRING = '/"([^#"\\\\]*(?:\\\\.[^#"\\\\]*)*)"|\'([^\'\\\\]*(?:\\\\.[^\'\\\\]*)*)\'/As'; - public const REGEX_DQ_STRING_DELIM = '/"/A'; - public const REGEX_DQ_STRING_PART = '/[^#"\\\\]*(?:(?:\\\\.|#(?!\{))[^#"\\\\]*)*/As'; - public const PUNCTUATION = '()[]{}?:.,|'; - - public function __construct(Environment $env, array $options = []) - { - $this->env = $env; - - $this->options = array_merge([ - 'tag_comment' => ['{#', '#}'], - 'tag_block' => ['{%', '%}'], - 'tag_variable' => ['{{', '}}'], - 'whitespace_trim' => '-', - 'whitespace_line_trim' => '~', - 'whitespace_line_chars' => ' \t\0\x0B', - 'interpolation' => ['#{', '}'], - ], $options); - } - - private function initialize() - { - if ($this->isInitialized) { - return; - } - - $this->isInitialized = true; - - // when PHP 7.3 is the min version, we will be able to remove the '#' part in preg_quote as it's part of the default - $this->regexes = [ - // }} - 'lex_var' => '{ - \s* - (?:'. - preg_quote($this->options['whitespace_trim'].$this->options['tag_variable'][1], '#').'\s*'. // -}}\s* - '|'. - preg_quote($this->options['whitespace_line_trim'].$this->options['tag_variable'][1], '#').'['.$this->options['whitespace_line_chars'].']*'. // ~}}[ \t\0\x0B]* - '|'. - preg_quote($this->options['tag_variable'][1], '#'). // }} - ') - }Ax', - - // %} - 'lex_block' => '{ - \s* - (?:'. - preg_quote($this->options['whitespace_trim'].$this->options['tag_block'][1], '#').'\s*\n?'. // -%}\s*\n? - '|'. - preg_quote($this->options['whitespace_line_trim'].$this->options['tag_block'][1], '#').'['.$this->options['whitespace_line_chars'].']*'. // ~%}[ \t\0\x0B]* - '|'. - preg_quote($this->options['tag_block'][1], '#').'\n?'. // %}\n? - ') - }Ax', - - // {% endverbatim %} - 'lex_raw_data' => '{'. - preg_quote($this->options['tag_block'][0], '#'). // {% - '('. - $this->options['whitespace_trim']. // - - '|'. - $this->options['whitespace_line_trim']. // ~ - ')?\s*endverbatim\s*'. - '(?:'. - preg_quote($this->options['whitespace_trim'].$this->options['tag_block'][1], '#').'\s*'. // -%} - '|'. - preg_quote($this->options['whitespace_line_trim'].$this->options['tag_block'][1], '#').'['.$this->options['whitespace_line_chars'].']*'. // ~%}[ \t\0\x0B]* - '|'. - preg_quote($this->options['tag_block'][1], '#'). // %} - ') - }sx', - - 'operator' => $this->getOperatorRegex(), - - // #} - 'lex_comment' => '{ - (?:'. - preg_quote($this->options['whitespace_trim'].$this->options['tag_comment'][1], '#').'\s*\n?'. // -#}\s*\n? - '|'. - preg_quote($this->options['whitespace_line_trim'].$this->options['tag_comment'][1], '#').'['.$this->options['whitespace_line_chars'].']*'. // ~#}[ \t\0\x0B]* - '|'. - preg_quote($this->options['tag_comment'][1], '#').'\n?'. // #}\n? - ') - }sx', - - // verbatim %} - 'lex_block_raw' => '{ - \s*verbatim\s* - (?:'. - preg_quote($this->options['whitespace_trim'].$this->options['tag_block'][1], '#').'\s*'. // -%}\s* - '|'. - preg_quote($this->options['whitespace_line_trim'].$this->options['tag_block'][1], '#').'['.$this->options['whitespace_line_chars'].']*'. // ~%}[ \t\0\x0B]* - '|'. - preg_quote($this->options['tag_block'][1], '#'). // %} - ') - }Asx', - - 'lex_block_line' => '{\s*line\s+(\d+)\s*'.preg_quote($this->options['tag_block'][1], '#').'}As', - - // {{ or {% or {# - 'lex_tokens_start' => '{ - ('. - preg_quote($this->options['tag_variable'][0], '#'). // {{ - '|'. - preg_quote($this->options['tag_block'][0], '#'). // {% - '|'. - preg_quote($this->options['tag_comment'][0], '#'). // {# - ')('. - preg_quote($this->options['whitespace_trim'], '#'). // - - '|'. - preg_quote($this->options['whitespace_line_trim'], '#'). // ~ - ')? - }sx', - 'interpolation_start' => '{'.preg_quote($this->options['interpolation'][0], '#').'\s*}A', - 'interpolation_end' => '{\s*'.preg_quote($this->options['interpolation'][1], '#').'}A', - ]; - } - - public function tokenize(Source $source): TokenStream - { - $this->initialize(); - - $this->source = $source; - $this->code = str_replace(["\r\n", "\r"], "\n", $source->getCode()); - $this->cursor = 0; - $this->lineno = 1; - $this->end = \strlen($this->code); - $this->tokens = []; - $this->state = self::STATE_DATA; - $this->states = []; - $this->brackets = []; - $this->position = -1; - - // find all token starts in one go - preg_match_all($this->regexes['lex_tokens_start'], $this->code, $matches, \PREG_OFFSET_CAPTURE); - $this->positions = $matches; - - while ($this->cursor < $this->end) { - // dispatch to the lexing functions depending - // on the current state - switch ($this->state) { - case self::STATE_DATA: - $this->lexData(); - break; - - case self::STATE_BLOCK: - $this->lexBlock(); - break; - - case self::STATE_VAR: - $this->lexVar(); - break; - - case self::STATE_STRING: - $this->lexString(); - break; - - case self::STATE_INTERPOLATION: - $this->lexInterpolation(); - break; - } - } - - $this->pushToken(/* Token::EOF_TYPE */ -1); - - if (!empty($this->brackets)) { - list($expect, $lineno) = array_pop($this->brackets); - throw new SyntaxError(sprintf('Unclosed "%s".', $expect), $lineno, $this->source); - } - - return new TokenStream($this->tokens, $this->source); - } - - private function lexData(): void - { - // if no matches are left we return the rest of the template as simple text token - if ($this->position == \count($this->positions[0]) - 1) { - $this->pushToken(/* Token::TEXT_TYPE */ 0, substr($this->code, $this->cursor)); - $this->cursor = $this->end; - - return; - } - - // Find the first token after the current cursor - $position = $this->positions[0][++$this->position]; - while ($position[1] < $this->cursor) { - if ($this->position == \count($this->positions[0]) - 1) { - return; - } - $position = $this->positions[0][++$this->position]; - } - - // push the template text first - $text = $textContent = substr($this->code, $this->cursor, $position[1] - $this->cursor); - - // trim? - if (isset($this->positions[2][$this->position][0])) { - if ($this->options['whitespace_trim'] === $this->positions[2][$this->position][0]) { - // whitespace_trim detected ({%-, {{- or {#-) - $text = rtrim($text); - } elseif ($this->options['whitespace_line_trim'] === $this->positions[2][$this->position][0]) { - // whitespace_line_trim detected ({%~, {{~ or {#~) - // don't trim \r and \n - $text = rtrim($text, " \t\0\x0B"); - } - } - $this->pushToken(/* Token::TEXT_TYPE */ 0, $text); - $this->moveCursor($textContent.$position[0]); - - switch ($this->positions[1][$this->position][0]) { - case $this->options['tag_comment'][0]: - $this->lexComment(); - break; - - case $this->options['tag_block'][0]: - // raw data? - if (preg_match($this->regexes['lex_block_raw'], $this->code, $match, 0, $this->cursor)) { - $this->moveCursor($match[0]); - $this->lexRawData(); - // {% line \d+ %} - } elseif (preg_match($this->regexes['lex_block_line'], $this->code, $match, 0, $this->cursor)) { - $this->moveCursor($match[0]); - $this->lineno = (int) $match[1]; - } else { - $this->pushToken(/* Token::BLOCK_START_TYPE */ 1); - $this->pushState(self::STATE_BLOCK); - $this->currentVarBlockLine = $this->lineno; - } - break; - - case $this->options['tag_variable'][0]: - $this->pushToken(/* Token::VAR_START_TYPE */ 2); - $this->pushState(self::STATE_VAR); - $this->currentVarBlockLine = $this->lineno; - break; - } - } - - private function lexBlock(): void - { - if (empty($this->brackets) && preg_match($this->regexes['lex_block'], $this->code, $match, 0, $this->cursor)) { - $this->pushToken(/* Token::BLOCK_END_TYPE */ 3); - $this->moveCursor($match[0]); - $this->popState(); - } else { - $this->lexExpression(); - } - } - - private function lexVar(): void - { - if (empty($this->brackets) && preg_match($this->regexes['lex_var'], $this->code, $match, 0, $this->cursor)) { - $this->pushToken(/* Token::VAR_END_TYPE */ 4); - $this->moveCursor($match[0]); - $this->popState(); - } else { - $this->lexExpression(); - } - } - - private function lexExpression(): void - { - // whitespace - if (preg_match('/\s+/A', $this->code, $match, 0, $this->cursor)) { - $this->moveCursor($match[0]); - - if ($this->cursor >= $this->end) { - throw new SyntaxError(sprintf('Unclosed "%s".', self::STATE_BLOCK === $this->state ? 'block' : 'variable'), $this->currentVarBlockLine, $this->source); - } - } - - // spread operator - if ('.' === $this->code[$this->cursor] && ($this->cursor + 2 < $this->end) && '.' === $this->code[$this->cursor + 1] && '.' === $this->code[$this->cursor + 2]) { - $this->pushToken(Token::SPREAD_TYPE, '...'); - $this->moveCursor('...'); - } - // arrow function - elseif ('=' === $this->code[$this->cursor] && '>' === $this->code[$this->cursor + 1]) { - $this->pushToken(Token::ARROW_TYPE, '=>'); - $this->moveCursor('=>'); - } - // operators - elseif (preg_match($this->regexes['operator'], $this->code, $match, 0, $this->cursor)) { - $this->pushToken(/* Token::OPERATOR_TYPE */ 8, preg_replace('/\s+/', ' ', $match[0])); - $this->moveCursor($match[0]); - } - // names - elseif (preg_match(self::REGEX_NAME, $this->code, $match, 0, $this->cursor)) { - $this->pushToken(/* Token::NAME_TYPE */ 5, $match[0]); - $this->moveCursor($match[0]); - } - // numbers - elseif (preg_match(self::REGEX_NUMBER, $this->code, $match, 0, $this->cursor)) { - $number = (float) $match[0]; // floats - if (ctype_digit($match[0]) && $number <= \PHP_INT_MAX) { - $number = (int) $match[0]; // integers lower than the maximum - } - $this->pushToken(/* Token::NUMBER_TYPE */ 6, $number); - $this->moveCursor($match[0]); - } - // punctuation - elseif (str_contains(self::PUNCTUATION, $this->code[$this->cursor])) { - // opening bracket - if (str_contains('([{', $this->code[$this->cursor])) { - $this->brackets[] = [$this->code[$this->cursor], $this->lineno]; - } - // closing bracket - elseif (str_contains(')]}', $this->code[$this->cursor])) { - if (empty($this->brackets)) { - throw new SyntaxError(sprintf('Unexpected "%s".', $this->code[$this->cursor]), $this->lineno, $this->source); - } - - list($expect, $lineno) = array_pop($this->brackets); - if ($this->code[$this->cursor] != strtr($expect, '([{', ')]}')) { - throw new SyntaxError(sprintf('Unclosed "%s".', $expect), $lineno, $this->source); - } - } - - $this->pushToken(/* Token::PUNCTUATION_TYPE */ 9, $this->code[$this->cursor]); - ++$this->cursor; - } - // strings - elseif (preg_match(self::REGEX_STRING, $this->code, $match, 0, $this->cursor)) { - $this->pushToken(/* Token::STRING_TYPE */ 7, stripcslashes(substr($match[0], 1, -1))); - $this->moveCursor($match[0]); - } - // opening double quoted string - elseif (preg_match(self::REGEX_DQ_STRING_DELIM, $this->code, $match, 0, $this->cursor)) { - $this->brackets[] = ['"', $this->lineno]; - $this->pushState(self::STATE_STRING); - $this->moveCursor($match[0]); - } - // unlexable - else { - throw new SyntaxError(sprintf('Unexpected character "%s".', $this->code[$this->cursor]), $this->lineno, $this->source); - } - } - - private function lexRawData(): void - { - if (!preg_match($this->regexes['lex_raw_data'], $this->code, $match, \PREG_OFFSET_CAPTURE, $this->cursor)) { - throw new SyntaxError('Unexpected end of file: Unclosed "verbatim" block.', $this->lineno, $this->source); - } - - $text = substr($this->code, $this->cursor, $match[0][1] - $this->cursor); - $this->moveCursor($text.$match[0][0]); - - // trim? - if (isset($match[1][0])) { - if ($this->options['whitespace_trim'] === $match[1][0]) { - // whitespace_trim detected ({%-, {{- or {#-) - $text = rtrim($text); - } else { - // whitespace_line_trim detected ({%~, {{~ or {#~) - // don't trim \r and \n - $text = rtrim($text, " \t\0\x0B"); - } - } - - $this->pushToken(/* Token::TEXT_TYPE */ 0, $text); - } - - private function lexComment(): void - { - if (!preg_match($this->regexes['lex_comment'], $this->code, $match, \PREG_OFFSET_CAPTURE, $this->cursor)) { - throw new SyntaxError('Unclosed comment.', $this->lineno, $this->source); - } - - $this->moveCursor(substr($this->code, $this->cursor, $match[0][1] - $this->cursor).$match[0][0]); - } - - private function lexString(): void - { - if (preg_match($this->regexes['interpolation_start'], $this->code, $match, 0, $this->cursor)) { - $this->brackets[] = [$this->options['interpolation'][0], $this->lineno]; - $this->pushToken(/* Token::INTERPOLATION_START_TYPE */ 10); - $this->moveCursor($match[0]); - $this->pushState(self::STATE_INTERPOLATION); - } elseif (preg_match(self::REGEX_DQ_STRING_PART, $this->code, $match, 0, $this->cursor) && '' !== $match[0]) { - $this->pushToken(/* Token::STRING_TYPE */ 7, stripcslashes($match[0])); - $this->moveCursor($match[0]); - } elseif (preg_match(self::REGEX_DQ_STRING_DELIM, $this->code, $match, 0, $this->cursor)) { - list($expect, $lineno) = array_pop($this->brackets); - if ('"' != $this->code[$this->cursor]) { - throw new SyntaxError(sprintf('Unclosed "%s".', $expect), $lineno, $this->source); - } - - $this->popState(); - ++$this->cursor; - } else { - // unlexable - throw new SyntaxError(sprintf('Unexpected character "%s".', $this->code[$this->cursor]), $this->lineno, $this->source); - } - } - - private function lexInterpolation(): void - { - $bracket = end($this->brackets); - if ($this->options['interpolation'][0] === $bracket[0] && preg_match($this->regexes['interpolation_end'], $this->code, $match, 0, $this->cursor)) { - array_pop($this->brackets); - $this->pushToken(/* Token::INTERPOLATION_END_TYPE */ 11); - $this->moveCursor($match[0]); - $this->popState(); - } else { - $this->lexExpression(); - } - } - - private function pushToken($type, $value = ''): void - { - // do not push empty text tokens - if (/* Token::TEXT_TYPE */ 0 === $type && '' === $value) { - return; - } - - $this->tokens[] = new Token($type, $value, $this->lineno); - } - - private function moveCursor($text): void - { - $this->cursor += \strlen($text); - $this->lineno += substr_count($text, "\n"); - } - - private function getOperatorRegex(): string - { - $operators = array_merge( - ['='], - array_keys($this->env->getUnaryOperators()), - array_keys($this->env->getBinaryOperators()) - ); - - $operators = array_combine($operators, array_map('strlen', $operators)); - arsort($operators); - - $regex = []; - foreach ($operators as $operator => $length) { - // an operator that ends with a character must be followed by - // a whitespace, a parenthesis, an opening map [ or sequence { - $r = preg_quote($operator, '/'); - if (ctype_alpha($operator[$length - 1])) { - $r .= '(?=[\s()\[{])'; - } - - // an operator that begins with a character must not have a dot or pipe before - if (ctype_alpha($operator[0])) { - $r = '(?states[] = $this->state; - $this->state = $state; - } - - private function popState(): void - { - if (0 === \count($this->states)) { - throw new \LogicException('Cannot pop state without a previous state.'); - } - - $this->state = array_pop($this->states); - } -} diff --git a/system/vendor/twig/twig/src/Loader/ArrayLoader.php b/system/vendor/twig/twig/src/Loader/ArrayLoader.php deleted file mode 100644 index 5d726c3..0000000 --- a/system/vendor/twig/twig/src/Loader/ArrayLoader.php +++ /dev/null @@ -1,77 +0,0 @@ - - */ -final class ArrayLoader implements LoaderInterface -{ - private $templates = []; - - /** - * @param array $templates An array of templates (keys are the names, and values are the source code) - */ - public function __construct(array $templates = []) - { - $this->templates = $templates; - } - - public function setTemplate(string $name, string $template): void - { - $this->templates[$name] = $template; - } - - public function getSourceContext(string $name): Source - { - if (!isset($this->templates[$name])) { - throw new LoaderError(sprintf('Template "%s" is not defined.', $name)); - } - - return new Source($this->templates[$name], $name); - } - - public function exists(string $name): bool - { - return isset($this->templates[$name]); - } - - public function getCacheKey(string $name): string - { - if (!isset($this->templates[$name])) { - throw new LoaderError(sprintf('Template "%s" is not defined.', $name)); - } - - return $name.':'.$this->templates[$name]; - } - - public function isFresh(string $name, int $time): bool - { - if (!isset($this->templates[$name])) { - throw new LoaderError(sprintf('Template "%s" is not defined.', $name)); - } - - return true; - } -} diff --git a/system/vendor/twig/twig/src/Loader/ChainLoader.php b/system/vendor/twig/twig/src/Loader/ChainLoader.php deleted file mode 100644 index fbf4f3a..0000000 --- a/system/vendor/twig/twig/src/Loader/ChainLoader.php +++ /dev/null @@ -1,119 +0,0 @@ - - */ -final class ChainLoader implements LoaderInterface -{ - private $hasSourceCache = []; - private $loaders = []; - - /** - * @param LoaderInterface[] $loaders - */ - public function __construct(array $loaders = []) - { - foreach ($loaders as $loader) { - $this->addLoader($loader); - } - } - - public function addLoader(LoaderInterface $loader): void - { - $this->loaders[] = $loader; - $this->hasSourceCache = []; - } - - /** - * @return LoaderInterface[] - */ - public function getLoaders(): array - { - return $this->loaders; - } - - public function getSourceContext(string $name): Source - { - $exceptions = []; - foreach ($this->loaders as $loader) { - if (!$loader->exists($name)) { - continue; - } - - try { - return $loader->getSourceContext($name); - } catch (LoaderError $e) { - $exceptions[] = $e->getMessage(); - } - } - - throw new LoaderError(sprintf('Template "%s" is not defined%s.', $name, $exceptions ? ' ('.implode(', ', $exceptions).')' : '')); - } - - public function exists(string $name): bool - { - if (isset($this->hasSourceCache[$name])) { - return $this->hasSourceCache[$name]; - } - - foreach ($this->loaders as $loader) { - if ($loader->exists($name)) { - return $this->hasSourceCache[$name] = true; - } - } - - return $this->hasSourceCache[$name] = false; - } - - public function getCacheKey(string $name): string - { - $exceptions = []; - foreach ($this->loaders as $loader) { - if (!$loader->exists($name)) { - continue; - } - - try { - return $loader->getCacheKey($name); - } catch (LoaderError $e) { - $exceptions[] = \get_class($loader).': '.$e->getMessage(); - } - } - - throw new LoaderError(sprintf('Template "%s" is not defined%s.', $name, $exceptions ? ' ('.implode(', ', $exceptions).')' : '')); - } - - public function isFresh(string $name, int $time): bool - { - $exceptions = []; - foreach ($this->loaders as $loader) { - if (!$loader->exists($name)) { - continue; - } - - try { - return $loader->isFresh($name, $time); - } catch (LoaderError $e) { - $exceptions[] = \get_class($loader).': '.$e->getMessage(); - } - } - - throw new LoaderError(sprintf('Template "%s" is not defined%s.', $name, $exceptions ? ' ('.implode(', ', $exceptions).')' : '')); - } -} diff --git a/system/vendor/twig/twig/src/Loader/FilesystemLoader.php b/system/vendor/twig/twig/src/Loader/FilesystemLoader.php deleted file mode 100644 index 1073a40..0000000 --- a/system/vendor/twig/twig/src/Loader/FilesystemLoader.php +++ /dev/null @@ -1,283 +0,0 @@ - - */ -class FilesystemLoader implements LoaderInterface -{ - /** Identifier of the main namespace. */ - public const MAIN_NAMESPACE = '__main__'; - - protected $paths = []; - protected $cache = []; - protected $errorCache = []; - - private $rootPath; - - /** - * @param string|array $paths A path or an array of paths where to look for templates - * @param string|null $rootPath The root path common to all relative paths (null for getcwd()) - */ - public function __construct($paths = [], string $rootPath = null) - { - $this->rootPath = ($rootPath ?? getcwd()).\DIRECTORY_SEPARATOR; - if (null !== $rootPath && false !== ($realPath = realpath($rootPath))) { - $this->rootPath = $realPath.\DIRECTORY_SEPARATOR; - } - - if ($paths) { - $this->setPaths($paths); - } - } - - /** - * Returns the paths to the templates. - */ - public function getPaths(string $namespace = self::MAIN_NAMESPACE): array - { - return $this->paths[$namespace] ?? []; - } - - /** - * Returns the path namespaces. - * - * The main namespace is always defined. - */ - public function getNamespaces(): array - { - return array_keys($this->paths); - } - - /** - * @param string|array $paths A path or an array of paths where to look for templates - */ - public function setPaths($paths, string $namespace = self::MAIN_NAMESPACE): void - { - if (!\is_array($paths)) { - $paths = [$paths]; - } - - $this->paths[$namespace] = []; - foreach ($paths as $path) { - $this->addPath($path, $namespace); - } - } - - /** - * @throws LoaderError - */ - public function addPath(string $path, string $namespace = self::MAIN_NAMESPACE): void - { - // invalidate the cache - $this->cache = $this->errorCache = []; - - $checkPath = $this->isAbsolutePath($path) ? $path : $this->rootPath.$path; - if (!is_dir($checkPath)) { - throw new LoaderError(sprintf('The "%s" directory does not exist ("%s").', $path, $checkPath)); - } - - $this->paths[$namespace][] = rtrim($path, '/\\'); - } - - /** - * @throws LoaderError - */ - public function prependPath(string $path, string $namespace = self::MAIN_NAMESPACE): void - { - // invalidate the cache - $this->cache = $this->errorCache = []; - - $checkPath = $this->isAbsolutePath($path) ? $path : $this->rootPath.$path; - if (!is_dir($checkPath)) { - throw new LoaderError(sprintf('The "%s" directory does not exist ("%s").', $path, $checkPath)); - } - - $path = rtrim($path, '/\\'); - - if (!isset($this->paths[$namespace])) { - $this->paths[$namespace][] = $path; - } else { - array_unshift($this->paths[$namespace], $path); - } - } - - public function getSourceContext(string $name): Source - { - if (null === $path = $this->findTemplate($name)) { - return new Source('', $name, ''); - } - - return new Source(file_get_contents($path), $name, $path); - } - - public function getCacheKey(string $name): string - { - if (null === $path = $this->findTemplate($name)) { - return ''; - } - $len = \strlen($this->rootPath); - if (0 === strncmp($this->rootPath, $path, $len)) { - return substr($path, $len); - } - - return $path; - } - - /** - * @return bool - */ - public function exists(string $name) - { - $name = $this->normalizeName($name); - - if (isset($this->cache[$name])) { - return true; - } - - return null !== $this->findTemplate($name, false); - } - - public function isFresh(string $name, int $time): bool - { - // false support to be removed in 3.0 - if (null === $path = $this->findTemplate($name)) { - return false; - } - - return filemtime($path) < $time; - } - - /** - * @return string|null - */ - protected function findTemplate(string $name, bool $throw = true) - { - $name = $this->normalizeName($name); - - if (isset($this->cache[$name])) { - return $this->cache[$name]; - } - - if (isset($this->errorCache[$name])) { - if (!$throw) { - return null; - } - - throw new LoaderError($this->errorCache[$name]); - } - - try { - list($namespace, $shortname) = $this->parseName($name); - - $this->validateName($shortname); - } catch (LoaderError $e) { - if (!$throw) { - return null; - } - - throw $e; - } - - if (!isset($this->paths[$namespace])) { - $this->errorCache[$name] = sprintf('There are no registered paths for namespace "%s".', $namespace); - - if (!$throw) { - return null; - } - - throw new LoaderError($this->errorCache[$name]); - } - - foreach ($this->paths[$namespace] as $path) { - if (!$this->isAbsolutePath($path)) { - $path = $this->rootPath.$path; - } - - if (is_file($path.'/'.$shortname)) { - if (false !== $realpath = realpath($path.'/'.$shortname)) { - return $this->cache[$name] = $realpath; - } - - return $this->cache[$name] = $path.'/'.$shortname; - } - } - - $this->errorCache[$name] = sprintf('Unable to find template "%s" (looked into: %s).', $name, implode(', ', $this->paths[$namespace])); - - if (!$throw) { - return null; - } - - throw new LoaderError($this->errorCache[$name]); - } - - private function normalizeName(string $name): string - { - return preg_replace('#/{2,}#', '/', str_replace('\\', '/', $name)); - } - - private function parseName(string $name, string $default = self::MAIN_NAMESPACE): array - { - if (isset($name[0]) && '@' == $name[0]) { - if (false === $pos = strpos($name, '/')) { - throw new LoaderError(sprintf('Malformed namespaced template name "%s" (expecting "@namespace/template_name").', $name)); - } - - $namespace = substr($name, 1, $pos - 1); - $shortname = substr($name, $pos + 1); - - return [$namespace, $shortname]; - } - - return [$default, $name]; - } - - private function validateName(string $name): void - { - if (str_contains($name, "\0")) { - throw new LoaderError('A template name cannot contain NUL bytes.'); - } - - $name = ltrim($name, '/'); - $parts = explode('/', $name); - $level = 0; - foreach ($parts as $part) { - if ('..' === $part) { - --$level; - } elseif ('.' !== $part) { - ++$level; - } - - if ($level < 0) { - throw new LoaderError(sprintf('Looks like you try to load a template outside configured directories (%s).', $name)); - } - } - } - - private function isAbsolutePath(string $file): bool - { - return strspn($file, '/\\', 0, 1) - || (\strlen($file) > 3 && ctype_alpha($file[0]) - && ':' === $file[1] - && strspn($file, '/\\', 2, 1) - ) - || null !== parse_url($file, \PHP_URL_SCHEME) - ; - } -} diff --git a/system/vendor/twig/twig/src/Loader/LoaderInterface.php b/system/vendor/twig/twig/src/Loader/LoaderInterface.php deleted file mode 100644 index fec7e85..0000000 --- a/system/vendor/twig/twig/src/Loader/LoaderInterface.php +++ /dev/null @@ -1,49 +0,0 @@ - - */ -interface LoaderInterface -{ - /** - * Returns the source context for a given template logical name. - * - * @throws LoaderError When $name is not found - */ - public function getSourceContext(string $name): Source; - - /** - * Gets the cache key to use for the cache for a given template name. - * - * @throws LoaderError When $name is not found - */ - public function getCacheKey(string $name): string; - - /** - * @param int $time Timestamp of the last modification time of the cached template - * - * @throws LoaderError When $name is not found - */ - public function isFresh(string $name, int $time): bool; - - /** - * @return bool - */ - public function exists(string $name); -} diff --git a/system/vendor/twig/twig/src/Markup.php b/system/vendor/twig/twig/src/Markup.php deleted file mode 100644 index 1788acc..0000000 --- a/system/vendor/twig/twig/src/Markup.php +++ /dev/null @@ -1,52 +0,0 @@ - - */ -class Markup implements \Countable, \JsonSerializable -{ - private $content; - private $charset; - - public function __construct($content, $charset) - { - $this->content = (string) $content; - $this->charset = $charset; - } - - public function __toString() - { - return $this->content; - } - - /** - * @return int - */ - #[\ReturnTypeWillChange] - public function count() - { - return mb_strlen($this->content, $this->charset); - } - - /** - * @return mixed - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return $this->content; - } -} diff --git a/system/vendor/twig/twig/src/Node/AutoEscapeNode.php b/system/vendor/twig/twig/src/Node/AutoEscapeNode.php deleted file mode 100644 index cd97041..0000000 --- a/system/vendor/twig/twig/src/Node/AutoEscapeNode.php +++ /dev/null @@ -1,38 +0,0 @@ - - */ -class AutoEscapeNode extends Node -{ - public function __construct($value, Node $body, int $lineno, string $tag = 'autoescape') - { - parent::__construct(['body' => $body], ['value' => $value], $lineno, $tag); - } - - public function compile(Compiler $compiler): void - { - $compiler->subcompile($this->getNode('body')); - } -} diff --git a/system/vendor/twig/twig/src/Node/BlockNode.php b/system/vendor/twig/twig/src/Node/BlockNode.php deleted file mode 100644 index 0632ba7..0000000 --- a/system/vendor/twig/twig/src/Node/BlockNode.php +++ /dev/null @@ -1,44 +0,0 @@ - - */ -class BlockNode extends Node -{ - public function __construct(string $name, Node $body, int $lineno, string $tag = null) - { - parent::__construct(['body' => $body], ['name' => $name], $lineno, $tag); - } - - public function compile(Compiler $compiler): void - { - $compiler - ->addDebugInfo($this) - ->write(sprintf("public function block_%s(\$context, array \$blocks = [])\n", $this->getAttribute('name')), "{\n") - ->indent() - ->write("\$macros = \$this->macros;\n") - ; - - $compiler - ->subcompile($this->getNode('body')) - ->outdent() - ->write("}\n\n") - ; - } -} diff --git a/system/vendor/twig/twig/src/Node/BlockReferenceNode.php b/system/vendor/twig/twig/src/Node/BlockReferenceNode.php deleted file mode 100644 index cc8af5b..0000000 --- a/system/vendor/twig/twig/src/Node/BlockReferenceNode.php +++ /dev/null @@ -1,36 +0,0 @@ - - */ -class BlockReferenceNode extends Node implements NodeOutputInterface -{ - public function __construct(string $name, int $lineno, string $tag = null) - { - parent::__construct([], ['name' => $name], $lineno, $tag); - } - - public function compile(Compiler $compiler): void - { - $compiler - ->addDebugInfo($this) - ->write(sprintf("\$this->displayBlock('%s', \$context, \$blocks);\n", $this->getAttribute('name'))) - ; - } -} diff --git a/system/vendor/twig/twig/src/Node/BodyNode.php b/system/vendor/twig/twig/src/Node/BodyNode.php deleted file mode 100644 index 041cbf6..0000000 --- a/system/vendor/twig/twig/src/Node/BodyNode.php +++ /dev/null @@ -1,21 +0,0 @@ - - */ -class BodyNode extends Node -{ -} diff --git a/system/vendor/twig/twig/src/Node/CheckSecurityCallNode.php b/system/vendor/twig/twig/src/Node/CheckSecurityCallNode.php deleted file mode 100644 index a78a38d..0000000 --- a/system/vendor/twig/twig/src/Node/CheckSecurityCallNode.php +++ /dev/null @@ -1,28 +0,0 @@ - - */ -class CheckSecurityCallNode extends Node -{ - public function compile(Compiler $compiler) - { - $compiler - ->write("\$this->sandbox = \$this->env->getExtension('\Twig\Extension\SandboxExtension');\n") - ->write("\$this->checkSecurity();\n") - ; - } -} diff --git a/system/vendor/twig/twig/src/Node/CheckSecurityNode.php b/system/vendor/twig/twig/src/Node/CheckSecurityNode.php deleted file mode 100644 index 4727327..0000000 --- a/system/vendor/twig/twig/src/Node/CheckSecurityNode.php +++ /dev/null @@ -1,88 +0,0 @@ - - */ -class CheckSecurityNode extends Node -{ - private $usedFilters; - private $usedTags; - private $usedFunctions; - - public function __construct(array $usedFilters, array $usedTags, array $usedFunctions) - { - $this->usedFilters = $usedFilters; - $this->usedTags = $usedTags; - $this->usedFunctions = $usedFunctions; - - parent::__construct(); - } - - public function compile(Compiler $compiler): void - { - $tags = $filters = $functions = []; - foreach (['tags', 'filters', 'functions'] as $type) { - foreach ($this->{'used'.ucfirst($type)} as $name => $node) { - if ($node instanceof Node) { - ${$type}[$name] = $node->getTemplateLine(); - } else { - ${$type}[$node] = null; - } - } - } - - $compiler - ->write("\n") - ->write("public function checkSecurity()\n") - ->write("{\n") - ->indent() - ->write('static $tags = ')->repr(array_filter($tags))->raw(";\n") - ->write('static $filters = ')->repr(array_filter($filters))->raw(";\n") - ->write('static $functions = ')->repr(array_filter($functions))->raw(";\n\n") - ->write("try {\n") - ->indent() - ->write("\$this->sandbox->checkSecurity(\n") - ->indent() - ->write(!$tags ? "[],\n" : "['".implode("', '", array_keys($tags))."'],\n") - ->write(!$filters ? "[],\n" : "['".implode("', '", array_keys($filters))."'],\n") - ->write(!$functions ? "[]\n" : "['".implode("', '", array_keys($functions))."']\n") - ->outdent() - ->write(");\n") - ->outdent() - ->write("} catch (SecurityError \$e) {\n") - ->indent() - ->write("\$e->setSourceContext(\$this->source);\n\n") - ->write("if (\$e instanceof SecurityNotAllowedTagError && isset(\$tags[\$e->getTagName()])) {\n") - ->indent() - ->write("\$e->setTemplateLine(\$tags[\$e->getTagName()]);\n") - ->outdent() - ->write("} elseif (\$e instanceof SecurityNotAllowedFilterError && isset(\$filters[\$e->getFilterName()])) {\n") - ->indent() - ->write("\$e->setTemplateLine(\$filters[\$e->getFilterName()]);\n") - ->outdent() - ->write("} elseif (\$e instanceof SecurityNotAllowedFunctionError && isset(\$functions[\$e->getFunctionName()])) {\n") - ->indent() - ->write("\$e->setTemplateLine(\$functions[\$e->getFunctionName()]);\n") - ->outdent() - ->write("}\n\n") - ->write("throw \$e;\n") - ->outdent() - ->write("}\n\n") - ->outdent() - ->write("}\n") - ; - } -} diff --git a/system/vendor/twig/twig/src/Node/CheckToStringNode.php b/system/vendor/twig/twig/src/Node/CheckToStringNode.php deleted file mode 100644 index c7a9d69..0000000 --- a/system/vendor/twig/twig/src/Node/CheckToStringNode.php +++ /dev/null @@ -1,45 +0,0 @@ - - */ -class CheckToStringNode extends AbstractExpression -{ - public function __construct(AbstractExpression $expr) - { - parent::__construct(['expr' => $expr], [], $expr->getTemplateLine(), $expr->getNodeTag()); - } - - public function compile(Compiler $compiler): void - { - $expr = $this->getNode('expr'); - $compiler - ->raw('$this->sandbox->ensureToStringAllowed(') - ->subcompile($expr) - ->raw(', ') - ->repr($expr->getTemplateLine()) - ->raw(', $this->source)') - ; - } -} diff --git a/system/vendor/twig/twig/src/Node/DeprecatedNode.php b/system/vendor/twig/twig/src/Node/DeprecatedNode.php deleted file mode 100644 index 5ff4430..0000000 --- a/system/vendor/twig/twig/src/Node/DeprecatedNode.php +++ /dev/null @@ -1,53 +0,0 @@ - - */ -class DeprecatedNode extends Node -{ - public function __construct(AbstractExpression $expr, int $lineno, string $tag = null) - { - parent::__construct(['expr' => $expr], [], $lineno, $tag); - } - - public function compile(Compiler $compiler): void - { - $compiler->addDebugInfo($this); - - $expr = $this->getNode('expr'); - - if ($expr instanceof ConstantExpression) { - $compiler->write('@trigger_error(') - ->subcompile($expr); - } else { - $varName = $compiler->getVarName(); - $compiler->write(sprintf('$%s = ', $varName)) - ->subcompile($expr) - ->raw(";\n") - ->write(sprintf('@trigger_error($%s', $varName)); - } - - $compiler - ->raw('.') - ->string(sprintf(' ("%s" at line %d).', $this->getTemplateName(), $this->getTemplateLine())) - ->raw(", E_USER_DEPRECATED);\n") - ; - } -} diff --git a/system/vendor/twig/twig/src/Node/DoNode.php b/system/vendor/twig/twig/src/Node/DoNode.php deleted file mode 100644 index f7783d1..0000000 --- a/system/vendor/twig/twig/src/Node/DoNode.php +++ /dev/null @@ -1,38 +0,0 @@ - - */ -class DoNode extends Node -{ - public function __construct(AbstractExpression $expr, int $lineno, string $tag = null) - { - parent::__construct(['expr' => $expr], [], $lineno, $tag); - } - - public function compile(Compiler $compiler): void - { - $compiler - ->addDebugInfo($this) - ->write('') - ->subcompile($this->getNode('expr')) - ->raw(";\n") - ; - } -} diff --git a/system/vendor/twig/twig/src/Node/EmbedNode.php b/system/vendor/twig/twig/src/Node/EmbedNode.php deleted file mode 100644 index 903c3f6..0000000 --- a/system/vendor/twig/twig/src/Node/EmbedNode.php +++ /dev/null @@ -1,48 +0,0 @@ - - */ -class EmbedNode extends IncludeNode -{ - // we don't inject the module to avoid node visitors to traverse it twice (as it will be already visited in the main module) - public function __construct(string $name, int $index, ?AbstractExpression $variables, bool $only, bool $ignoreMissing, int $lineno, string $tag = null) - { - parent::__construct(new ConstantExpression('not_used', $lineno), $variables, $only, $ignoreMissing, $lineno, $tag); - - $this->setAttribute('name', $name); - $this->setAttribute('index', $index); - } - - protected function addGetTemplate(Compiler $compiler): void - { - $compiler - ->write('$this->loadTemplate(') - ->string($this->getAttribute('name')) - ->raw(', ') - ->repr($this->getTemplateName()) - ->raw(', ') - ->repr($this->getTemplateLine()) - ->raw(', ') - ->string($this->getAttribute('index')) - ->raw(')') - ; - } -} diff --git a/system/vendor/twig/twig/src/Node/Expression/AbstractExpression.php b/system/vendor/twig/twig/src/Node/Expression/AbstractExpression.php deleted file mode 100644 index 42da055..0000000 --- a/system/vendor/twig/twig/src/Node/Expression/AbstractExpression.php +++ /dev/null @@ -1,24 +0,0 @@ - - */ -abstract class AbstractExpression extends Node -{ -} diff --git a/system/vendor/twig/twig/src/Node/Expression/ArrayExpression.php b/system/vendor/twig/twig/src/Node/Expression/ArrayExpression.php deleted file mode 100644 index 4442838..0000000 --- a/system/vendor/twig/twig/src/Node/Expression/ArrayExpression.php +++ /dev/null @@ -1,135 +0,0 @@ -index = -1; - foreach ($this->getKeyValuePairs() as $pair) { - if ($pair['key'] instanceof ConstantExpression && ctype_digit((string) $pair['key']->getAttribute('value')) && $pair['key']->getAttribute('value') > $this->index) { - $this->index = $pair['key']->getAttribute('value'); - } - } - } - - public function getKeyValuePairs(): array - { - $pairs = []; - foreach (array_chunk($this->nodes, 2) as $pair) { - $pairs[] = [ - 'key' => $pair[0], - 'value' => $pair[1], - ]; - } - - return $pairs; - } - - public function hasElement(AbstractExpression $key): bool - { - foreach ($this->getKeyValuePairs() as $pair) { - // we compare the string representation of the keys - // to avoid comparing the line numbers which are not relevant here. - if ((string) $key === (string) $pair['key']) { - return true; - } - } - - return false; - } - - public function addElement(AbstractExpression $value, AbstractExpression $key = null): void - { - if (null === $key) { - $key = new ConstantExpression(++$this->index, $value->getTemplateLine()); - } - - array_push($this->nodes, $key, $value); - } - - public function compile(Compiler $compiler): void - { - $keyValuePairs = $this->getKeyValuePairs(); - $needsArrayMergeSpread = \PHP_VERSION_ID < 80100 && $this->hasSpreadItem($keyValuePairs); - - if ($needsArrayMergeSpread) { - $compiler->raw('twig_array_merge('); - } - $compiler->raw('['); - $first = true; - $reopenAfterMergeSpread = false; - $nextIndex = 0; - foreach ($keyValuePairs as $pair) { - if ($reopenAfterMergeSpread) { - $compiler->raw(', ['); - $reopenAfterMergeSpread = false; - } - - if ($needsArrayMergeSpread && $pair['value']->hasAttribute('spread')) { - $compiler->raw('], ')->subcompile($pair['value']); - $first = true; - $reopenAfterMergeSpread = true; - continue; - } - if (!$first) { - $compiler->raw(', '); - } - $first = false; - - if ($pair['value']->hasAttribute('spread') && !$needsArrayMergeSpread) { - $compiler->raw('...')->subcompile($pair['value']); - ++$nextIndex; - } else { - $key = $pair['key'] instanceof ConstantExpression ? $pair['key']->getAttribute('value') : null; - - if ($nextIndex !== $key) { - if (\is_int($key)) { - $nextIndex = $key + 1; - } - $compiler - ->subcompile($pair['key']) - ->raw(' => ') - ; - } else { - ++$nextIndex; - } - - $compiler->subcompile($pair['value']); - } - } - if (!$reopenAfterMergeSpread) { - $compiler->raw(']'); - } - if ($needsArrayMergeSpread) { - $compiler->raw(')'); - } - } - - private function hasSpreadItem(array $pairs): bool - { - foreach ($pairs as $pair) { - if ($pair['value']->hasAttribute('spread')) { - return true; - } - } - - return false; - } -} diff --git a/system/vendor/twig/twig/src/Node/Expression/ArrowFunctionExpression.php b/system/vendor/twig/twig/src/Node/Expression/ArrowFunctionExpression.php deleted file mode 100644 index eaad03c..0000000 --- a/system/vendor/twig/twig/src/Node/Expression/ArrowFunctionExpression.php +++ /dev/null @@ -1,64 +0,0 @@ - - */ -class ArrowFunctionExpression extends AbstractExpression -{ - public function __construct(AbstractExpression $expr, Node $names, $lineno, $tag = null) - { - parent::__construct(['expr' => $expr, 'names' => $names], [], $lineno, $tag); - } - - public function compile(Compiler $compiler): void - { - $compiler - ->addDebugInfo($this) - ->raw('function (') - ; - foreach ($this->getNode('names') as $i => $name) { - if ($i) { - $compiler->raw(', '); - } - - $compiler - ->raw('$__') - ->raw($name->getAttribute('name')) - ->raw('__') - ; - } - $compiler - ->raw(') use ($context, $macros) { ') - ; - foreach ($this->getNode('names') as $name) { - $compiler - ->raw('$context["') - ->raw($name->getAttribute('name')) - ->raw('"] = $__') - ->raw($name->getAttribute('name')) - ->raw('__; ') - ; - } - $compiler - ->raw('return ') - ->subcompile($this->getNode('expr')) - ->raw('; }') - ; - } -} diff --git a/system/vendor/twig/twig/src/Node/Expression/AssignNameExpression.php b/system/vendor/twig/twig/src/Node/Expression/AssignNameExpression.php deleted file mode 100644 index 7dd1bc4..0000000 --- a/system/vendor/twig/twig/src/Node/Expression/AssignNameExpression.php +++ /dev/null @@ -1,27 +0,0 @@ -raw('$context[') - ->string($this->getAttribute('name')) - ->raw(']') - ; - } -} diff --git a/system/vendor/twig/twig/src/Node/Expression/Binary/AbstractBinary.php b/system/vendor/twig/twig/src/Node/Expression/Binary/AbstractBinary.php deleted file mode 100644 index c424e5c..0000000 --- a/system/vendor/twig/twig/src/Node/Expression/Binary/AbstractBinary.php +++ /dev/null @@ -1,42 +0,0 @@ - $left, 'right' => $right], [], $lineno); - } - - public function compile(Compiler $compiler): void - { - $compiler - ->raw('(') - ->subcompile($this->getNode('left')) - ->raw(' ') - ; - $this->operator($compiler); - $compiler - ->raw(' ') - ->subcompile($this->getNode('right')) - ->raw(')') - ; - } - - abstract public function operator(Compiler $compiler): Compiler; -} diff --git a/system/vendor/twig/twig/src/Node/Expression/Binary/AddBinary.php b/system/vendor/twig/twig/src/Node/Expression/Binary/AddBinary.php deleted file mode 100644 index ee4307e..0000000 --- a/system/vendor/twig/twig/src/Node/Expression/Binary/AddBinary.php +++ /dev/null @@ -1,23 +0,0 @@ -raw('+'); - } -} diff --git a/system/vendor/twig/twig/src/Node/Expression/Binary/AndBinary.php b/system/vendor/twig/twig/src/Node/Expression/Binary/AndBinary.php deleted file mode 100644 index 5f2380d..0000000 --- a/system/vendor/twig/twig/src/Node/Expression/Binary/AndBinary.php +++ /dev/null @@ -1,23 +0,0 @@ -raw('&&'); - } -} diff --git a/system/vendor/twig/twig/src/Node/Expression/Binary/BitwiseAndBinary.php b/system/vendor/twig/twig/src/Node/Expression/Binary/BitwiseAndBinary.php deleted file mode 100644 index db7d6d6..0000000 --- a/system/vendor/twig/twig/src/Node/Expression/Binary/BitwiseAndBinary.php +++ /dev/null @@ -1,23 +0,0 @@ -raw('&'); - } -} diff --git a/system/vendor/twig/twig/src/Node/Expression/Binary/BitwiseOrBinary.php b/system/vendor/twig/twig/src/Node/Expression/Binary/BitwiseOrBinary.php deleted file mode 100644 index ce803dd..0000000 --- a/system/vendor/twig/twig/src/Node/Expression/Binary/BitwiseOrBinary.php +++ /dev/null @@ -1,23 +0,0 @@ -raw('|'); - } -} diff --git a/system/vendor/twig/twig/src/Node/Expression/Binary/BitwiseXorBinary.php b/system/vendor/twig/twig/src/Node/Expression/Binary/BitwiseXorBinary.php deleted file mode 100644 index 5c29785..0000000 --- a/system/vendor/twig/twig/src/Node/Expression/Binary/BitwiseXorBinary.php +++ /dev/null @@ -1,23 +0,0 @@ -raw('^'); - } -} diff --git a/system/vendor/twig/twig/src/Node/Expression/Binary/ConcatBinary.php b/system/vendor/twig/twig/src/Node/Expression/Binary/ConcatBinary.php deleted file mode 100644 index f825ab8..0000000 --- a/system/vendor/twig/twig/src/Node/Expression/Binary/ConcatBinary.php +++ /dev/null @@ -1,23 +0,0 @@ -raw('.'); - } -} diff --git a/system/vendor/twig/twig/src/Node/Expression/Binary/DivBinary.php b/system/vendor/twig/twig/src/Node/Expression/Binary/DivBinary.php deleted file mode 100644 index e3817d1..0000000 --- a/system/vendor/twig/twig/src/Node/Expression/Binary/DivBinary.php +++ /dev/null @@ -1,23 +0,0 @@ -raw('/'); - } -} diff --git a/system/vendor/twig/twig/src/Node/Expression/Binary/EndsWithBinary.php b/system/vendor/twig/twig/src/Node/Expression/Binary/EndsWithBinary.php deleted file mode 100644 index 73fa20b..0000000 --- a/system/vendor/twig/twig/src/Node/Expression/Binary/EndsWithBinary.php +++ /dev/null @@ -1,35 +0,0 @@ -getVarName(); - $right = $compiler->getVarName(); - $compiler - ->raw(sprintf('(is_string($%s = ', $left)) - ->subcompile($this->getNode('left')) - ->raw(sprintf(') && is_string($%s = ', $right)) - ->subcompile($this->getNode('right')) - ->raw(sprintf(') && str_ends_with($%1$s, $%2$s))', $left, $right)) - ; - } - - public function operator(Compiler $compiler): Compiler - { - return $compiler->raw(''); - } -} diff --git a/system/vendor/twig/twig/src/Node/Expression/Binary/EqualBinary.php b/system/vendor/twig/twig/src/Node/Expression/Binary/EqualBinary.php deleted file mode 100644 index 6b48549..0000000 --- a/system/vendor/twig/twig/src/Node/Expression/Binary/EqualBinary.php +++ /dev/null @@ -1,39 +0,0 @@ -= 80000) { - parent::compile($compiler); - - return; - } - - $compiler - ->raw('(0 === twig_compare(') - ->subcompile($this->getNode('left')) - ->raw(', ') - ->subcompile($this->getNode('right')) - ->raw('))') - ; - } - - public function operator(Compiler $compiler): Compiler - { - return $compiler->raw('=='); - } -} diff --git a/system/vendor/twig/twig/src/Node/Expression/Binary/FloorDivBinary.php b/system/vendor/twig/twig/src/Node/Expression/Binary/FloorDivBinary.php deleted file mode 100644 index d7e7980..0000000 --- a/system/vendor/twig/twig/src/Node/Expression/Binary/FloorDivBinary.php +++ /dev/null @@ -1,29 +0,0 @@ -raw('(int) floor('); - parent::compile($compiler); - $compiler->raw(')'); - } - - public function operator(Compiler $compiler): Compiler - { - return $compiler->raw('/'); - } -} diff --git a/system/vendor/twig/twig/src/Node/Expression/Binary/GreaterBinary.php b/system/vendor/twig/twig/src/Node/Expression/Binary/GreaterBinary.php deleted file mode 100644 index e1dd067..0000000 --- a/system/vendor/twig/twig/src/Node/Expression/Binary/GreaterBinary.php +++ /dev/null @@ -1,39 +0,0 @@ -= 80000) { - parent::compile($compiler); - - return; - } - - $compiler - ->raw('(1 === twig_compare(') - ->subcompile($this->getNode('left')) - ->raw(', ') - ->subcompile($this->getNode('right')) - ->raw('))') - ; - } - - public function operator(Compiler $compiler): Compiler - { - return $compiler->raw('>'); - } -} diff --git a/system/vendor/twig/twig/src/Node/Expression/Binary/GreaterEqualBinary.php b/system/vendor/twig/twig/src/Node/Expression/Binary/GreaterEqualBinary.php deleted file mode 100644 index df9bfcf..0000000 --- a/system/vendor/twig/twig/src/Node/Expression/Binary/GreaterEqualBinary.php +++ /dev/null @@ -1,39 +0,0 @@ -= 80000) { - parent::compile($compiler); - - return; - } - - $compiler - ->raw('(0 <= twig_compare(') - ->subcompile($this->getNode('left')) - ->raw(', ') - ->subcompile($this->getNode('right')) - ->raw('))') - ; - } - - public function operator(Compiler $compiler): Compiler - { - return $compiler->raw('>='); - } -} diff --git a/system/vendor/twig/twig/src/Node/Expression/Binary/HasEveryBinary.php b/system/vendor/twig/twig/src/Node/Expression/Binary/HasEveryBinary.php deleted file mode 100644 index adfabd4..0000000 --- a/system/vendor/twig/twig/src/Node/Expression/Binary/HasEveryBinary.php +++ /dev/null @@ -1,33 +0,0 @@ -raw('twig_array_every($this->env, ') - ->subcompile($this->getNode('left')) - ->raw(', ') - ->subcompile($this->getNode('right')) - ->raw(')') - ; - } - - public function operator(Compiler $compiler): Compiler - { - return $compiler->raw(''); - } -} diff --git a/system/vendor/twig/twig/src/Node/Expression/Binary/HasSomeBinary.php b/system/vendor/twig/twig/src/Node/Expression/Binary/HasSomeBinary.php deleted file mode 100644 index 270da36..0000000 --- a/system/vendor/twig/twig/src/Node/Expression/Binary/HasSomeBinary.php +++ /dev/null @@ -1,33 +0,0 @@ -raw('twig_array_some($this->env, ') - ->subcompile($this->getNode('left')) - ->raw(', ') - ->subcompile($this->getNode('right')) - ->raw(')') - ; - } - - public function operator(Compiler $compiler): Compiler - { - return $compiler->raw(''); - } -} diff --git a/system/vendor/twig/twig/src/Node/Expression/Binary/InBinary.php b/system/vendor/twig/twig/src/Node/Expression/Binary/InBinary.php deleted file mode 100644 index 6dbfa97..0000000 --- a/system/vendor/twig/twig/src/Node/Expression/Binary/InBinary.php +++ /dev/null @@ -1,33 +0,0 @@ -raw('twig_in_filter(') - ->subcompile($this->getNode('left')) - ->raw(', ') - ->subcompile($this->getNode('right')) - ->raw(')') - ; - } - - public function operator(Compiler $compiler): Compiler - { - return $compiler->raw('in'); - } -} diff --git a/system/vendor/twig/twig/src/Node/Expression/Binary/LessBinary.php b/system/vendor/twig/twig/src/Node/Expression/Binary/LessBinary.php deleted file mode 100644 index 598e629..0000000 --- a/system/vendor/twig/twig/src/Node/Expression/Binary/LessBinary.php +++ /dev/null @@ -1,39 +0,0 @@ -= 80000) { - parent::compile($compiler); - - return; - } - - $compiler - ->raw('(-1 === twig_compare(') - ->subcompile($this->getNode('left')) - ->raw(', ') - ->subcompile($this->getNode('right')) - ->raw('))') - ; - } - - public function operator(Compiler $compiler): Compiler - { - return $compiler->raw('<'); - } -} diff --git a/system/vendor/twig/twig/src/Node/Expression/Binary/LessEqualBinary.php b/system/vendor/twig/twig/src/Node/Expression/Binary/LessEqualBinary.php deleted file mode 100644 index e3c4af5..0000000 --- a/system/vendor/twig/twig/src/Node/Expression/Binary/LessEqualBinary.php +++ /dev/null @@ -1,39 +0,0 @@ -= 80000) { - parent::compile($compiler); - - return; - } - - $compiler - ->raw('(0 >= twig_compare(') - ->subcompile($this->getNode('left')) - ->raw(', ') - ->subcompile($this->getNode('right')) - ->raw('))') - ; - } - - public function operator(Compiler $compiler): Compiler - { - return $compiler->raw('<='); - } -} diff --git a/system/vendor/twig/twig/src/Node/Expression/Binary/MatchesBinary.php b/system/vendor/twig/twig/src/Node/Expression/Binary/MatchesBinary.php deleted file mode 100644 index a8bce6f..0000000 --- a/system/vendor/twig/twig/src/Node/Expression/Binary/MatchesBinary.php +++ /dev/null @@ -1,33 +0,0 @@ -raw('twig_matches(') - ->subcompile($this->getNode('right')) - ->raw(', ') - ->subcompile($this->getNode('left')) - ->raw(')') - ; - } - - public function operator(Compiler $compiler): Compiler - { - return $compiler->raw(''); - } -} diff --git a/system/vendor/twig/twig/src/Node/Expression/Binary/ModBinary.php b/system/vendor/twig/twig/src/Node/Expression/Binary/ModBinary.php deleted file mode 100644 index 271b45c..0000000 --- a/system/vendor/twig/twig/src/Node/Expression/Binary/ModBinary.php +++ /dev/null @@ -1,23 +0,0 @@ -raw('%'); - } -} diff --git a/system/vendor/twig/twig/src/Node/Expression/Binary/MulBinary.php b/system/vendor/twig/twig/src/Node/Expression/Binary/MulBinary.php deleted file mode 100644 index 6d4c1e0..0000000 --- a/system/vendor/twig/twig/src/Node/Expression/Binary/MulBinary.php +++ /dev/null @@ -1,23 +0,0 @@ -raw('*'); - } -} diff --git a/system/vendor/twig/twig/src/Node/Expression/Binary/NotEqualBinary.php b/system/vendor/twig/twig/src/Node/Expression/Binary/NotEqualBinary.php deleted file mode 100644 index db47a28..0000000 --- a/system/vendor/twig/twig/src/Node/Expression/Binary/NotEqualBinary.php +++ /dev/null @@ -1,39 +0,0 @@ -= 80000) { - parent::compile($compiler); - - return; - } - - $compiler - ->raw('(0 !== twig_compare(') - ->subcompile($this->getNode('left')) - ->raw(', ') - ->subcompile($this->getNode('right')) - ->raw('))') - ; - } - - public function operator(Compiler $compiler): Compiler - { - return $compiler->raw('!='); - } -} diff --git a/system/vendor/twig/twig/src/Node/Expression/Binary/NotInBinary.php b/system/vendor/twig/twig/src/Node/Expression/Binary/NotInBinary.php deleted file mode 100644 index fcba6cc..0000000 --- a/system/vendor/twig/twig/src/Node/Expression/Binary/NotInBinary.php +++ /dev/null @@ -1,33 +0,0 @@ -raw('!twig_in_filter(') - ->subcompile($this->getNode('left')) - ->raw(', ') - ->subcompile($this->getNode('right')) - ->raw(')') - ; - } - - public function operator(Compiler $compiler): Compiler - { - return $compiler->raw('not in'); - } -} diff --git a/system/vendor/twig/twig/src/Node/Expression/Binary/OrBinary.php b/system/vendor/twig/twig/src/Node/Expression/Binary/OrBinary.php deleted file mode 100644 index 21f87c9..0000000 --- a/system/vendor/twig/twig/src/Node/Expression/Binary/OrBinary.php +++ /dev/null @@ -1,23 +0,0 @@ -raw('||'); - } -} diff --git a/system/vendor/twig/twig/src/Node/Expression/Binary/PowerBinary.php b/system/vendor/twig/twig/src/Node/Expression/Binary/PowerBinary.php deleted file mode 100644 index c9f4c66..0000000 --- a/system/vendor/twig/twig/src/Node/Expression/Binary/PowerBinary.php +++ /dev/null @@ -1,22 +0,0 @@ -raw('**'); - } -} diff --git a/system/vendor/twig/twig/src/Node/Expression/Binary/RangeBinary.php b/system/vendor/twig/twig/src/Node/Expression/Binary/RangeBinary.php deleted file mode 100644 index 55982c8..0000000 --- a/system/vendor/twig/twig/src/Node/Expression/Binary/RangeBinary.php +++ /dev/null @@ -1,33 +0,0 @@ -raw('range(') - ->subcompile($this->getNode('left')) - ->raw(', ') - ->subcompile($this->getNode('right')) - ->raw(')') - ; - } - - public function operator(Compiler $compiler): Compiler - { - return $compiler->raw('..'); - } -} diff --git a/system/vendor/twig/twig/src/Node/Expression/Binary/SpaceshipBinary.php b/system/vendor/twig/twig/src/Node/Expression/Binary/SpaceshipBinary.php deleted file mode 100644 index ae5a4a4..0000000 --- a/system/vendor/twig/twig/src/Node/Expression/Binary/SpaceshipBinary.php +++ /dev/null @@ -1,22 +0,0 @@ -raw('<=>'); - } -} diff --git a/system/vendor/twig/twig/src/Node/Expression/Binary/StartsWithBinary.php b/system/vendor/twig/twig/src/Node/Expression/Binary/StartsWithBinary.php deleted file mode 100644 index 22eff92..0000000 --- a/system/vendor/twig/twig/src/Node/Expression/Binary/StartsWithBinary.php +++ /dev/null @@ -1,35 +0,0 @@ -getVarName(); - $right = $compiler->getVarName(); - $compiler - ->raw(sprintf('(is_string($%s = ', $left)) - ->subcompile($this->getNode('left')) - ->raw(sprintf(') && is_string($%s = ', $right)) - ->subcompile($this->getNode('right')) - ->raw(sprintf(') && str_starts_with($%1$s, $%2$s))', $left, $right)) - ; - } - - public function operator(Compiler $compiler): Compiler - { - return $compiler->raw(''); - } -} diff --git a/system/vendor/twig/twig/src/Node/Expression/Binary/SubBinary.php b/system/vendor/twig/twig/src/Node/Expression/Binary/SubBinary.php deleted file mode 100644 index eeb87fa..0000000 --- a/system/vendor/twig/twig/src/Node/Expression/Binary/SubBinary.php +++ /dev/null @@ -1,23 +0,0 @@ -raw('-'); - } -} diff --git a/system/vendor/twig/twig/src/Node/Expression/BlockReferenceExpression.php b/system/vendor/twig/twig/src/Node/Expression/BlockReferenceExpression.php deleted file mode 100644 index b1e2a8f..0000000 --- a/system/vendor/twig/twig/src/Node/Expression/BlockReferenceExpression.php +++ /dev/null @@ -1,86 +0,0 @@ - - */ -class BlockReferenceExpression extends AbstractExpression -{ - public function __construct(Node $name, ?Node $template, int $lineno, string $tag = null) - { - $nodes = ['name' => $name]; - if (null !== $template) { - $nodes['template'] = $template; - } - - parent::__construct($nodes, ['is_defined_test' => false, 'output' => false], $lineno, $tag); - } - - public function compile(Compiler $compiler): void - { - if ($this->getAttribute('is_defined_test')) { - $this->compileTemplateCall($compiler, 'hasBlock'); - } else { - if ($this->getAttribute('output')) { - $compiler->addDebugInfo($this); - - $this - ->compileTemplateCall($compiler, 'displayBlock') - ->raw(";\n"); - } else { - $this->compileTemplateCall($compiler, 'renderBlock'); - } - } - } - - private function compileTemplateCall(Compiler $compiler, string $method): Compiler - { - if (!$this->hasNode('template')) { - $compiler->write('$this'); - } else { - $compiler - ->write('$this->loadTemplate(') - ->subcompile($this->getNode('template')) - ->raw(', ') - ->repr($this->getTemplateName()) - ->raw(', ') - ->repr($this->getTemplateLine()) - ->raw(')') - ; - } - - $compiler->raw(sprintf('->%s', $method)); - - return $this->compileBlockArguments($compiler); - } - - private function compileBlockArguments(Compiler $compiler): Compiler - { - $compiler - ->raw('(') - ->subcompile($this->getNode('name')) - ->raw(', $context'); - - if (!$this->hasNode('template')) { - $compiler->raw(', $blocks'); - } - - return $compiler->raw(')'); - } -} diff --git a/system/vendor/twig/twig/src/Node/Expression/CallExpression.php b/system/vendor/twig/twig/src/Node/Expression/CallExpression.php deleted file mode 100644 index 3a2d7a4..0000000 --- a/system/vendor/twig/twig/src/Node/Expression/CallExpression.php +++ /dev/null @@ -1,321 +0,0 @@ -getAttribute('callable'); - - if (\is_string($callable) && !str_contains($callable, '::')) { - $compiler->raw($callable); - } else { - [$r, $callable] = $this->reflectCallable($callable); - - if (\is_string($callable)) { - $compiler->raw($callable); - } elseif (\is_array($callable) && \is_string($callable[0])) { - if (!$r instanceof \ReflectionMethod || $r->isStatic()) { - $compiler->raw(sprintf('%s::%s', $callable[0], $callable[1])); - } else { - $compiler->raw(sprintf('$this->env->getRuntime(\'%s\')->%s', $callable[0], $callable[1])); - } - } elseif (\is_array($callable) && $callable[0] instanceof ExtensionInterface) { - $class = \get_class($callable[0]); - if (!$compiler->getEnvironment()->hasExtension($class)) { - // Compile a non-optimized call to trigger a \Twig\Error\RuntimeError, which cannot be a compile-time error - $compiler->raw(sprintf('$this->env->getExtension(\'%s\')', $class)); - } else { - $compiler->raw(sprintf('$this->extensions[\'%s\']', ltrim($class, '\\'))); - } - - $compiler->raw(sprintf('->%s', $callable[1])); - } else { - $compiler->raw(sprintf('$this->env->get%s(\'%s\')->getCallable()', ucfirst($this->getAttribute('type')), $this->getAttribute('name'))); - } - } - - $this->compileArguments($compiler); - } - - protected function compileArguments(Compiler $compiler, $isArray = false): void - { - $compiler->raw($isArray ? '[' : '('); - - $first = true; - - if ($this->hasAttribute('needs_environment') && $this->getAttribute('needs_environment')) { - $compiler->raw('$this->env'); - $first = false; - } - - if ($this->hasAttribute('needs_context') && $this->getAttribute('needs_context')) { - if (!$first) { - $compiler->raw(', '); - } - $compiler->raw('$context'); - $first = false; - } - - if ($this->hasAttribute('arguments')) { - foreach ($this->getAttribute('arguments') as $argument) { - if (!$first) { - $compiler->raw(', '); - } - $compiler->string($argument); - $first = false; - } - } - - if ($this->hasNode('node')) { - if (!$first) { - $compiler->raw(', '); - } - $compiler->subcompile($this->getNode('node')); - $first = false; - } - - if ($this->hasNode('arguments')) { - $callable = $this->getAttribute('callable'); - $arguments = $this->getArguments($callable, $this->getNode('arguments')); - foreach ($arguments as $node) { - if (!$first) { - $compiler->raw(', '); - } - $compiler->subcompile($node); - $first = false; - } - } - - $compiler->raw($isArray ? ']' : ')'); - } - - protected function getArguments($callable, $arguments) - { - $callType = $this->getAttribute('type'); - $callName = $this->getAttribute('name'); - - $parameters = []; - $named = false; - foreach ($arguments as $name => $node) { - if (!\is_int($name)) { - $named = true; - $name = $this->normalizeName($name); - } elseif ($named) { - throw new SyntaxError(sprintf('Positional arguments cannot be used after named arguments for %s "%s".', $callType, $callName), $this->getTemplateLine(), $this->getSourceContext()); - } - - $parameters[$name] = $node; - } - - $isVariadic = $this->hasAttribute('is_variadic') && $this->getAttribute('is_variadic'); - if (!$named && !$isVariadic) { - return $parameters; - } - - if (!$callable) { - if ($named) { - $message = sprintf('Named arguments are not supported for %s "%s".', $callType, $callName); - } else { - $message = sprintf('Arbitrary positional arguments are not supported for %s "%s".', $callType, $callName); - } - - throw new \LogicException($message); - } - - list($callableParameters, $isPhpVariadic) = $this->getCallableParameters($callable, $isVariadic); - $arguments = []; - $names = []; - $missingArguments = []; - $optionalArguments = []; - $pos = 0; - foreach ($callableParameters as $callableParameter) { - $name = $this->normalizeName($callableParameter->name); - if (\PHP_VERSION_ID >= 80000 && 'range' === $callable) { - if ('start' === $name) { - $name = 'low'; - } elseif ('end' === $name) { - $name = 'high'; - } - } - - $names[] = $name; - - if (\array_key_exists($name, $parameters)) { - if (\array_key_exists($pos, $parameters)) { - throw new SyntaxError(sprintf('Argument "%s" is defined twice for %s "%s".', $name, $callType, $callName), $this->getTemplateLine(), $this->getSourceContext()); - } - - if (\count($missingArguments)) { - throw new SyntaxError(sprintf( - 'Argument "%s" could not be assigned for %s "%s(%s)" because it is mapped to an internal PHP function which cannot determine default value for optional argument%s "%s".', - $name, $callType, $callName, implode(', ', $names), \count($missingArguments) > 1 ? 's' : '', implode('", "', $missingArguments) - ), $this->getTemplateLine(), $this->getSourceContext()); - } - - $arguments = array_merge($arguments, $optionalArguments); - $arguments[] = $parameters[$name]; - unset($parameters[$name]); - $optionalArguments = []; - } elseif (\array_key_exists($pos, $parameters)) { - $arguments = array_merge($arguments, $optionalArguments); - $arguments[] = $parameters[$pos]; - unset($parameters[$pos]); - $optionalArguments = []; - ++$pos; - } elseif ($callableParameter->isDefaultValueAvailable()) { - $optionalArguments[] = new ConstantExpression($callableParameter->getDefaultValue(), -1); - } elseif ($callableParameter->isOptional()) { - if (empty($parameters)) { - break; - } else { - $missingArguments[] = $name; - } - } else { - throw new SyntaxError(sprintf('Value for argument "%s" is required for %s "%s".', $name, $callType, $callName), $this->getTemplateLine(), $this->getSourceContext()); - } - } - - if ($isVariadic) { - $arbitraryArguments = $isPhpVariadic ? new VariadicExpression([], -1) : new ArrayExpression([], -1); - foreach ($parameters as $key => $value) { - if (\is_int($key)) { - $arbitraryArguments->addElement($value); - } else { - $arbitraryArguments->addElement($value, new ConstantExpression($key, -1)); - } - unset($parameters[$key]); - } - - if ($arbitraryArguments->count()) { - $arguments = array_merge($arguments, $optionalArguments); - $arguments[] = $arbitraryArguments; - } - } - - if (!empty($parameters)) { - $unknownParameter = null; - foreach ($parameters as $parameter) { - if ($parameter instanceof Node) { - $unknownParameter = $parameter; - break; - } - } - - throw new SyntaxError( - sprintf( - 'Unknown argument%s "%s" for %s "%s(%s)".', - \count($parameters) > 1 ? 's' : '', implode('", "', array_keys($parameters)), $callType, $callName, implode(', ', $names) - ), - $unknownParameter ? $unknownParameter->getTemplateLine() : $this->getTemplateLine(), - $unknownParameter ? $unknownParameter->getSourceContext() : $this->getSourceContext() - ); - } - - return $arguments; - } - - protected function normalizeName(string $name): string - { - return strtolower(preg_replace(['/([A-Z]+)([A-Z][a-z])/', '/([a-z\d])([A-Z])/'], ['\\1_\\2', '\\1_\\2'], $name)); - } - - private function getCallableParameters($callable, bool $isVariadic): array - { - [$r, , $callableName] = $this->reflectCallable($callable); - - $parameters = $r->getParameters(); - if ($this->hasNode('node')) { - array_shift($parameters); - } - if ($this->hasAttribute('needs_environment') && $this->getAttribute('needs_environment')) { - array_shift($parameters); - } - if ($this->hasAttribute('needs_context') && $this->getAttribute('needs_context')) { - array_shift($parameters); - } - if ($this->hasAttribute('arguments') && null !== $this->getAttribute('arguments')) { - foreach ($this->getAttribute('arguments') as $argument) { - array_shift($parameters); - } - } - $isPhpVariadic = false; - if ($isVariadic) { - $argument = end($parameters); - $isArray = $argument && $argument->hasType() && 'array' === $argument->getType()->getName(); - if ($isArray && $argument->isDefaultValueAvailable() && [] === $argument->getDefaultValue()) { - array_pop($parameters); - } elseif ($argument && $argument->isVariadic()) { - array_pop($parameters); - $isPhpVariadic = true; - } else { - throw new \LogicException(sprintf('The last parameter of "%s" for %s "%s" must be an array with default value, eg. "array $arg = []".', $callableName, $this->getAttribute('type'), $this->getAttribute('name'))); - } - } - - return [$parameters, $isPhpVariadic]; - } - - private function reflectCallable($callable) - { - if (null !== $this->reflector) { - return $this->reflector; - } - - if (\is_string($callable) && false !== $pos = strpos($callable, '::')) { - $callable = [substr($callable, 0, $pos), substr($callable, 2 + $pos)]; - } - - if (\is_array($callable) && method_exists($callable[0], $callable[1])) { - $r = new \ReflectionMethod($callable[0], $callable[1]); - - return $this->reflector = [$r, $callable, $r->class.'::'.$r->name]; - } - - $checkVisibility = $callable instanceof \Closure; - try { - $closure = \Closure::fromCallable($callable); - } catch (\TypeError $e) { - throw new \LogicException(sprintf('Callback for %s "%s" is not callable in the current scope.', $this->getAttribute('type'), $this->getAttribute('name')), 0, $e); - } - $r = new \ReflectionFunction($closure); - - if (str_contains($r->name, '{closure}')) { - return $this->reflector = [$r, $callable, 'Closure']; - } - - if ($object = $r->getClosureThis()) { - $callable = [$object, $r->name]; - $callableName = get_debug_type($object).'::'.$r->name; - } elseif (\PHP_VERSION_ID >= 80111 && $class = $r->getClosureCalledClass()) { - $callableName = $class->name.'::'.$r->name; - } elseif (\PHP_VERSION_ID < 80111 && $class = $r->getClosureScopeClass()) { - $callableName = (\is_array($callable) ? $callable[0] : $class->name).'::'.$r->name; - } else { - $callable = $callableName = $r->name; - } - - if ($checkVisibility && \is_array($callable) && method_exists(...$callable) && !(new \ReflectionMethod(...$callable))->isPublic()) { - $callable = $r->getClosure(); - } - - return $this->reflector = [$r, $callable, $callableName]; - } -} diff --git a/system/vendor/twig/twig/src/Node/Expression/ConditionalExpression.php b/system/vendor/twig/twig/src/Node/Expression/ConditionalExpression.php deleted file mode 100644 index d7db993..0000000 --- a/system/vendor/twig/twig/src/Node/Expression/ConditionalExpression.php +++ /dev/null @@ -1,45 +0,0 @@ - $expr1, 'expr2' => $expr2, 'expr3' => $expr3], [], $lineno); - } - - public function compile(Compiler $compiler): void - { - // Ternary with no then uses Elvis operator - if ($this->getNode('expr1') === $this->getNode('expr2')) { - $compiler - ->raw('((') - ->subcompile($this->getNode('expr1')) - ->raw(') ?: (') - ->subcompile($this->getNode('expr3')) - ->raw('))'); - } else { - $compiler - ->raw('((') - ->subcompile($this->getNode('expr1')) - ->raw(') ? (') - ->subcompile($this->getNode('expr2')) - ->raw(') : (') - ->subcompile($this->getNode('expr3')) - ->raw('))'); - } - } -} diff --git a/system/vendor/twig/twig/src/Node/Expression/ConstantExpression.php b/system/vendor/twig/twig/src/Node/Expression/ConstantExpression.php deleted file mode 100644 index 7ddbcc6..0000000 --- a/system/vendor/twig/twig/src/Node/Expression/ConstantExpression.php +++ /dev/null @@ -1,28 +0,0 @@ - $value], $lineno); - } - - public function compile(Compiler $compiler): void - { - $compiler->repr($this->getAttribute('value')); - } -} diff --git a/system/vendor/twig/twig/src/Node/Expression/Filter/DefaultFilter.php b/system/vendor/twig/twig/src/Node/Expression/Filter/DefaultFilter.php deleted file mode 100644 index 6a572d4..0000000 --- a/system/vendor/twig/twig/src/Node/Expression/Filter/DefaultFilter.php +++ /dev/null @@ -1,52 +0,0 @@ - - */ -class DefaultFilter extends FilterExpression -{ - public function __construct(Node $node, ConstantExpression $filterName, Node $arguments, int $lineno, string $tag = null) - { - $default = new FilterExpression($node, new ConstantExpression('default', $node->getTemplateLine()), $arguments, $node->getTemplateLine()); - - if ('default' === $filterName->getAttribute('value') && ($node instanceof NameExpression || $node instanceof GetAttrExpression)) { - $test = new DefinedTest(clone $node, 'defined', new Node(), $node->getTemplateLine()); - $false = \count($arguments) ? $arguments->getNode(0) : new ConstantExpression('', $node->getTemplateLine()); - - $node = new ConditionalExpression($test, $default, $false, $node->getTemplateLine()); - } else { - $node = $default; - } - - parent::__construct($node, $filterName, $arguments, $lineno, $tag); - } - - public function compile(Compiler $compiler): void - { - $compiler->subcompile($this->getNode('node')); - } -} diff --git a/system/vendor/twig/twig/src/Node/Expression/FilterExpression.php b/system/vendor/twig/twig/src/Node/Expression/FilterExpression.php deleted file mode 100644 index 0fc1588..0000000 --- a/system/vendor/twig/twig/src/Node/Expression/FilterExpression.php +++ /dev/null @@ -1,40 +0,0 @@ - $node, 'filter' => $filterName, 'arguments' => $arguments], [], $lineno, $tag); - } - - public function compile(Compiler $compiler): void - { - $name = $this->getNode('filter')->getAttribute('value'); - $filter = $compiler->getEnvironment()->getFilter($name); - - $this->setAttribute('name', $name); - $this->setAttribute('type', 'filter'); - $this->setAttribute('needs_environment', $filter->needsEnvironment()); - $this->setAttribute('needs_context', $filter->needsContext()); - $this->setAttribute('arguments', $filter->getArguments()); - $this->setAttribute('callable', $filter->getCallable()); - $this->setAttribute('is_variadic', $filter->isVariadic()); - - $this->compileCallable($compiler); - } -} diff --git a/system/vendor/twig/twig/src/Node/Expression/FunctionExpression.php b/system/vendor/twig/twig/src/Node/Expression/FunctionExpression.php deleted file mode 100644 index 7126977..0000000 --- a/system/vendor/twig/twig/src/Node/Expression/FunctionExpression.php +++ /dev/null @@ -1,43 +0,0 @@ - $arguments], ['name' => $name, 'is_defined_test' => false], $lineno); - } - - public function compile(Compiler $compiler) - { - $name = $this->getAttribute('name'); - $function = $compiler->getEnvironment()->getFunction($name); - - $this->setAttribute('name', $name); - $this->setAttribute('type', 'function'); - $this->setAttribute('needs_environment', $function->needsEnvironment()); - $this->setAttribute('needs_context', $function->needsContext()); - $this->setAttribute('arguments', $function->getArguments()); - $callable = $function->getCallable(); - if ('constant' === $name && $this->getAttribute('is_defined_test')) { - $callable = 'twig_constant_is_defined'; - } - $this->setAttribute('callable', $callable); - $this->setAttribute('is_variadic', $function->isVariadic()); - - $this->compileCallable($compiler); - } -} diff --git a/system/vendor/twig/twig/src/Node/Expression/GetAttrExpression.php b/system/vendor/twig/twig/src/Node/Expression/GetAttrExpression.php deleted file mode 100644 index e6a75ce..0000000 --- a/system/vendor/twig/twig/src/Node/Expression/GetAttrExpression.php +++ /dev/null @@ -1,87 +0,0 @@ - $node, 'attribute' => $attribute]; - if (null !== $arguments) { - $nodes['arguments'] = $arguments; - } - - parent::__construct($nodes, ['type' => $type, 'is_defined_test' => false, 'ignore_strict_check' => false, 'optimizable' => true], $lineno); - } - - public function compile(Compiler $compiler): void - { - $env = $compiler->getEnvironment(); - - // optimize array calls - if ( - $this->getAttribute('optimizable') - && (!$env->isStrictVariables() || $this->getAttribute('ignore_strict_check')) - && !$this->getAttribute('is_defined_test') - && Template::ARRAY_CALL === $this->getAttribute('type') - ) { - $var = '$'.$compiler->getVarName(); - $compiler - ->raw('(('.$var.' = ') - ->subcompile($this->getNode('node')) - ->raw(') && is_array(') - ->raw($var) - ->raw(') || ') - ->raw($var) - ->raw(' instanceof ArrayAccess ? (') - ->raw($var) - ->raw('[') - ->subcompile($this->getNode('attribute')) - ->raw('] ?? null) : null)') - ; - - return; - } - - $compiler->raw('twig_get_attribute($this->env, $this->source, '); - - if ($this->getAttribute('ignore_strict_check')) { - $this->getNode('node')->setAttribute('ignore_strict_check', true); - } - - $compiler - ->subcompile($this->getNode('node')) - ->raw(', ') - ->subcompile($this->getNode('attribute')) - ; - - if ($this->hasNode('arguments')) { - $compiler->raw(', ')->subcompile($this->getNode('arguments')); - } else { - $compiler->raw(', []'); - } - - $compiler->raw(', ') - ->repr($this->getAttribute('type')) - ->raw(', ')->repr($this->getAttribute('is_defined_test')) - ->raw(', ')->repr($this->getAttribute('ignore_strict_check')) - ->raw(', ')->repr($env->hasExtension(SandboxExtension::class)) - ->raw(', ')->repr($this->getNode('node')->getTemplateLine()) - ->raw(')') - ; - } -} diff --git a/system/vendor/twig/twig/src/Node/Expression/InlinePrint.php b/system/vendor/twig/twig/src/Node/Expression/InlinePrint.php deleted file mode 100644 index 1ad4751..0000000 --- a/system/vendor/twig/twig/src/Node/Expression/InlinePrint.php +++ /dev/null @@ -1,35 +0,0 @@ - $node], [], $lineno); - } - - public function compile(Compiler $compiler): void - { - $compiler - ->raw('print (') - ->subcompile($this->getNode('node')) - ->raw(')') - ; - } -} diff --git a/system/vendor/twig/twig/src/Node/Expression/MethodCallExpression.php b/system/vendor/twig/twig/src/Node/Expression/MethodCallExpression.php deleted file mode 100644 index d5ec0b6..0000000 --- a/system/vendor/twig/twig/src/Node/Expression/MethodCallExpression.php +++ /dev/null @@ -1,62 +0,0 @@ - $node, 'arguments' => $arguments], ['method' => $method, 'safe' => false, 'is_defined_test' => false], $lineno); - - if ($node instanceof NameExpression) { - $node->setAttribute('always_defined', true); - } - } - - public function compile(Compiler $compiler): void - { - if ($this->getAttribute('is_defined_test')) { - $compiler - ->raw('method_exists($macros[') - ->repr($this->getNode('node')->getAttribute('name')) - ->raw('], ') - ->repr($this->getAttribute('method')) - ->raw(')') - ; - - return; - } - - $compiler - ->raw('twig_call_macro($macros[') - ->repr($this->getNode('node')->getAttribute('name')) - ->raw('], ') - ->repr($this->getAttribute('method')) - ->raw(', [') - ; - $first = true; - foreach ($this->getNode('arguments')->getKeyValuePairs() as $pair) { - if (!$first) { - $compiler->raw(', '); - } - $first = false; - - $compiler->subcompile($pair['value']); - } - $compiler - ->raw('], ') - ->repr($this->getTemplateLine()) - ->raw(', $context, $this->getSourceContext())'); - } -} diff --git a/system/vendor/twig/twig/src/Node/Expression/NameExpression.php b/system/vendor/twig/twig/src/Node/Expression/NameExpression.php deleted file mode 100644 index c3563f0..0000000 --- a/system/vendor/twig/twig/src/Node/Expression/NameExpression.php +++ /dev/null @@ -1,97 +0,0 @@ - '$this->getTemplateName()', - '_context' => '$context', - '_charset' => '$this->env->getCharset()', - ]; - - public function __construct(string $name, int $lineno) - { - parent::__construct([], ['name' => $name, 'is_defined_test' => false, 'ignore_strict_check' => false, 'always_defined' => false], $lineno); - } - - public function compile(Compiler $compiler): void - { - $name = $this->getAttribute('name'); - - $compiler->addDebugInfo($this); - - if ($this->getAttribute('is_defined_test')) { - if ($this->isSpecial()) { - $compiler->repr(true); - } elseif (\PHP_VERSION_ID >= 70400) { - $compiler - ->raw('array_key_exists(') - ->string($name) - ->raw(', $context)') - ; - } else { - $compiler - ->raw('(isset($context[') - ->string($name) - ->raw(']) || array_key_exists(') - ->string($name) - ->raw(', $context))') - ; - } - } elseif ($this->isSpecial()) { - $compiler->raw($this->specialVars[$name]); - } elseif ($this->getAttribute('always_defined')) { - $compiler - ->raw('$context[') - ->string($name) - ->raw(']') - ; - } else { - if ($this->getAttribute('ignore_strict_check') || !$compiler->getEnvironment()->isStrictVariables()) { - $compiler - ->raw('($context[') - ->string($name) - ->raw('] ?? null)') - ; - } else { - $compiler - ->raw('(isset($context[') - ->string($name) - ->raw(']) || array_key_exists(') - ->string($name) - ->raw(', $context) ? $context[') - ->string($name) - ->raw('] : (function () { throw new RuntimeError(\'Variable ') - ->string($name) - ->raw(' does not exist.\', ') - ->repr($this->lineno) - ->raw(', $this->source); })()') - ->raw(')') - ; - } - } - } - - public function isSpecial() - { - return isset($this->specialVars[$this->getAttribute('name')]); - } - - public function isSimple() - { - return !$this->isSpecial() && !$this->getAttribute('is_defined_test'); - } -} diff --git a/system/vendor/twig/twig/src/Node/Expression/NullCoalesceExpression.php b/system/vendor/twig/twig/src/Node/Expression/NullCoalesceExpression.php deleted file mode 100644 index a72bc4f..0000000 --- a/system/vendor/twig/twig/src/Node/Expression/NullCoalesceExpression.php +++ /dev/null @@ -1,60 +0,0 @@ -getTemplateLine()); - // for "block()", we don't need the null test as the return value is always a string - if (!$left instanceof BlockReferenceExpression) { - $test = new AndBinary( - $test, - new NotUnary(new NullTest($left, 'null', new Node(), $left->getTemplateLine()), $left->getTemplateLine()), - $left->getTemplateLine() - ); - } - - parent::__construct($test, $left, $right, $lineno); - } - - public function compile(Compiler $compiler): void - { - /* - * This optimizes only one case. PHP 7 also supports more complex expressions - * that can return null. So, for instance, if log is defined, log("foo") ?? "..." works, - * but log($a["foo"]) ?? "..." does not if $a["foo"] is not defined. More advanced - * cases might be implemented as an optimizer node visitor, but has not been done - * as benefits are probably not worth the added complexity. - */ - if ($this->getNode('expr2') instanceof NameExpression) { - $this->getNode('expr2')->setAttribute('always_defined', true); - $compiler - ->raw('((') - ->subcompile($this->getNode('expr2')) - ->raw(') ?? (') - ->subcompile($this->getNode('expr3')) - ->raw('))') - ; - } else { - parent::compile($compiler); - } - } -} diff --git a/system/vendor/twig/twig/src/Node/Expression/ParentExpression.php b/system/vendor/twig/twig/src/Node/Expression/ParentExpression.php deleted file mode 100644 index 2549197..0000000 --- a/system/vendor/twig/twig/src/Node/Expression/ParentExpression.php +++ /dev/null @@ -1,46 +0,0 @@ - - */ -class ParentExpression extends AbstractExpression -{ - public function __construct(string $name, int $lineno, string $tag = null) - { - parent::__construct([], ['output' => false, 'name' => $name], $lineno, $tag); - } - - public function compile(Compiler $compiler): void - { - if ($this->getAttribute('output')) { - $compiler - ->addDebugInfo($this) - ->write('$this->displayParentBlock(') - ->string($this->getAttribute('name')) - ->raw(", \$context, \$blocks);\n") - ; - } else { - $compiler - ->raw('$this->renderParentBlock(') - ->string($this->getAttribute('name')) - ->raw(', $context, $blocks)') - ; - } - } -} diff --git a/system/vendor/twig/twig/src/Node/Expression/TempNameExpression.php b/system/vendor/twig/twig/src/Node/Expression/TempNameExpression.php deleted file mode 100644 index 004c704..0000000 --- a/system/vendor/twig/twig/src/Node/Expression/TempNameExpression.php +++ /dev/null @@ -1,31 +0,0 @@ - $name], $lineno); - } - - public function compile(Compiler $compiler): void - { - $compiler - ->raw('$_') - ->raw($this->getAttribute('name')) - ->raw('_') - ; - } -} diff --git a/system/vendor/twig/twig/src/Node/Expression/Test/ConstantTest.php b/system/vendor/twig/twig/src/Node/Expression/Test/ConstantTest.php deleted file mode 100644 index 57e9319..0000000 --- a/system/vendor/twig/twig/src/Node/Expression/Test/ConstantTest.php +++ /dev/null @@ -1,49 +0,0 @@ - - */ -class ConstantTest extends TestExpression -{ - public function compile(Compiler $compiler): void - { - $compiler - ->raw('(') - ->subcompile($this->getNode('node')) - ->raw(' === constant(') - ; - - if ($this->getNode('arguments')->hasNode(1)) { - $compiler - ->raw('get_class(') - ->subcompile($this->getNode('arguments')->getNode(1)) - ->raw(')."::".') - ; - } - - $compiler - ->subcompile($this->getNode('arguments')->getNode(0)) - ->raw('))') - ; - } -} diff --git a/system/vendor/twig/twig/src/Node/Expression/Test/DefinedTest.php b/system/vendor/twig/twig/src/Node/Expression/Test/DefinedTest.php deleted file mode 100644 index 3953bbb..0000000 --- a/system/vendor/twig/twig/src/Node/Expression/Test/DefinedTest.php +++ /dev/null @@ -1,74 +0,0 @@ - - */ -class DefinedTest extends TestExpression -{ - public function __construct(Node $node, string $name, ?Node $arguments, int $lineno) - { - if ($node instanceof NameExpression) { - $node->setAttribute('is_defined_test', true); - } elseif ($node instanceof GetAttrExpression) { - $node->setAttribute('is_defined_test', true); - $this->changeIgnoreStrictCheck($node); - } elseif ($node instanceof BlockReferenceExpression) { - $node->setAttribute('is_defined_test', true); - } elseif ($node instanceof FunctionExpression && 'constant' === $node->getAttribute('name')) { - $node->setAttribute('is_defined_test', true); - } elseif ($node instanceof ConstantExpression || $node instanceof ArrayExpression) { - $node = new ConstantExpression(true, $node->getTemplateLine()); - } elseif ($node instanceof MethodCallExpression) { - $node->setAttribute('is_defined_test', true); - } else { - throw new SyntaxError('The "defined" test only works with simple variables.', $lineno); - } - - parent::__construct($node, $name, $arguments, $lineno); - } - - private function changeIgnoreStrictCheck(GetAttrExpression $node) - { - $node->setAttribute('optimizable', false); - $node->setAttribute('ignore_strict_check', true); - - if ($node->getNode('node') instanceof GetAttrExpression) { - $this->changeIgnoreStrictCheck($node->getNode('node')); - } - } - - public function compile(Compiler $compiler): void - { - $compiler->subcompile($this->getNode('node')); - } -} diff --git a/system/vendor/twig/twig/src/Node/Expression/Test/DivisiblebyTest.php b/system/vendor/twig/twig/src/Node/Expression/Test/DivisiblebyTest.php deleted file mode 100644 index 4cb3ee0..0000000 --- a/system/vendor/twig/twig/src/Node/Expression/Test/DivisiblebyTest.php +++ /dev/null @@ -1,36 +0,0 @@ - - */ -class DivisiblebyTest extends TestExpression -{ - public function compile(Compiler $compiler): void - { - $compiler - ->raw('(0 == ') - ->subcompile($this->getNode('node')) - ->raw(' % ') - ->subcompile($this->getNode('arguments')->getNode(0)) - ->raw(')') - ; - } -} diff --git a/system/vendor/twig/twig/src/Node/Expression/Test/EvenTest.php b/system/vendor/twig/twig/src/Node/Expression/Test/EvenTest.php deleted file mode 100644 index a0e3ed6..0000000 --- a/system/vendor/twig/twig/src/Node/Expression/Test/EvenTest.php +++ /dev/null @@ -1,35 +0,0 @@ - - */ -class EvenTest extends TestExpression -{ - public function compile(Compiler $compiler): void - { - $compiler - ->raw('(') - ->subcompile($this->getNode('node')) - ->raw(' % 2 == 0') - ->raw(')') - ; - } -} diff --git a/system/vendor/twig/twig/src/Node/Expression/Test/NullTest.php b/system/vendor/twig/twig/src/Node/Expression/Test/NullTest.php deleted file mode 100644 index 45b54ae..0000000 --- a/system/vendor/twig/twig/src/Node/Expression/Test/NullTest.php +++ /dev/null @@ -1,34 +0,0 @@ - - */ -class NullTest extends TestExpression -{ - public function compile(Compiler $compiler): void - { - $compiler - ->raw('(null === ') - ->subcompile($this->getNode('node')) - ->raw(')') - ; - } -} diff --git a/system/vendor/twig/twig/src/Node/Expression/Test/OddTest.php b/system/vendor/twig/twig/src/Node/Expression/Test/OddTest.php deleted file mode 100644 index d56c711..0000000 --- a/system/vendor/twig/twig/src/Node/Expression/Test/OddTest.php +++ /dev/null @@ -1,35 +0,0 @@ - - */ -class OddTest extends TestExpression -{ - public function compile(Compiler $compiler): void - { - $compiler - ->raw('(') - ->subcompile($this->getNode('node')) - ->raw(' % 2 != 0') - ->raw(')') - ; - } -} diff --git a/system/vendor/twig/twig/src/Node/Expression/Test/SameasTest.php b/system/vendor/twig/twig/src/Node/Expression/Test/SameasTest.php deleted file mode 100644 index c96d2bc..0000000 --- a/system/vendor/twig/twig/src/Node/Expression/Test/SameasTest.php +++ /dev/null @@ -1,34 +0,0 @@ - - */ -class SameasTest extends TestExpression -{ - public function compile(Compiler $compiler): void - { - $compiler - ->raw('(') - ->subcompile($this->getNode('node')) - ->raw(' === ') - ->subcompile($this->getNode('arguments')->getNode(0)) - ->raw(')') - ; - } -} diff --git a/system/vendor/twig/twig/src/Node/Expression/TestExpression.php b/system/vendor/twig/twig/src/Node/Expression/TestExpression.php deleted file mode 100644 index e518bd8..0000000 --- a/system/vendor/twig/twig/src/Node/Expression/TestExpression.php +++ /dev/null @@ -1,42 +0,0 @@ - $node]; - if (null !== $arguments) { - $nodes['arguments'] = $arguments; - } - - parent::__construct($nodes, ['name' => $name], $lineno); - } - - public function compile(Compiler $compiler): void - { - $name = $this->getAttribute('name'); - $test = $compiler->getEnvironment()->getTest($name); - - $this->setAttribute('name', $name); - $this->setAttribute('type', 'test'); - $this->setAttribute('arguments', $test->getArguments()); - $this->setAttribute('callable', $test->getCallable()); - $this->setAttribute('is_variadic', $test->isVariadic()); - - $this->compileCallable($compiler); - } -} diff --git a/system/vendor/twig/twig/src/Node/Expression/Unary/AbstractUnary.php b/system/vendor/twig/twig/src/Node/Expression/Unary/AbstractUnary.php deleted file mode 100644 index e31e3f8..0000000 --- a/system/vendor/twig/twig/src/Node/Expression/Unary/AbstractUnary.php +++ /dev/null @@ -1,34 +0,0 @@ - $node], [], $lineno); - } - - public function compile(Compiler $compiler): void - { - $compiler->raw(' '); - $this->operator($compiler); - $compiler->subcompile($this->getNode('node')); - } - - abstract public function operator(Compiler $compiler): Compiler; -} diff --git a/system/vendor/twig/twig/src/Node/Expression/Unary/NegUnary.php b/system/vendor/twig/twig/src/Node/Expression/Unary/NegUnary.php deleted file mode 100644 index dc2f235..0000000 --- a/system/vendor/twig/twig/src/Node/Expression/Unary/NegUnary.php +++ /dev/null @@ -1,23 +0,0 @@ -raw('-'); - } -} diff --git a/system/vendor/twig/twig/src/Node/Expression/Unary/NotUnary.php b/system/vendor/twig/twig/src/Node/Expression/Unary/NotUnary.php deleted file mode 100644 index 55c11ba..0000000 --- a/system/vendor/twig/twig/src/Node/Expression/Unary/NotUnary.php +++ /dev/null @@ -1,23 +0,0 @@ -raw('!'); - } -} diff --git a/system/vendor/twig/twig/src/Node/Expression/Unary/PosUnary.php b/system/vendor/twig/twig/src/Node/Expression/Unary/PosUnary.php deleted file mode 100644 index 4b0a062..0000000 --- a/system/vendor/twig/twig/src/Node/Expression/Unary/PosUnary.php +++ /dev/null @@ -1,23 +0,0 @@ -raw('+'); - } -} diff --git a/system/vendor/twig/twig/src/Node/Expression/VariadicExpression.php b/system/vendor/twig/twig/src/Node/Expression/VariadicExpression.php deleted file mode 100644 index a1bdb48..0000000 --- a/system/vendor/twig/twig/src/Node/Expression/VariadicExpression.php +++ /dev/null @@ -1,24 +0,0 @@ -raw('...'); - - parent::compile($compiler); - } -} diff --git a/system/vendor/twig/twig/src/Node/FlushNode.php b/system/vendor/twig/twig/src/Node/FlushNode.php deleted file mode 100644 index fa50a88..0000000 --- a/system/vendor/twig/twig/src/Node/FlushNode.php +++ /dev/null @@ -1,35 +0,0 @@ - - */ -class FlushNode extends Node -{ - public function __construct(int $lineno, string $tag) - { - parent::__construct([], [], $lineno, $tag); - } - - public function compile(Compiler $compiler): void - { - $compiler - ->addDebugInfo($this) - ->write("flush();\n") - ; - } -} diff --git a/system/vendor/twig/twig/src/Node/ForLoopNode.php b/system/vendor/twig/twig/src/Node/ForLoopNode.php deleted file mode 100644 index d5ce845..0000000 --- a/system/vendor/twig/twig/src/Node/ForLoopNode.php +++ /dev/null @@ -1,49 +0,0 @@ - - */ -class ForLoopNode extends Node -{ - public function __construct(int $lineno, string $tag = null) - { - parent::__construct([], ['with_loop' => false, 'ifexpr' => false, 'else' => false], $lineno, $tag); - } - - public function compile(Compiler $compiler): void - { - if ($this->getAttribute('else')) { - $compiler->write("\$context['_iterated'] = true;\n"); - } - - if ($this->getAttribute('with_loop')) { - $compiler - ->write("++\$context['loop']['index0'];\n") - ->write("++\$context['loop']['index'];\n") - ->write("\$context['loop']['first'] = false;\n") - ->write("if (isset(\$context['loop']['length'])) {\n") - ->indent() - ->write("--\$context['loop']['revindex0'];\n") - ->write("--\$context['loop']['revindex'];\n") - ->write("\$context['loop']['last'] = 0 === \$context['loop']['revindex0'];\n") - ->outdent() - ->write("}\n") - ; - } - } -} diff --git a/system/vendor/twig/twig/src/Node/ForNode.php b/system/vendor/twig/twig/src/Node/ForNode.php deleted file mode 100644 index 04addfb..0000000 --- a/system/vendor/twig/twig/src/Node/ForNode.php +++ /dev/null @@ -1,107 +0,0 @@ - - */ -class ForNode extends Node -{ - private $loop; - - public function __construct(AssignNameExpression $keyTarget, AssignNameExpression $valueTarget, AbstractExpression $seq, ?Node $ifexpr, Node $body, ?Node $else, int $lineno, string $tag = null) - { - $body = new Node([$body, $this->loop = new ForLoopNode($lineno, $tag)]); - - $nodes = ['key_target' => $keyTarget, 'value_target' => $valueTarget, 'seq' => $seq, 'body' => $body]; - if (null !== $else) { - $nodes['else'] = $else; - } - - parent::__construct($nodes, ['with_loop' => true], $lineno, $tag); - } - - public function compile(Compiler $compiler): void - { - $compiler - ->addDebugInfo($this) - ->write("\$context['_parent'] = \$context;\n") - ->write("\$context['_seq'] = twig_ensure_traversable(") - ->subcompile($this->getNode('seq')) - ->raw(");\n") - ; - - if ($this->hasNode('else')) { - $compiler->write("\$context['_iterated'] = false;\n"); - } - - if ($this->getAttribute('with_loop')) { - $compiler - ->write("\$context['loop'] = [\n") - ->write(" 'parent' => \$context['_parent'],\n") - ->write(" 'index0' => 0,\n") - ->write(" 'index' => 1,\n") - ->write(" 'first' => true,\n") - ->write("];\n") - ->write("if (is_array(\$context['_seq']) || (is_object(\$context['_seq']) && \$context['_seq'] instanceof \Countable)) {\n") - ->indent() - ->write("\$length = count(\$context['_seq']);\n") - ->write("\$context['loop']['revindex0'] = \$length - 1;\n") - ->write("\$context['loop']['revindex'] = \$length;\n") - ->write("\$context['loop']['length'] = \$length;\n") - ->write("\$context['loop']['last'] = 1 === \$length;\n") - ->outdent() - ->write("}\n") - ; - } - - $this->loop->setAttribute('else', $this->hasNode('else')); - $this->loop->setAttribute('with_loop', $this->getAttribute('with_loop')); - - $compiler - ->write("foreach (\$context['_seq'] as ") - ->subcompile($this->getNode('key_target')) - ->raw(' => ') - ->subcompile($this->getNode('value_target')) - ->raw(") {\n") - ->indent() - ->subcompile($this->getNode('body')) - ->outdent() - ->write("}\n") - ; - - if ($this->hasNode('else')) { - $compiler - ->write("if (!\$context['_iterated']) {\n") - ->indent() - ->subcompile($this->getNode('else')) - ->outdent() - ->write("}\n") - ; - } - - $compiler->write("\$_parent = \$context['_parent'];\n"); - - // remove some "private" loop variables (needed for nested loops) - $compiler->write('unset($context[\'_seq\'], $context[\'_iterated\'], $context[\''.$this->getNode('key_target')->getAttribute('name').'\'], $context[\''.$this->getNode('value_target')->getAttribute('name').'\'], $context[\'_parent\'], $context[\'loop\']);'."\n"); - - // keep the values set in the inner context for variables defined in the outer context - $compiler->write("\$context = array_intersect_key(\$context, \$_parent) + \$_parent;\n"); - } -} diff --git a/system/vendor/twig/twig/src/Node/IfNode.php b/system/vendor/twig/twig/src/Node/IfNode.php deleted file mode 100644 index 569ab79..0000000 --- a/system/vendor/twig/twig/src/Node/IfNode.php +++ /dev/null @@ -1,73 +0,0 @@ - - */ -class IfNode extends Node -{ - public function __construct(Node $tests, ?Node $else, int $lineno, string $tag = null) - { - $nodes = ['tests' => $tests]; - if (null !== $else) { - $nodes['else'] = $else; - } - - parent::__construct($nodes, [], $lineno, $tag); - } - - public function compile(Compiler $compiler): void - { - $compiler->addDebugInfo($this); - for ($i = 0, $count = \count($this->getNode('tests')); $i < $count; $i += 2) { - if ($i > 0) { - $compiler - ->outdent() - ->write('} elseif (') - ; - } else { - $compiler - ->write('if (') - ; - } - - $compiler - ->subcompile($this->getNode('tests')->getNode($i)) - ->raw(") {\n") - ->indent() - ; - // The node might not exists if the content is empty - if ($this->getNode('tests')->hasNode($i + 1)) { - $compiler->subcompile($this->getNode('tests')->getNode($i + 1)); - } - } - - if ($this->hasNode('else')) { - $compiler - ->outdent() - ->write("} else {\n") - ->indent() - ->subcompile($this->getNode('else')) - ; - } - - $compiler - ->outdent() - ->write("}\n"); - } -} diff --git a/system/vendor/twig/twig/src/Node/ImportNode.php b/system/vendor/twig/twig/src/Node/ImportNode.php deleted file mode 100644 index 5378d79..0000000 --- a/system/vendor/twig/twig/src/Node/ImportNode.php +++ /dev/null @@ -1,63 +0,0 @@ - - */ -class ImportNode extends Node -{ - public function __construct(AbstractExpression $expr, AbstractExpression $var, int $lineno, string $tag = null, bool $global = true) - { - parent::__construct(['expr' => $expr, 'var' => $var], ['global' => $global], $lineno, $tag); - } - - public function compile(Compiler $compiler): void - { - $compiler - ->addDebugInfo($this) - ->write('$macros[') - ->repr($this->getNode('var')->getAttribute('name')) - ->raw('] = ') - ; - - if ($this->getAttribute('global')) { - $compiler - ->raw('$this->macros[') - ->repr($this->getNode('var')->getAttribute('name')) - ->raw('] = ') - ; - } - - if ($this->getNode('expr') instanceof NameExpression && '_self' === $this->getNode('expr')->getAttribute('name')) { - $compiler->raw('$this'); - } else { - $compiler - ->raw('$this->loadTemplate(') - ->subcompile($this->getNode('expr')) - ->raw(', ') - ->repr($this->getTemplateName()) - ->raw(', ') - ->repr($this->getTemplateLine()) - ->raw(')->unwrap()') - ; - } - - $compiler->raw(";\n"); - } -} diff --git a/system/vendor/twig/twig/src/Node/IncludeNode.php b/system/vendor/twig/twig/src/Node/IncludeNode.php deleted file mode 100644 index d540d6b..0000000 --- a/system/vendor/twig/twig/src/Node/IncludeNode.php +++ /dev/null @@ -1,106 +0,0 @@ - - */ -class IncludeNode extends Node implements NodeOutputInterface -{ - public function __construct(AbstractExpression $expr, ?AbstractExpression $variables, bool $only, bool $ignoreMissing, int $lineno, string $tag = null) - { - $nodes = ['expr' => $expr]; - if (null !== $variables) { - $nodes['variables'] = $variables; - } - - parent::__construct($nodes, ['only' => $only, 'ignore_missing' => $ignoreMissing], $lineno, $tag); - } - - public function compile(Compiler $compiler): void - { - $compiler->addDebugInfo($this); - - if ($this->getAttribute('ignore_missing')) { - $template = $compiler->getVarName(); - - $compiler - ->write(sprintf("$%s = null;\n", $template)) - ->write("try {\n") - ->indent() - ->write(sprintf('$%s = ', $template)) - ; - - $this->addGetTemplate($compiler); - - $compiler - ->raw(";\n") - ->outdent() - ->write("} catch (LoaderError \$e) {\n") - ->indent() - ->write("// ignore missing template\n") - ->outdent() - ->write("}\n") - ->write(sprintf("if ($%s) {\n", $template)) - ->indent() - ->write(sprintf('$%s->display(', $template)) - ; - $this->addTemplateArguments($compiler); - $compiler - ->raw(");\n") - ->outdent() - ->write("}\n") - ; - } else { - $this->addGetTemplate($compiler); - $compiler->raw('->display('); - $this->addTemplateArguments($compiler); - $compiler->raw(");\n"); - } - } - - protected function addGetTemplate(Compiler $compiler) - { - $compiler - ->write('$this->loadTemplate(') - ->subcompile($this->getNode('expr')) - ->raw(', ') - ->repr($this->getTemplateName()) - ->raw(', ') - ->repr($this->getTemplateLine()) - ->raw(')') - ; - } - - protected function addTemplateArguments(Compiler $compiler) - { - if (!$this->hasNode('variables')) { - $compiler->raw(false === $this->getAttribute('only') ? '$context' : '[]'); - } elseif (false === $this->getAttribute('only')) { - $compiler - ->raw('twig_array_merge($context, ') - ->subcompile($this->getNode('variables')) - ->raw(')') - ; - } else { - $compiler->raw('twig_to_array('); - $compiler->subcompile($this->getNode('variables')); - $compiler->raw(')'); - } - } -} diff --git a/system/vendor/twig/twig/src/Node/MacroNode.php b/system/vendor/twig/twig/src/Node/MacroNode.php deleted file mode 100644 index 7f1b24d..0000000 --- a/system/vendor/twig/twig/src/Node/MacroNode.php +++ /dev/null @@ -1,113 +0,0 @@ - - */ -class MacroNode extends Node -{ - public const VARARGS_NAME = 'varargs'; - - public function __construct(string $name, Node $body, Node $arguments, int $lineno, string $tag = null) - { - foreach ($arguments as $argumentName => $argument) { - if (self::VARARGS_NAME === $argumentName) { - throw new SyntaxError(sprintf('The argument "%s" in macro "%s" cannot be defined because the variable "%s" is reserved for arbitrary arguments.', self::VARARGS_NAME, $name, self::VARARGS_NAME), $argument->getTemplateLine(), $argument->getSourceContext()); - } - } - - parent::__construct(['body' => $body, 'arguments' => $arguments], ['name' => $name], $lineno, $tag); - } - - public function compile(Compiler $compiler): void - { - $compiler - ->addDebugInfo($this) - ->write(sprintf('public function macro_%s(', $this->getAttribute('name'))) - ; - - $count = \count($this->getNode('arguments')); - $pos = 0; - foreach ($this->getNode('arguments') as $name => $default) { - $compiler - ->raw('$__'.$name.'__ = ') - ->subcompile($default) - ; - - if (++$pos < $count) { - $compiler->raw(', '); - } - } - - if ($count) { - $compiler->raw(', '); - } - - $compiler - ->raw('...$__varargs__') - ->raw(")\n") - ->write("{\n") - ->indent() - ->write("\$macros = \$this->macros;\n") - ->write("\$context = \$this->env->mergeGlobals([\n") - ->indent() - ; - - foreach ($this->getNode('arguments') as $name => $default) { - $compiler - ->write('') - ->string($name) - ->raw(' => $__'.$name.'__') - ->raw(",\n") - ; - } - - $compiler - ->write('') - ->string(self::VARARGS_NAME) - ->raw(' => ') - ; - - $compiler - ->raw("\$__varargs__,\n") - ->outdent() - ->write("]);\n\n") - ->write("\$blocks = [];\n\n") - ; - if ($compiler->getEnvironment()->isDebug()) { - $compiler->write("ob_start();\n"); - } else { - $compiler->write("ob_start(function () { return ''; });\n"); - } - $compiler - ->write("try {\n") - ->indent() - ->subcompile($this->getNode('body')) - ->raw("\n") - ->write("return ('' === \$tmp = ob_get_contents()) ? '' : new Markup(\$tmp, \$this->env->getCharset());\n") - ->outdent() - ->write("} finally {\n") - ->indent() - ->write("ob_end_clean();\n") - ->outdent() - ->write("}\n") - ->outdent() - ->write("}\n\n") - ; - } -} diff --git a/system/vendor/twig/twig/src/Node/ModuleNode.php b/system/vendor/twig/twig/src/Node/ModuleNode.php deleted file mode 100644 index 9b485ee..0000000 --- a/system/vendor/twig/twig/src/Node/ModuleNode.php +++ /dev/null @@ -1,473 +0,0 @@ - - */ -final class ModuleNode extends Node -{ - public function __construct(Node $body, ?AbstractExpression $parent, Node $blocks, Node $macros, Node $traits, $embeddedTemplates, Source $source) - { - $nodes = [ - 'body' => $body, - 'blocks' => $blocks, - 'macros' => $macros, - 'traits' => $traits, - 'display_start' => new Node(), - 'display_end' => new Node(), - 'constructor_start' => new Node(), - 'constructor_end' => new Node(), - 'class_end' => new Node(), - ]; - if (null !== $parent) { - $nodes['parent'] = $parent; - } - - // embedded templates are set as attributes so that they are only visited once by the visitors - parent::__construct($nodes, [ - 'index' => null, - 'embedded_templates' => $embeddedTemplates, - ], 1); - - // populate the template name of all node children - $this->setSourceContext($source); - } - - public function setIndex($index) - { - $this->setAttribute('index', $index); - } - - public function compile(Compiler $compiler): void - { - $this->compileTemplate($compiler); - - foreach ($this->getAttribute('embedded_templates') as $template) { - $compiler->subcompile($template); - } - } - - protected function compileTemplate(Compiler $compiler) - { - if (!$this->getAttribute('index')) { - $compiler->write('compileClassHeader($compiler); - - $this->compileConstructor($compiler); - - $this->compileGetParent($compiler); - - $this->compileDisplay($compiler); - - $compiler->subcompile($this->getNode('blocks')); - - $this->compileMacros($compiler); - - $this->compileGetTemplateName($compiler); - - $this->compileIsTraitable($compiler); - - $this->compileDebugInfo($compiler); - - $this->compileGetSourceContext($compiler); - - $this->compileClassFooter($compiler); - } - - protected function compileGetParent(Compiler $compiler) - { - if (!$this->hasNode('parent')) { - return; - } - $parent = $this->getNode('parent'); - - $compiler - ->write("protected function doGetParent(array \$context)\n", "{\n") - ->indent() - ->addDebugInfo($parent) - ->write('return ') - ; - - if ($parent instanceof ConstantExpression) { - $compiler->subcompile($parent); - } else { - $compiler - ->raw('$this->loadTemplate(') - ->subcompile($parent) - ->raw(', ') - ->repr($this->getSourceContext()->getName()) - ->raw(', ') - ->repr($parent->getTemplateLine()) - ->raw(')') - ; - } - - $compiler - ->raw(";\n") - ->outdent() - ->write("}\n\n") - ; - } - - protected function compileClassHeader(Compiler $compiler) - { - $compiler - ->write("\n\n") - ; - if (!$this->getAttribute('index')) { - $compiler - ->write("use Twig\Environment;\n") - ->write("use Twig\Error\LoaderError;\n") - ->write("use Twig\Error\RuntimeError;\n") - ->write("use Twig\Extension\SandboxExtension;\n") - ->write("use Twig\Markup;\n") - ->write("use Twig\Sandbox\SecurityError;\n") - ->write("use Twig\Sandbox\SecurityNotAllowedTagError;\n") - ->write("use Twig\Sandbox\SecurityNotAllowedFilterError;\n") - ->write("use Twig\Sandbox\SecurityNotAllowedFunctionError;\n") - ->write("use Twig\Source;\n") - ->write("use Twig\Template;\n\n") - ; - } - $compiler - // if the template name contains */, add a blank to avoid a PHP parse error - ->write('/* '.str_replace('*/', '* /', $this->getSourceContext()->getName())." */\n") - ->write('class '.$compiler->getEnvironment()->getTemplateClass($this->getSourceContext()->getName(), $this->getAttribute('index'))) - ->raw(" extends Template\n") - ->write("{\n") - ->indent() - ->write("private \$source;\n") - ->write("private \$macros = [];\n\n") - ; - } - - protected function compileConstructor(Compiler $compiler) - { - $compiler - ->write("public function __construct(Environment \$env)\n", "{\n") - ->indent() - ->subcompile($this->getNode('constructor_start')) - ->write("parent::__construct(\$env);\n\n") - ->write("\$this->source = \$this->getSourceContext();\n\n") - ; - - // parent - if (!$this->hasNode('parent')) { - $compiler->write("\$this->parent = false;\n\n"); - } - - $countTraits = \count($this->getNode('traits')); - if ($countTraits) { - // traits - foreach ($this->getNode('traits') as $i => $trait) { - $node = $trait->getNode('template'); - - $compiler - ->addDebugInfo($node) - ->write(sprintf('$_trait_%s = $this->loadTemplate(', $i)) - ->subcompile($node) - ->raw(', ') - ->repr($node->getTemplateName()) - ->raw(', ') - ->repr($node->getTemplateLine()) - ->raw(");\n") - ->write(sprintf("if (!\$_trait_%s->isTraitable()) {\n", $i)) - ->indent() - ->write("throw new RuntimeError('Template \"'.") - ->subcompile($trait->getNode('template')) - ->raw(".'\" cannot be used as a trait.', ") - ->repr($node->getTemplateLine()) - ->raw(", \$this->source);\n") - ->outdent() - ->write("}\n") - ->write(sprintf("\$_trait_%s_blocks = \$_trait_%s->getBlocks();\n\n", $i, $i)) - ; - - foreach ($trait->getNode('targets') as $key => $value) { - $compiler - ->write(sprintf('if (!isset($_trait_%s_blocks[', $i)) - ->string($key) - ->raw("])) {\n") - ->indent() - ->write("throw new RuntimeError('Block ") - ->string($key) - ->raw(' is not defined in trait ') - ->subcompile($trait->getNode('template')) - ->raw(".', ") - ->repr($node->getTemplateLine()) - ->raw(", \$this->source);\n") - ->outdent() - ->write("}\n\n") - - ->write(sprintf('$_trait_%s_blocks[', $i)) - ->subcompile($value) - ->raw(sprintf('] = $_trait_%s_blocks[', $i)) - ->string($key) - ->raw(sprintf(']; unset($_trait_%s_blocks[', $i)) - ->string($key) - ->raw("]);\n\n") - ; - } - } - - if ($countTraits > 1) { - $compiler - ->write("\$this->traits = array_merge(\n") - ->indent() - ; - - for ($i = 0; $i < $countTraits; ++$i) { - $compiler - ->write(sprintf('$_trait_%s_blocks'.($i == $countTraits - 1 ? '' : ',')."\n", $i)) - ; - } - - $compiler - ->outdent() - ->write(");\n\n") - ; - } else { - $compiler - ->write("\$this->traits = \$_trait_0_blocks;\n\n") - ; - } - - $compiler - ->write("\$this->blocks = array_merge(\n") - ->indent() - ->write("\$this->traits,\n") - ->write("[\n") - ; - } else { - $compiler - ->write("\$this->blocks = [\n") - ; - } - - // blocks - $compiler - ->indent() - ; - - foreach ($this->getNode('blocks') as $name => $node) { - $compiler - ->write(sprintf("'%s' => [\$this, 'block_%s'],\n", $name, $name)) - ; - } - - if ($countTraits) { - $compiler - ->outdent() - ->write("]\n") - ->outdent() - ->write(");\n") - ; - } else { - $compiler - ->outdent() - ->write("];\n") - ; - } - - $compiler - ->subcompile($this->getNode('constructor_end')) - ->outdent() - ->write("}\n\n") - ; - } - - protected function compileDisplay(Compiler $compiler) - { - $compiler - ->write("protected function doDisplay(array \$context, array \$blocks = [])\n", "{\n") - ->indent() - ->write("\$macros = \$this->macros;\n") - ->subcompile($this->getNode('display_start')) - ->subcompile($this->getNode('body')) - ; - - if ($this->hasNode('parent')) { - $parent = $this->getNode('parent'); - - $compiler->addDebugInfo($parent); - if ($parent instanceof ConstantExpression) { - $compiler - ->write('$this->parent = $this->loadTemplate(') - ->subcompile($parent) - ->raw(', ') - ->repr($this->getSourceContext()->getName()) - ->raw(', ') - ->repr($parent->getTemplateLine()) - ->raw(");\n") - ; - $compiler->write('$this->parent'); - } else { - $compiler->write('$this->getParent($context)'); - } - $compiler->raw("->display(\$context, array_merge(\$this->blocks, \$blocks));\n"); - } - - $compiler - ->subcompile($this->getNode('display_end')) - ->outdent() - ->write("}\n\n") - ; - } - - protected function compileClassFooter(Compiler $compiler) - { - $compiler - ->subcompile($this->getNode('class_end')) - ->outdent() - ->write("}\n") - ; - } - - protected function compileMacros(Compiler $compiler) - { - $compiler->subcompile($this->getNode('macros')); - } - - protected function compileGetTemplateName(Compiler $compiler) - { - $compiler - ->write("/**\n") - ->write(" * @codeCoverageIgnore\n") - ->write(" */\n") - ->write("public function getTemplateName()\n", "{\n") - ->indent() - ->write('return ') - ->repr($this->getSourceContext()->getName()) - ->raw(";\n") - ->outdent() - ->write("}\n\n") - ; - } - - protected function compileIsTraitable(Compiler $compiler) - { - // A template can be used as a trait if: - // * it has no parent - // * it has no macros - // * it has no body - // - // Put another way, a template can be used as a trait if it - // only contains blocks and use statements. - $traitable = !$this->hasNode('parent') && 0 === \count($this->getNode('macros')); - if ($traitable) { - if ($this->getNode('body') instanceof BodyNode) { - $nodes = $this->getNode('body')->getNode(0); - } else { - $nodes = $this->getNode('body'); - } - - if (!\count($nodes)) { - $nodes = new Node([$nodes]); - } - - foreach ($nodes as $node) { - if (!\count($node)) { - continue; - } - - if ($node instanceof TextNode && ctype_space($node->getAttribute('data'))) { - continue; - } - - if ($node instanceof BlockReferenceNode) { - continue; - } - - $traitable = false; - break; - } - } - - if ($traitable) { - return; - } - - $compiler - ->write("/**\n") - ->write(" * @codeCoverageIgnore\n") - ->write(" */\n") - ->write("public function isTraitable()\n", "{\n") - ->indent() - ->write(sprintf("return %s;\n", $traitable ? 'true' : 'false')) - ->outdent() - ->write("}\n\n") - ; - } - - protected function compileDebugInfo(Compiler $compiler) - { - $compiler - ->write("/**\n") - ->write(" * @codeCoverageIgnore\n") - ->write(" */\n") - ->write("public function getDebugInfo()\n", "{\n") - ->indent() - ->write(sprintf("return %s;\n", str_replace("\n", '', var_export(array_reverse($compiler->getDebugInfo(), true), true)))) - ->outdent() - ->write("}\n\n") - ; - } - - protected function compileGetSourceContext(Compiler $compiler) - { - $compiler - ->write("public function getSourceContext()\n", "{\n") - ->indent() - ->write('return new Source(') - ->string($compiler->getEnvironment()->isDebug() ? $this->getSourceContext()->getCode() : '') - ->raw(', ') - ->string($this->getSourceContext()->getName()) - ->raw(', ') - ->string($this->getSourceContext()->getPath()) - ->raw(");\n") - ->outdent() - ->write("}\n") - ; - } - - protected function compileLoadTemplate(Compiler $compiler, $node, $var) - { - if ($node instanceof ConstantExpression) { - $compiler - ->write(sprintf('%s = $this->loadTemplate(', $var)) - ->subcompile($node) - ->raw(', ') - ->repr($node->getTemplateName()) - ->raw(', ') - ->repr($node->getTemplateLine()) - ->raw(");\n") - ; - } else { - throw new \LogicException('Trait templates can only be constant nodes.'); - } - } -} diff --git a/system/vendor/twig/twig/src/Node/Node.php b/system/vendor/twig/twig/src/Node/Node.php deleted file mode 100644 index 30659ae..0000000 --- a/system/vendor/twig/twig/src/Node/Node.php +++ /dev/null @@ -1,178 +0,0 @@ - - */ -class Node implements \Countable, \IteratorAggregate -{ - protected $nodes; - protected $attributes; - protected $lineno; - protected $tag; - - private $sourceContext; - - /** - * @param array $nodes An array of named nodes - * @param array $attributes An array of attributes (should not be nodes) - * @param int $lineno The line number - * @param string $tag The tag name associated with the Node - */ - public function __construct(array $nodes = [], array $attributes = [], int $lineno = 0, string $tag = null) - { - foreach ($nodes as $name => $node) { - if (!$node instanceof self) { - throw new \InvalidArgumentException(sprintf('Using "%s" for the value of node "%s" of "%s" is not supported. You must pass a \Twig\Node\Node instance.', \is_object($node) ? \get_class($node) : (null === $node ? 'null' : \gettype($node)), $name, static::class)); - } - } - $this->nodes = $nodes; - $this->attributes = $attributes; - $this->lineno = $lineno; - $this->tag = $tag; - } - - public function __toString() - { - $attributes = []; - foreach ($this->attributes as $name => $value) { - $attributes[] = sprintf('%s: %s', $name, str_replace("\n", '', var_export($value, true))); - } - - $repr = [static::class.'('.implode(', ', $attributes)]; - - if (\count($this->nodes)) { - foreach ($this->nodes as $name => $node) { - $len = \strlen($name) + 4; - $noderepr = []; - foreach (explode("\n", (string) $node) as $line) { - $noderepr[] = str_repeat(' ', $len).$line; - } - - $repr[] = sprintf(' %s: %s', $name, ltrim(implode("\n", $noderepr))); - } - - $repr[] = ')'; - } else { - $repr[0] .= ')'; - } - - return implode("\n", $repr); - } - - /** - * @return void - */ - public function compile(Compiler $compiler) - { - foreach ($this->nodes as $node) { - $node->compile($compiler); - } - } - - public function getTemplateLine(): int - { - return $this->lineno; - } - - public function getNodeTag(): ?string - { - return $this->tag; - } - - public function hasAttribute(string $name): bool - { - return \array_key_exists($name, $this->attributes); - } - - public function getAttribute(string $name) - { - if (!\array_key_exists($name, $this->attributes)) { - throw new \LogicException(sprintf('Attribute "%s" does not exist for Node "%s".', $name, static::class)); - } - - return $this->attributes[$name]; - } - - public function setAttribute(string $name, $value): void - { - $this->attributes[$name] = $value; - } - - public function removeAttribute(string $name): void - { - unset($this->attributes[$name]); - } - - public function hasNode(string $name): bool - { - return isset($this->nodes[$name]); - } - - public function getNode(string $name): self - { - if (!isset($this->nodes[$name])) { - throw new \LogicException(sprintf('Node "%s" does not exist for Node "%s".', $name, static::class)); - } - - return $this->nodes[$name]; - } - - public function setNode(string $name, self $node): void - { - $this->nodes[$name] = $node; - } - - public function removeNode(string $name): void - { - unset($this->nodes[$name]); - } - - /** - * @return int - */ - #[\ReturnTypeWillChange] - public function count() - { - return \count($this->nodes); - } - - public function getIterator(): \Traversable - { - return new \ArrayIterator($this->nodes); - } - - public function getTemplateName(): ?string - { - return $this->sourceContext ? $this->sourceContext->getName() : null; - } - - public function setSourceContext(Source $source): void - { - $this->sourceContext = $source; - foreach ($this->nodes as $node) { - $node->setSourceContext($source); - } - } - - public function getSourceContext(): ?Source - { - return $this->sourceContext; - } -} diff --git a/system/vendor/twig/twig/src/Node/NodeCaptureInterface.php b/system/vendor/twig/twig/src/Node/NodeCaptureInterface.php deleted file mode 100644 index 9fb6a0c..0000000 --- a/system/vendor/twig/twig/src/Node/NodeCaptureInterface.php +++ /dev/null @@ -1,21 +0,0 @@ - - */ -interface NodeCaptureInterface -{ -} diff --git a/system/vendor/twig/twig/src/Node/NodeOutputInterface.php b/system/vendor/twig/twig/src/Node/NodeOutputInterface.php deleted file mode 100644 index 5e35b40..0000000 --- a/system/vendor/twig/twig/src/Node/NodeOutputInterface.php +++ /dev/null @@ -1,21 +0,0 @@ - - */ -interface NodeOutputInterface -{ -} diff --git a/system/vendor/twig/twig/src/Node/PrintNode.php b/system/vendor/twig/twig/src/Node/PrintNode.php deleted file mode 100644 index 60386d2..0000000 --- a/system/vendor/twig/twig/src/Node/PrintNode.php +++ /dev/null @@ -1,39 +0,0 @@ - - */ -class PrintNode extends Node implements NodeOutputInterface -{ - public function __construct(AbstractExpression $expr, int $lineno, string $tag = null) - { - parent::__construct(['expr' => $expr], [], $lineno, $tag); - } - - public function compile(Compiler $compiler): void - { - $compiler - ->addDebugInfo($this) - ->write('echo ') - ->subcompile($this->getNode('expr')) - ->raw(";\n") - ; - } -} diff --git a/system/vendor/twig/twig/src/Node/SandboxNode.php b/system/vendor/twig/twig/src/Node/SandboxNode.php deleted file mode 100644 index 4d5666b..0000000 --- a/system/vendor/twig/twig/src/Node/SandboxNode.php +++ /dev/null @@ -1,52 +0,0 @@ - - */ -class SandboxNode extends Node -{ - public function __construct(Node $body, int $lineno, string $tag = null) - { - parent::__construct(['body' => $body], [], $lineno, $tag); - } - - public function compile(Compiler $compiler): void - { - $compiler - ->addDebugInfo($this) - ->write("if (!\$alreadySandboxed = \$this->sandbox->isSandboxed()) {\n") - ->indent() - ->write("\$this->sandbox->enableSandbox();\n") - ->outdent() - ->write("}\n") - ->write("try {\n") - ->indent() - ->subcompile($this->getNode('body')) - ->outdent() - ->write("} finally {\n") - ->indent() - ->write("if (!\$alreadySandboxed) {\n") - ->indent() - ->write("\$this->sandbox->disableSandbox();\n") - ->outdent() - ->write("}\n") - ->outdent() - ->write("}\n") - ; - } -} diff --git a/system/vendor/twig/twig/src/Node/SetNode.php b/system/vendor/twig/twig/src/Node/SetNode.php deleted file mode 100644 index 96b6bd8..0000000 --- a/system/vendor/twig/twig/src/Node/SetNode.php +++ /dev/null @@ -1,105 +0,0 @@ - - */ -class SetNode extends Node implements NodeCaptureInterface -{ - public function __construct(bool $capture, Node $names, Node $values, int $lineno, string $tag = null) - { - parent::__construct(['names' => $names, 'values' => $values], ['capture' => $capture, 'safe' => false], $lineno, $tag); - - /* - * Optimizes the node when capture is used for a large block of text. - * - * {% set foo %}foo{% endset %} is compiled to $context['foo'] = new Twig\Markup("foo"); - */ - if ($this->getAttribute('capture')) { - $this->setAttribute('safe', true); - - $values = $this->getNode('values'); - if ($values instanceof TextNode) { - $this->setNode('values', new ConstantExpression($values->getAttribute('data'), $values->getTemplateLine())); - $this->setAttribute('capture', false); - } - } - } - - public function compile(Compiler $compiler): void - { - $compiler->addDebugInfo($this); - - if (\count($this->getNode('names')) > 1) { - $compiler->write('list('); - foreach ($this->getNode('names') as $idx => $node) { - if ($idx) { - $compiler->raw(', '); - } - - $compiler->subcompile($node); - } - $compiler->raw(')'); - } else { - if ($this->getAttribute('capture')) { - if ($compiler->getEnvironment()->isDebug()) { - $compiler->write("ob_start();\n"); - } else { - $compiler->write("ob_start(function () { return ''; });\n"); - } - $compiler - ->subcompile($this->getNode('values')) - ; - } - - $compiler->subcompile($this->getNode('names'), false); - - if ($this->getAttribute('capture')) { - $compiler->raw(" = ('' === \$tmp = ob_get_clean()) ? '' : new Markup(\$tmp, \$this->env->getCharset())"); - } - } - - if (!$this->getAttribute('capture')) { - $compiler->raw(' = '); - - if (\count($this->getNode('names')) > 1) { - $compiler->write('['); - foreach ($this->getNode('values') as $idx => $value) { - if ($idx) { - $compiler->raw(', '); - } - - $compiler->subcompile($value); - } - $compiler->raw(']'); - } else { - if ($this->getAttribute('safe')) { - $compiler - ->raw("('' === \$tmp = ") - ->subcompile($this->getNode('values')) - ->raw(") ? '' : new Markup(\$tmp, \$this->env->getCharset())") - ; - } else { - $compiler->subcompile($this->getNode('values')); - } - } - } - - $compiler->raw(";\n"); - } -} diff --git a/system/vendor/twig/twig/src/Node/TextNode.php b/system/vendor/twig/twig/src/Node/TextNode.php deleted file mode 100644 index d74ebe6..0000000 --- a/system/vendor/twig/twig/src/Node/TextNode.php +++ /dev/null @@ -1,38 +0,0 @@ - - */ -class TextNode extends Node implements NodeOutputInterface -{ - public function __construct(string $data, int $lineno) - { - parent::__construct([], ['data' => $data], $lineno); - } - - public function compile(Compiler $compiler): void - { - $compiler - ->addDebugInfo($this) - ->write('echo ') - ->string($this->getAttribute('data')) - ->raw(";\n") - ; - } -} diff --git a/system/vendor/twig/twig/src/Node/WithNode.php b/system/vendor/twig/twig/src/Node/WithNode.php deleted file mode 100644 index 2ac9123..0000000 --- a/system/vendor/twig/twig/src/Node/WithNode.php +++ /dev/null @@ -1,70 +0,0 @@ - - */ -class WithNode extends Node -{ - public function __construct(Node $body, ?Node $variables, bool $only, int $lineno, string $tag = null) - { - $nodes = ['body' => $body]; - if (null !== $variables) { - $nodes['variables'] = $variables; - } - - parent::__construct($nodes, ['only' => $only], $lineno, $tag); - } - - public function compile(Compiler $compiler): void - { - $compiler->addDebugInfo($this); - - $parentContextName = $compiler->getVarName(); - - $compiler->write(sprintf("\$%s = \$context;\n", $parentContextName)); - - if ($this->hasNode('variables')) { - $node = $this->getNode('variables'); - $varsName = $compiler->getVarName(); - $compiler - ->write(sprintf('$%s = ', $varsName)) - ->subcompile($node) - ->raw(";\n") - ->write(sprintf("if (!is_iterable(\$%s)) {\n", $varsName)) - ->indent() - ->write("throw new RuntimeError('Variables passed to the \"with\" tag must be a hash.', ") - ->repr($node->getTemplateLine()) - ->raw(", \$this->getSourceContext());\n") - ->outdent() - ->write("}\n") - ->write(sprintf("\$%s = twig_to_array(\$%s);\n", $varsName, $varsName)) - ; - - if ($this->getAttribute('only')) { - $compiler->write("\$context = [];\n"); - } - - $compiler->write(sprintf("\$context = \$this->env->mergeGlobals(array_merge(\$context, \$%s));\n", $varsName)); - } - - $compiler - ->subcompile($this->getNode('body')) - ->write(sprintf("\$context = \$%s;\n", $parentContextName)) - ; - } -} diff --git a/system/vendor/twig/twig/src/NodeTraverser.php b/system/vendor/twig/twig/src/NodeTraverser.php deleted file mode 100644 index 47a2d5c..0000000 --- a/system/vendor/twig/twig/src/NodeTraverser.php +++ /dev/null @@ -1,76 +0,0 @@ - - */ -final class NodeTraverser -{ - private $env; - private $visitors = []; - - /** - * @param NodeVisitorInterface[] $visitors - */ - public function __construct(Environment $env, array $visitors = []) - { - $this->env = $env; - foreach ($visitors as $visitor) { - $this->addVisitor($visitor); - } - } - - public function addVisitor(NodeVisitorInterface $visitor): void - { - $this->visitors[$visitor->getPriority()][] = $visitor; - } - - /** - * Traverses a node and calls the registered visitors. - */ - public function traverse(Node $node): Node - { - ksort($this->visitors); - foreach ($this->visitors as $visitors) { - foreach ($visitors as $visitor) { - $node = $this->traverseForVisitor($visitor, $node); - } - } - - return $node; - } - - private function traverseForVisitor(NodeVisitorInterface $visitor, Node $node): ?Node - { - $node = $visitor->enterNode($node, $this->env); - - foreach ($node as $k => $n) { - if (null !== $m = $this->traverseForVisitor($visitor, $n)) { - if ($m !== $n) { - $node->setNode($k, $m); - } - } else { - $node->removeNode($k); - } - } - - return $visitor->leaveNode($node, $this->env); - } -} diff --git a/system/vendor/twig/twig/src/NodeVisitor/AbstractNodeVisitor.php b/system/vendor/twig/twig/src/NodeVisitor/AbstractNodeVisitor.php deleted file mode 100644 index d7036ae..0000000 --- a/system/vendor/twig/twig/src/NodeVisitor/AbstractNodeVisitor.php +++ /dev/null @@ -1,49 +0,0 @@ - - */ -abstract class AbstractNodeVisitor implements NodeVisitorInterface -{ - final public function enterNode(Node $node, Environment $env): Node - { - return $this->doEnterNode($node, $env); - } - - final public function leaveNode(Node $node, Environment $env): ?Node - { - return $this->doLeaveNode($node, $env); - } - - /** - * Called before child nodes are visited. - * - * @return Node The modified node - */ - abstract protected function doEnterNode(Node $node, Environment $env); - - /** - * Called after child nodes are visited. - * - * @return Node|null The modified node or null if the node must be removed - */ - abstract protected function doLeaveNode(Node $node, Environment $env); -} diff --git a/system/vendor/twig/twig/src/NodeVisitor/EscaperNodeVisitor.php b/system/vendor/twig/twig/src/NodeVisitor/EscaperNodeVisitor.php deleted file mode 100644 index c390d7c..0000000 --- a/system/vendor/twig/twig/src/NodeVisitor/EscaperNodeVisitor.php +++ /dev/null @@ -1,208 +0,0 @@ - - * - * @internal - */ -final class EscaperNodeVisitor implements NodeVisitorInterface -{ - private $statusStack = []; - private $blocks = []; - private $safeAnalysis; - private $traverser; - private $defaultStrategy = false; - private $safeVars = []; - - public function __construct() - { - $this->safeAnalysis = new SafeAnalysisNodeVisitor(); - } - - public function enterNode(Node $node, Environment $env): Node - { - if ($node instanceof ModuleNode) { - if ($env->hasExtension(EscaperExtension::class) && $defaultStrategy = $env->getExtension(EscaperExtension::class)->getDefaultStrategy($node->getTemplateName())) { - $this->defaultStrategy = $defaultStrategy; - } - $this->safeVars = []; - $this->blocks = []; - } elseif ($node instanceof AutoEscapeNode) { - $this->statusStack[] = $node->getAttribute('value'); - } elseif ($node instanceof BlockNode) { - $this->statusStack[] = $this->blocks[$node->getAttribute('name')] ?? $this->needEscaping(); - } elseif ($node instanceof ImportNode) { - $this->safeVars[] = $node->getNode('var')->getAttribute('name'); - } - - return $node; - } - - public function leaveNode(Node $node, Environment $env): ?Node - { - if ($node instanceof ModuleNode) { - $this->defaultStrategy = false; - $this->safeVars = []; - $this->blocks = []; - } elseif ($node instanceof FilterExpression) { - return $this->preEscapeFilterNode($node, $env); - } elseif ($node instanceof PrintNode && false !== $type = $this->needEscaping()) { - $expression = $node->getNode('expr'); - if ($expression instanceof ConditionalExpression && $this->shouldUnwrapConditional($expression, $env, $type)) { - return new DoNode($this->unwrapConditional($expression, $env, $type), $expression->getTemplateLine()); - } - - return $this->escapePrintNode($node, $env, $type); - } - - if ($node instanceof AutoEscapeNode || $node instanceof BlockNode) { - array_pop($this->statusStack); - } elseif ($node instanceof BlockReferenceNode) { - $this->blocks[$node->getAttribute('name')] = $this->needEscaping(); - } - - return $node; - } - - private function shouldUnwrapConditional(ConditionalExpression $expression, Environment $env, string $type): bool - { - $expr2Safe = $this->isSafeFor($type, $expression->getNode('expr2'), $env); - $expr3Safe = $this->isSafeFor($type, $expression->getNode('expr3'), $env); - - return $expr2Safe !== $expr3Safe; - } - - private function unwrapConditional(ConditionalExpression $expression, Environment $env, string $type): ConditionalExpression - { - // convert "echo a ? b : c" to "a ? echo b : echo c" recursively - $expr2 = $expression->getNode('expr2'); - if ($expr2 instanceof ConditionalExpression && $this->shouldUnwrapConditional($expr2, $env, $type)) { - $expr2 = $this->unwrapConditional($expr2, $env, $type); - } else { - $expr2 = $this->escapeInlinePrintNode(new InlinePrint($expr2, $expr2->getTemplateLine()), $env, $type); - } - $expr3 = $expression->getNode('expr3'); - if ($expr3 instanceof ConditionalExpression && $this->shouldUnwrapConditional($expr3, $env, $type)) { - $expr3 = $this->unwrapConditional($expr3, $env, $type); - } else { - $expr3 = $this->escapeInlinePrintNode(new InlinePrint($expr3, $expr3->getTemplateLine()), $env, $type); - } - - return new ConditionalExpression($expression->getNode('expr1'), $expr2, $expr3, $expression->getTemplateLine()); - } - - private function escapeInlinePrintNode(InlinePrint $node, Environment $env, string $type): Node - { - $expression = $node->getNode('node'); - - if ($this->isSafeFor($type, $expression, $env)) { - return $node; - } - - return new InlinePrint($this->getEscaperFilter($type, $expression), $node->getTemplateLine()); - } - - private function escapePrintNode(PrintNode $node, Environment $env, string $type): Node - { - if (false === $type) { - return $node; - } - - $expression = $node->getNode('expr'); - - if ($this->isSafeFor($type, $expression, $env)) { - return $node; - } - - $class = \get_class($node); - - return new $class($this->getEscaperFilter($type, $expression), $node->getTemplateLine()); - } - - private function preEscapeFilterNode(FilterExpression $filter, Environment $env): FilterExpression - { - $name = $filter->getNode('filter')->getAttribute('value'); - - $type = $env->getFilter($name)->getPreEscape(); - if (null === $type) { - return $filter; - } - - $node = $filter->getNode('node'); - if ($this->isSafeFor($type, $node, $env)) { - return $filter; - } - - $filter->setNode('node', $this->getEscaperFilter($type, $node)); - - return $filter; - } - - private function isSafeFor(string $type, Node $expression, Environment $env): bool - { - $safe = $this->safeAnalysis->getSafe($expression); - - if (null === $safe) { - if (null === $this->traverser) { - $this->traverser = new NodeTraverser($env, [$this->safeAnalysis]); - } - - $this->safeAnalysis->setSafeVars($this->safeVars); - - $this->traverser->traverse($expression); - $safe = $this->safeAnalysis->getSafe($expression); - } - - return \in_array($type, $safe) || \in_array('all', $safe); - } - - private function needEscaping() - { - if (\count($this->statusStack)) { - return $this->statusStack[\count($this->statusStack) - 1]; - } - - return $this->defaultStrategy ?: false; - } - - private function getEscaperFilter(string $type, Node $node): FilterExpression - { - $line = $node->getTemplateLine(); - $name = new ConstantExpression('escape', $line); - $args = new Node([new ConstantExpression($type, $line), new ConstantExpression(null, $line), new ConstantExpression(true, $line)]); - - return new FilterExpression($node, $name, $args, $line); - } - - public function getPriority(): int - { - return 0; - } -} diff --git a/system/vendor/twig/twig/src/NodeVisitor/MacroAutoImportNodeVisitor.php b/system/vendor/twig/twig/src/NodeVisitor/MacroAutoImportNodeVisitor.php deleted file mode 100644 index d6a7781..0000000 --- a/system/vendor/twig/twig/src/NodeVisitor/MacroAutoImportNodeVisitor.php +++ /dev/null @@ -1,74 +0,0 @@ - - * - * @internal - */ -final class MacroAutoImportNodeVisitor implements NodeVisitorInterface -{ - private $inAModule = false; - private $hasMacroCalls = false; - - public function enterNode(Node $node, Environment $env): Node - { - if ($node instanceof ModuleNode) { - $this->inAModule = true; - $this->hasMacroCalls = false; - } - - return $node; - } - - public function leaveNode(Node $node, Environment $env): Node - { - if ($node instanceof ModuleNode) { - $this->inAModule = false; - if ($this->hasMacroCalls) { - $node->getNode('constructor_end')->setNode('_auto_macro_import', new ImportNode(new NameExpression('_self', 0), new AssignNameExpression('_self', 0), 0, 'import', true)); - } - } elseif ($this->inAModule) { - if ( - $node instanceof GetAttrExpression - && $node->getNode('node') instanceof NameExpression - && '_self' === $node->getNode('node')->getAttribute('name') - && $node->getNode('attribute') instanceof ConstantExpression - ) { - $this->hasMacroCalls = true; - - $name = $node->getNode('attribute')->getAttribute('value'); - $node = new MethodCallExpression($node->getNode('node'), 'macro_'.$name, $node->getNode('arguments'), $node->getTemplateLine()); - $node->setAttribute('safe', true); - } - } - - return $node; - } - - public function getPriority(): int - { - // we must be ran before auto-escaping - return -10; - } -} diff --git a/system/vendor/twig/twig/src/NodeVisitor/NodeVisitorInterface.php b/system/vendor/twig/twig/src/NodeVisitor/NodeVisitorInterface.php deleted file mode 100644 index 59e836d..0000000 --- a/system/vendor/twig/twig/src/NodeVisitor/NodeVisitorInterface.php +++ /dev/null @@ -1,46 +0,0 @@ - - */ -interface NodeVisitorInterface -{ - /** - * Called before child nodes are visited. - * - * @return Node The modified node - */ - public function enterNode(Node $node, Environment $env): Node; - - /** - * Called after child nodes are visited. - * - * @return Node|null The modified node or null if the node must be removed - */ - public function leaveNode(Node $node, Environment $env): ?Node; - - /** - * Returns the priority for this visitor. - * - * Priority should be between -10 and 10 (0 is the default). - * - * @return int The priority level - */ - public function getPriority(); -} diff --git a/system/vendor/twig/twig/src/NodeVisitor/OptimizerNodeVisitor.php b/system/vendor/twig/twig/src/NodeVisitor/OptimizerNodeVisitor.php deleted file mode 100644 index 6b39f00..0000000 --- a/system/vendor/twig/twig/src/NodeVisitor/OptimizerNodeVisitor.php +++ /dev/null @@ -1,217 +0,0 @@ - - * - * @internal - */ -final class OptimizerNodeVisitor implements NodeVisitorInterface -{ - public const OPTIMIZE_ALL = -1; - public const OPTIMIZE_NONE = 0; - public const OPTIMIZE_FOR = 2; - public const OPTIMIZE_RAW_FILTER = 4; - - private $loops = []; - private $loopsTargets = []; - private $optimizers; - - /** - * @param int $optimizers The optimizer mode - */ - public function __construct(int $optimizers = -1) - { - if ($optimizers > (self::OPTIMIZE_FOR | self::OPTIMIZE_RAW_FILTER)) { - throw new \InvalidArgumentException(sprintf('Optimizer mode "%s" is not valid.', $optimizers)); - } - - $this->optimizers = $optimizers; - } - - public function enterNode(Node $node, Environment $env): Node - { - if (self::OPTIMIZE_FOR === (self::OPTIMIZE_FOR & $this->optimizers)) { - $this->enterOptimizeFor($node); - } - - return $node; - } - - public function leaveNode(Node $node, Environment $env): ?Node - { - if (self::OPTIMIZE_FOR === (self::OPTIMIZE_FOR & $this->optimizers)) { - $this->leaveOptimizeFor($node); - } - - if (self::OPTIMIZE_RAW_FILTER === (self::OPTIMIZE_RAW_FILTER & $this->optimizers)) { - $node = $this->optimizeRawFilter($node); - } - - $node = $this->optimizePrintNode($node); - - return $node; - } - - /** - * Optimizes print nodes. - * - * It replaces: - * - * * "echo $this->render(Parent)Block()" with "$this->display(Parent)Block()" - */ - private function optimizePrintNode(Node $node): Node - { - if (!$node instanceof PrintNode) { - return $node; - } - - $exprNode = $node->getNode('expr'); - if ( - $exprNode instanceof BlockReferenceExpression - || $exprNode instanceof ParentExpression - ) { - $exprNode->setAttribute('output', true); - - return $exprNode; - } - - return $node; - } - - /** - * Removes "raw" filters. - */ - private function optimizeRawFilter(Node $node): Node - { - if ($node instanceof FilterExpression && 'raw' == $node->getNode('filter')->getAttribute('value')) { - return $node->getNode('node'); - } - - return $node; - } - - /** - * Optimizes "for" tag by removing the "loop" variable creation whenever possible. - */ - private function enterOptimizeFor(Node $node): void - { - if ($node instanceof ForNode) { - // disable the loop variable by default - $node->setAttribute('with_loop', false); - array_unshift($this->loops, $node); - array_unshift($this->loopsTargets, $node->getNode('value_target')->getAttribute('name')); - array_unshift($this->loopsTargets, $node->getNode('key_target')->getAttribute('name')); - } elseif (!$this->loops) { - // we are outside a loop - return; - } - - // when do we need to add the loop variable back? - - // the loop variable is referenced for the current loop - elseif ($node instanceof NameExpression && 'loop' === $node->getAttribute('name')) { - $node->setAttribute('always_defined', true); - $this->addLoopToCurrent(); - } - - // optimize access to loop targets - elseif ($node instanceof NameExpression && \in_array($node->getAttribute('name'), $this->loopsTargets)) { - $node->setAttribute('always_defined', true); - } - - // block reference - elseif ($node instanceof BlockReferenceNode || $node instanceof BlockReferenceExpression) { - $this->addLoopToCurrent(); - } - - // include without the only attribute - elseif ($node instanceof IncludeNode && !$node->getAttribute('only')) { - $this->addLoopToAll(); - } - - // include function without the with_context=false parameter - elseif ($node instanceof FunctionExpression - && 'include' === $node->getAttribute('name') - && (!$node->getNode('arguments')->hasNode('with_context') - || false !== $node->getNode('arguments')->getNode('with_context')->getAttribute('value') - ) - ) { - $this->addLoopToAll(); - } - - // the loop variable is referenced via an attribute - elseif ($node instanceof GetAttrExpression - && (!$node->getNode('attribute') instanceof ConstantExpression - || 'parent' === $node->getNode('attribute')->getAttribute('value') - ) - && (true === $this->loops[0]->getAttribute('with_loop') - || ($node->getNode('node') instanceof NameExpression - && 'loop' === $node->getNode('node')->getAttribute('name') - ) - ) - ) { - $this->addLoopToAll(); - } - } - - /** - * Optimizes "for" tag by removing the "loop" variable creation whenever possible. - */ - private function leaveOptimizeFor(Node $node): void - { - if ($node instanceof ForNode) { - array_shift($this->loops); - array_shift($this->loopsTargets); - array_shift($this->loopsTargets); - } - } - - private function addLoopToCurrent(): void - { - $this->loops[0]->setAttribute('with_loop', true); - } - - private function addLoopToAll(): void - { - foreach ($this->loops as $loop) { - $loop->setAttribute('with_loop', true); - } - } - - public function getPriority(): int - { - return 255; - } -} diff --git a/system/vendor/twig/twig/src/NodeVisitor/SafeAnalysisNodeVisitor.php b/system/vendor/twig/twig/src/NodeVisitor/SafeAnalysisNodeVisitor.php deleted file mode 100644 index 90d6f2e..0000000 --- a/system/vendor/twig/twig/src/NodeVisitor/SafeAnalysisNodeVisitor.php +++ /dev/null @@ -1,160 +0,0 @@ -safeVars = $safeVars; - } - - public function getSafe(Node $node) - { - $hash = spl_object_hash($node); - if (!isset($this->data[$hash])) { - return; - } - - foreach ($this->data[$hash] as $bucket) { - if ($bucket['key'] !== $node) { - continue; - } - - if (\in_array('html_attr', $bucket['value'])) { - $bucket['value'][] = 'html'; - } - - return $bucket['value']; - } - } - - private function setSafe(Node $node, array $safe): void - { - $hash = spl_object_hash($node); - if (isset($this->data[$hash])) { - foreach ($this->data[$hash] as &$bucket) { - if ($bucket['key'] === $node) { - $bucket['value'] = $safe; - - return; - } - } - } - $this->data[$hash][] = [ - 'key' => $node, - 'value' => $safe, - ]; - } - - public function enterNode(Node $node, Environment $env): Node - { - return $node; - } - - public function leaveNode(Node $node, Environment $env): ?Node - { - if ($node instanceof ConstantExpression) { - // constants are marked safe for all - $this->setSafe($node, ['all']); - } elseif ($node instanceof BlockReferenceExpression) { - // blocks are safe by definition - $this->setSafe($node, ['all']); - } elseif ($node instanceof ParentExpression) { - // parent block is safe by definition - $this->setSafe($node, ['all']); - } elseif ($node instanceof ConditionalExpression) { - // intersect safeness of both operands - $safe = $this->intersectSafe($this->getSafe($node->getNode('expr2')), $this->getSafe($node->getNode('expr3'))); - $this->setSafe($node, $safe); - } elseif ($node instanceof FilterExpression) { - // filter expression is safe when the filter is safe - $name = $node->getNode('filter')->getAttribute('value'); - $args = $node->getNode('arguments'); - if ($filter = $env->getFilter($name)) { - $safe = $filter->getSafe($args); - if (null === $safe) { - $safe = $this->intersectSafe($this->getSafe($node->getNode('node')), $filter->getPreservesSafety()); - } - $this->setSafe($node, $safe); - } else { - $this->setSafe($node, []); - } - } elseif ($node instanceof FunctionExpression) { - // function expression is safe when the function is safe - $name = $node->getAttribute('name'); - $args = $node->getNode('arguments'); - if ($function = $env->getFunction($name)) { - $this->setSafe($node, $function->getSafe($args)); - } else { - $this->setSafe($node, []); - } - } elseif ($node instanceof MethodCallExpression) { - if ($node->getAttribute('safe')) { - $this->setSafe($node, ['all']); - } else { - $this->setSafe($node, []); - } - } elseif ($node instanceof GetAttrExpression && $node->getNode('node') instanceof NameExpression) { - $name = $node->getNode('node')->getAttribute('name'); - if (\in_array($name, $this->safeVars)) { - $this->setSafe($node, ['all']); - } else { - $this->setSafe($node, []); - } - } else { - $this->setSafe($node, []); - } - - return $node; - } - - private function intersectSafe(array $a = null, array $b = null): array - { - if (null === $a || null === $b) { - return []; - } - - if (\in_array('all', $a)) { - return $b; - } - - if (\in_array('all', $b)) { - return $a; - } - - return array_intersect($a, $b); - } - - public function getPriority(): int - { - return 0; - } -} diff --git a/system/vendor/twig/twig/src/NodeVisitor/SandboxNodeVisitor.php b/system/vendor/twig/twig/src/NodeVisitor/SandboxNodeVisitor.php deleted file mode 100644 index 1446cee..0000000 --- a/system/vendor/twig/twig/src/NodeVisitor/SandboxNodeVisitor.php +++ /dev/null @@ -1,136 +0,0 @@ - - * - * @internal - */ -final class SandboxNodeVisitor implements NodeVisitorInterface -{ - private $inAModule = false; - private $tags; - private $filters; - private $functions; - private $needsToStringWrap = false; - - public function enterNode(Node $node, Environment $env): Node - { - if ($node instanceof ModuleNode) { - $this->inAModule = true; - $this->tags = []; - $this->filters = []; - $this->functions = []; - - return $node; - } elseif ($this->inAModule) { - // look for tags - if ($node->getNodeTag() && !isset($this->tags[$node->getNodeTag()])) { - $this->tags[$node->getNodeTag()] = $node; - } - - // look for filters - if ($node instanceof FilterExpression && !isset($this->filters[$node->getNode('filter')->getAttribute('value')])) { - $this->filters[$node->getNode('filter')->getAttribute('value')] = $node; - } - - // look for functions - if ($node instanceof FunctionExpression && !isset($this->functions[$node->getAttribute('name')])) { - $this->functions[$node->getAttribute('name')] = $node; - } - - // the .. operator is equivalent to the range() function - if ($node instanceof RangeBinary && !isset($this->functions['range'])) { - $this->functions['range'] = $node; - } - - if ($node instanceof PrintNode) { - $this->needsToStringWrap = true; - $this->wrapNode($node, 'expr'); - } - - if ($node instanceof SetNode && !$node->getAttribute('capture')) { - $this->needsToStringWrap = true; - } - - // wrap outer nodes that can implicitly call __toString() - if ($this->needsToStringWrap) { - if ($node instanceof ConcatBinary) { - $this->wrapNode($node, 'left'); - $this->wrapNode($node, 'right'); - } - if ($node instanceof FilterExpression) { - $this->wrapNode($node, 'node'); - $this->wrapArrayNode($node, 'arguments'); - } - if ($node instanceof FunctionExpression) { - $this->wrapArrayNode($node, 'arguments'); - } - } - } - - return $node; - } - - public function leaveNode(Node $node, Environment $env): ?Node - { - if ($node instanceof ModuleNode) { - $this->inAModule = false; - - $node->setNode('constructor_end', new Node([new CheckSecurityCallNode(), $node->getNode('constructor_end')])); - $node->setNode('class_end', new Node([new CheckSecurityNode($this->filters, $this->tags, $this->functions), $node->getNode('class_end')])); - } elseif ($this->inAModule) { - if ($node instanceof PrintNode || $node instanceof SetNode) { - $this->needsToStringWrap = false; - } - } - - return $node; - } - - private function wrapNode(Node $node, string $name): void - { - $expr = $node->getNode($name); - if ($expr instanceof NameExpression || $expr instanceof GetAttrExpression) { - $node->setNode($name, new CheckToStringNode($expr)); - } - } - - private function wrapArrayNode(Node $node, string $name): void - { - $args = $node->getNode($name); - foreach ($args as $name => $_) { - $this->wrapNode($args, $name); - } - } - - public function getPriority(): int - { - return 0; - } -} diff --git a/system/vendor/twig/twig/src/Parser.php b/system/vendor/twig/twig/src/Parser.php deleted file mode 100644 index 4016a5f..0000000 --- a/system/vendor/twig/twig/src/Parser.php +++ /dev/null @@ -1,347 +0,0 @@ - - */ -class Parser -{ - private $stack = []; - private $stream; - private $parent; - private $visitors; - private $expressionParser; - private $blocks; - private $blockStack; - private $macros; - private $env; - private $importedSymbols; - private $traits; - private $embeddedTemplates = []; - private $varNameSalt = 0; - - public function __construct(Environment $env) - { - $this->env = $env; - } - - public function getVarName(): string - { - return sprintf('__internal_parse_%d', $this->varNameSalt++); - } - - public function parse(TokenStream $stream, $test = null, bool $dropNeedle = false): ModuleNode - { - $vars = get_object_vars($this); - unset($vars['stack'], $vars['env'], $vars['handlers'], $vars['visitors'], $vars['expressionParser'], $vars['reservedMacroNames'], $vars['varNameSalt']); - $this->stack[] = $vars; - - // node visitors - if (null === $this->visitors) { - $this->visitors = $this->env->getNodeVisitors(); - } - - if (null === $this->expressionParser) { - $this->expressionParser = new ExpressionParser($this, $this->env); - } - - $this->stream = $stream; - $this->parent = null; - $this->blocks = []; - $this->macros = []; - $this->traits = []; - $this->blockStack = []; - $this->importedSymbols = [[]]; - $this->embeddedTemplates = []; - - try { - $body = $this->subparse($test, $dropNeedle); - - if (null !== $this->parent && null === $body = $this->filterBodyNodes($body)) { - $body = new Node(); - } - } catch (SyntaxError $e) { - if (!$e->getSourceContext()) { - $e->setSourceContext($this->stream->getSourceContext()); - } - - if (!$e->getTemplateLine()) { - $e->setTemplateLine($this->stream->getCurrent()->getLine()); - } - - throw $e; - } - - $node = new ModuleNode(new BodyNode([$body]), $this->parent, new Node($this->blocks), new Node($this->macros), new Node($this->traits), $this->embeddedTemplates, $stream->getSourceContext()); - - $traverser = new NodeTraverser($this->env, $this->visitors); - - $node = $traverser->traverse($node); - - // restore previous stack so previous parse() call can resume working - foreach (array_pop($this->stack) as $key => $val) { - $this->$key = $val; - } - - return $node; - } - - public function subparse($test, bool $dropNeedle = false): Node - { - $lineno = $this->getCurrentToken()->getLine(); - $rv = []; - while (!$this->stream->isEOF()) { - switch ($this->getCurrentToken()->getType()) { - case /* Token::TEXT_TYPE */ 0: - $token = $this->stream->next(); - $rv[] = new TextNode($token->getValue(), $token->getLine()); - break; - - case /* Token::VAR_START_TYPE */ 2: - $token = $this->stream->next(); - $expr = $this->expressionParser->parseExpression(); - $this->stream->expect(/* Token::VAR_END_TYPE */ 4); - $rv[] = new PrintNode($expr, $token->getLine()); - break; - - case /* Token::BLOCK_START_TYPE */ 1: - $this->stream->next(); - $token = $this->getCurrentToken(); - - if (/* Token::NAME_TYPE */ 5 !== $token->getType()) { - throw new SyntaxError('A block must start with a tag name.', $token->getLine(), $this->stream->getSourceContext()); - } - - if (null !== $test && $test($token)) { - if ($dropNeedle) { - $this->stream->next(); - } - - if (1 === \count($rv)) { - return $rv[0]; - } - - return new Node($rv, [], $lineno); - } - - if (!$subparser = $this->env->getTokenParser($token->getValue())) { - if (null !== $test) { - $e = new SyntaxError(sprintf('Unexpected "%s" tag', $token->getValue()), $token->getLine(), $this->stream->getSourceContext()); - - if (\is_array($test) && isset($test[0]) && $test[0] instanceof TokenParserInterface) { - $e->appendMessage(sprintf(' (expecting closing tag for the "%s" tag defined near line %s).', $test[0]->getTag(), $lineno)); - } - } else { - $e = new SyntaxError(sprintf('Unknown "%s" tag.', $token->getValue()), $token->getLine(), $this->stream->getSourceContext()); - $e->addSuggestions($token->getValue(), array_keys($this->env->getTokenParsers())); - } - - throw $e; - } - - $this->stream->next(); - - $subparser->setParser($this); - $node = $subparser->parse($token); - if (null !== $node) { - $rv[] = $node; - } - break; - - default: - throw new SyntaxError('Lexer or parser ended up in unsupported state.', $this->getCurrentToken()->getLine(), $this->stream->getSourceContext()); - } - } - - if (1 === \count($rv)) { - return $rv[0]; - } - - return new Node($rv, [], $lineno); - } - - public function getBlockStack(): array - { - return $this->blockStack; - } - - public function peekBlockStack() - { - return $this->blockStack[\count($this->blockStack) - 1] ?? null; - } - - public function popBlockStack(): void - { - array_pop($this->blockStack); - } - - public function pushBlockStack($name): void - { - $this->blockStack[] = $name; - } - - public function hasBlock(string $name): bool - { - return isset($this->blocks[$name]); - } - - public function getBlock(string $name): Node - { - return $this->blocks[$name]; - } - - public function setBlock(string $name, BlockNode $value): void - { - $this->blocks[$name] = new BodyNode([$value], [], $value->getTemplateLine()); - } - - public function hasMacro(string $name): bool - { - return isset($this->macros[$name]); - } - - public function setMacro(string $name, MacroNode $node): void - { - $this->macros[$name] = $node; - } - - public function addTrait($trait): void - { - $this->traits[] = $trait; - } - - public function hasTraits(): bool - { - return \count($this->traits) > 0; - } - - public function embedTemplate(ModuleNode $template) - { - $template->setIndex(mt_rand()); - - $this->embeddedTemplates[] = $template; - } - - public function addImportedSymbol(string $type, string $alias, string $name = null, AbstractExpression $node = null): void - { - $this->importedSymbols[0][$type][$alias] = ['name' => $name, 'node' => $node]; - } - - public function getImportedSymbol(string $type, string $alias) - { - // if the symbol does not exist in the current scope (0), try in the main/global scope (last index) - return $this->importedSymbols[0][$type][$alias] ?? ($this->importedSymbols[\count($this->importedSymbols) - 1][$type][$alias] ?? null); - } - - public function isMainScope(): bool - { - return 1 === \count($this->importedSymbols); - } - - public function pushLocalScope(): void - { - array_unshift($this->importedSymbols, []); - } - - public function popLocalScope(): void - { - array_shift($this->importedSymbols); - } - - public function getExpressionParser(): ExpressionParser - { - return $this->expressionParser; - } - - public function getParent(): ?Node - { - return $this->parent; - } - - public function setParent(?Node $parent): void - { - $this->parent = $parent; - } - - public function getStream(): TokenStream - { - return $this->stream; - } - - public function getCurrentToken(): Token - { - return $this->stream->getCurrent(); - } - - private function filterBodyNodes(Node $node, bool $nested = false): ?Node - { - // check that the body does not contain non-empty output nodes - if ( - ($node instanceof TextNode && !ctype_space($node->getAttribute('data'))) - || (!$node instanceof TextNode && !$node instanceof BlockReferenceNode && $node instanceof NodeOutputInterface) - ) { - if (str_contains((string) $node, \chr(0xEF).\chr(0xBB).\chr(0xBF))) { - $t = substr($node->getAttribute('data'), 3); - if ('' === $t || ctype_space($t)) { - // bypass empty nodes starting with a BOM - return null; - } - } - - throw new SyntaxError('A template that extends another one cannot include content outside Twig blocks. Did you forget to put the content inside a {% block %} tag?', $node->getTemplateLine(), $this->stream->getSourceContext()); - } - - // bypass nodes that "capture" the output - if ($node instanceof NodeCaptureInterface) { - // a "block" tag in such a node will serve as a block definition AND be displayed in place as well - return $node; - } - - // "block" tags that are not captured (see above) are only used for defining - // the content of the block. In such a case, nesting it does not work as - // expected as the definition is not part of the default template code flow. - if ($nested && $node instanceof BlockReferenceNode) { - throw new SyntaxError('A block definition cannot be nested under non-capturing nodes.', $node->getTemplateLine(), $this->stream->getSourceContext()); - } - - if ($node instanceof NodeOutputInterface) { - return null; - } - - // here, $nested means "being at the root level of a child template" - // we need to discard the wrapping "Node" for the "body" node - $nested = $nested || Node::class !== \get_class($node); - foreach ($node as $k => $n) { - if (null !== $n && null === $this->filterBodyNodes($n, $nested)) { - $node->removeNode($k); - } - } - - return $node; - } -} diff --git a/system/vendor/twig/twig/src/Profiler/Dumper/BaseDumper.php b/system/vendor/twig/twig/src/Profiler/Dumper/BaseDumper.php deleted file mode 100644 index 4da43e4..0000000 --- a/system/vendor/twig/twig/src/Profiler/Dumper/BaseDumper.php +++ /dev/null @@ -1,63 +0,0 @@ - - */ -abstract class BaseDumper -{ - private $root; - - public function dump(Profile $profile): string - { - return $this->dumpProfile($profile); - } - - abstract protected function formatTemplate(Profile $profile, $prefix): string; - - abstract protected function formatNonTemplate(Profile $profile, $prefix): string; - - abstract protected function formatTime(Profile $profile, $percent): string; - - private function dumpProfile(Profile $profile, $prefix = '', $sibling = false): string - { - if ($profile->isRoot()) { - $this->root = $profile->getDuration(); - $start = $profile->getName(); - } else { - if ($profile->isTemplate()) { - $start = $this->formatTemplate($profile, $prefix); - } else { - $start = $this->formatNonTemplate($profile, $prefix); - } - $prefix .= $sibling ? '│ ' : ' '; - } - - $percent = $this->root ? $profile->getDuration() / $this->root * 100 : 0; - - if ($profile->getDuration() * 1000 < 1) { - $str = $start."\n"; - } else { - $str = sprintf("%s %s\n", $start, $this->formatTime($profile, $percent)); - } - - $nCount = \count($profile->getProfiles()); - foreach ($profile as $i => $p) { - $str .= $this->dumpProfile($p, $prefix, $i + 1 !== $nCount); - } - - return $str; - } -} diff --git a/system/vendor/twig/twig/src/Profiler/Dumper/BlackfireDumper.php b/system/vendor/twig/twig/src/Profiler/Dumper/BlackfireDumper.php deleted file mode 100644 index 03abe0f..0000000 --- a/system/vendor/twig/twig/src/Profiler/Dumper/BlackfireDumper.php +++ /dev/null @@ -1,72 +0,0 @@ - - */ -final class BlackfireDumper -{ - public function dump(Profile $profile): string - { - $data = []; - $this->dumpProfile('main()', $profile, $data); - $this->dumpChildren('main()', $profile, $data); - - $start = sprintf('%f', microtime(true)); - $str = << $values) { - $str .= "$name//{$values['ct']} {$values['wt']} {$values['mu']} {$values['pmu']}\n"; - } - - return $str; - } - - private function dumpChildren(string $parent, Profile $profile, &$data) - { - foreach ($profile as $p) { - if ($p->isTemplate()) { - $name = $p->getTemplate(); - } else { - $name = sprintf('%s::%s(%s)', $p->getTemplate(), $p->getType(), $p->getName()); - } - $this->dumpProfile(sprintf('%s==>%s', $parent, $name), $p, $data); - $this->dumpChildren($name, $p, $data); - } - } - - private function dumpProfile(string $edge, Profile $profile, &$data) - { - if (isset($data[$edge])) { - ++$data[$edge]['ct']; - $data[$edge]['wt'] += floor($profile->getDuration() * 1000000); - $data[$edge]['mu'] += $profile->getMemoryUsage(); - $data[$edge]['pmu'] += $profile->getPeakMemoryUsage(); - } else { - $data[$edge] = [ - 'ct' => 1, - 'wt' => floor($profile->getDuration() * 1000000), - 'mu' => $profile->getMemoryUsage(), - 'pmu' => $profile->getPeakMemoryUsage(), - ]; - } - } -} diff --git a/system/vendor/twig/twig/src/Profiler/Dumper/HtmlDumper.php b/system/vendor/twig/twig/src/Profiler/Dumper/HtmlDumper.php deleted file mode 100644 index 3c0daf1..0000000 --- a/system/vendor/twig/twig/src/Profiler/Dumper/HtmlDumper.php +++ /dev/null @@ -1,47 +0,0 @@ - - */ -final class HtmlDumper extends BaseDumper -{ - private static $colors = [ - 'block' => '#dfd', - 'macro' => '#ddf', - 'template' => '#ffd', - 'big' => '#d44', - ]; - - public function dump(Profile $profile): string - { - return '
'.parent::dump($profile).'
'; - } - - protected function formatTemplate(Profile $profile, $prefix): string - { - return sprintf('%s└ %s', $prefix, self::$colors['template'], $profile->getTemplate()); - } - - protected function formatNonTemplate(Profile $profile, $prefix): string - { - return sprintf('%s└ %s::%s(%s)', $prefix, $profile->getTemplate(), $profile->getType(), self::$colors[$profile->getType()] ?? 'auto', $profile->getName()); - } - - protected function formatTime(Profile $profile, $percent): string - { - return sprintf('%.2fms/%.0f%%', $percent > 20 ? self::$colors['big'] : 'auto', $profile->getDuration() * 1000, $percent); - } -} diff --git a/system/vendor/twig/twig/src/Profiler/Dumper/TextDumper.php b/system/vendor/twig/twig/src/Profiler/Dumper/TextDumper.php deleted file mode 100644 index 31561c4..0000000 --- a/system/vendor/twig/twig/src/Profiler/Dumper/TextDumper.php +++ /dev/null @@ -1,35 +0,0 @@ - - */ -final class TextDumper extends BaseDumper -{ - protected function formatTemplate(Profile $profile, $prefix): string - { - return sprintf('%s└ %s', $prefix, $profile->getTemplate()); - } - - protected function formatNonTemplate(Profile $profile, $prefix): string - { - return sprintf('%s└ %s::%s(%s)', $prefix, $profile->getTemplate(), $profile->getType(), $profile->getName()); - } - - protected function formatTime(Profile $profile, $percent): string - { - return sprintf('%.2fms/%.0f%%', $profile->getDuration() * 1000, $percent); - } -} diff --git a/system/vendor/twig/twig/src/Profiler/Node/EnterProfileNode.php b/system/vendor/twig/twig/src/Profiler/Node/EnterProfileNode.php deleted file mode 100644 index 1494baf..0000000 --- a/system/vendor/twig/twig/src/Profiler/Node/EnterProfileNode.php +++ /dev/null @@ -1,42 +0,0 @@ - - */ -class EnterProfileNode extends Node -{ - public function __construct(string $extensionName, string $type, string $name, string $varName) - { - parent::__construct([], ['extension_name' => $extensionName, 'name' => $name, 'type' => $type, 'var_name' => $varName]); - } - - public function compile(Compiler $compiler): void - { - $compiler - ->write(sprintf('$%s = $this->extensions[', $this->getAttribute('var_name'))) - ->repr($this->getAttribute('extension_name')) - ->raw("];\n") - ->write(sprintf('$%s->enter($%s = new \Twig\Profiler\Profile($this->getTemplateName(), ', $this->getAttribute('var_name'), $this->getAttribute('var_name').'_prof')) - ->repr($this->getAttribute('type')) - ->raw(', ') - ->repr($this->getAttribute('name')) - ->raw("));\n\n") - ; - } -} diff --git a/system/vendor/twig/twig/src/Profiler/Node/LeaveProfileNode.php b/system/vendor/twig/twig/src/Profiler/Node/LeaveProfileNode.php deleted file mode 100644 index 94cebba..0000000 --- a/system/vendor/twig/twig/src/Profiler/Node/LeaveProfileNode.php +++ /dev/null @@ -1,36 +0,0 @@ - - */ -class LeaveProfileNode extends Node -{ - public function __construct(string $varName) - { - parent::__construct([], ['var_name' => $varName]); - } - - public function compile(Compiler $compiler): void - { - $compiler - ->write("\n") - ->write(sprintf("\$%s->leave(\$%s);\n\n", $this->getAttribute('var_name'), $this->getAttribute('var_name').'_prof')) - ; - } -} diff --git a/system/vendor/twig/twig/src/Profiler/NodeVisitor/ProfilerNodeVisitor.php b/system/vendor/twig/twig/src/Profiler/NodeVisitor/ProfilerNodeVisitor.php deleted file mode 100644 index 91abee8..0000000 --- a/system/vendor/twig/twig/src/Profiler/NodeVisitor/ProfilerNodeVisitor.php +++ /dev/null @@ -1,70 +0,0 @@ - - */ -final class ProfilerNodeVisitor implements NodeVisitorInterface -{ - private $extensionName; - private $varName; - - public function __construct(string $extensionName) - { - $this->extensionName = $extensionName; - $this->varName = sprintf('__internal_%s', hash(\PHP_VERSION_ID < 80100 ? 'sha256' : 'xxh128', $extensionName)); - } - - public function enterNode(Node $node, Environment $env): Node - { - return $node; - } - - public function leaveNode(Node $node, Environment $env): ?Node - { - if ($node instanceof ModuleNode) { - $node->setNode('display_start', new Node([new EnterProfileNode($this->extensionName, Profile::TEMPLATE, $node->getTemplateName(), $this->varName), $node->getNode('display_start')])); - $node->setNode('display_end', new Node([new LeaveProfileNode($this->varName), $node->getNode('display_end')])); - } elseif ($node instanceof BlockNode) { - $node->setNode('body', new BodyNode([ - new EnterProfileNode($this->extensionName, Profile::BLOCK, $node->getAttribute('name'), $this->varName), - $node->getNode('body'), - new LeaveProfileNode($this->varName), - ])); - } elseif ($node instanceof MacroNode) { - $node->setNode('body', new BodyNode([ - new EnterProfileNode($this->extensionName, Profile::MACRO, $node->getAttribute('name'), $this->varName), - $node->getNode('body'), - new LeaveProfileNode($this->varName), - ])); - } - - return $node; - } - - public function getPriority(): int - { - return 0; - } -} diff --git a/system/vendor/twig/twig/src/Profiler/Profile.php b/system/vendor/twig/twig/src/Profiler/Profile.php deleted file mode 100644 index 7979a23..0000000 --- a/system/vendor/twig/twig/src/Profiler/Profile.php +++ /dev/null @@ -1,181 +0,0 @@ - - */ -final class Profile implements \IteratorAggregate, \Serializable -{ - public const ROOT = 'ROOT'; - public const BLOCK = 'block'; - public const TEMPLATE = 'template'; - public const MACRO = 'macro'; - - private $template; - private $name; - private $type; - private $starts = []; - private $ends = []; - private $profiles = []; - - public function __construct(string $template = 'main', string $type = self::ROOT, string $name = 'main') - { - $this->template = $template; - $this->type = $type; - $this->name = str_starts_with($name, '__internal_') ? 'INTERNAL' : $name; - $this->enter(); - } - - public function getTemplate(): string - { - return $this->template; - } - - public function getType(): string - { - return $this->type; - } - - public function getName(): string - { - return $this->name; - } - - public function isRoot(): bool - { - return self::ROOT === $this->type; - } - - public function isTemplate(): bool - { - return self::TEMPLATE === $this->type; - } - - public function isBlock(): bool - { - return self::BLOCK === $this->type; - } - - public function isMacro(): bool - { - return self::MACRO === $this->type; - } - - /** - * @return Profile[] - */ - public function getProfiles(): array - { - return $this->profiles; - } - - public function addProfile(self $profile): void - { - $this->profiles[] = $profile; - } - - /** - * Returns the duration in microseconds. - */ - public function getDuration(): float - { - if ($this->isRoot() && $this->profiles) { - // for the root node with children, duration is the sum of all child durations - $duration = 0; - foreach ($this->profiles as $profile) { - $duration += $profile->getDuration(); - } - - return $duration; - } - - return isset($this->ends['wt']) && isset($this->starts['wt']) ? $this->ends['wt'] - $this->starts['wt'] : 0; - } - - /** - * Returns the memory usage in bytes. - */ - public function getMemoryUsage(): int - { - return isset($this->ends['mu']) && isset($this->starts['mu']) ? $this->ends['mu'] - $this->starts['mu'] : 0; - } - - /** - * Returns the peak memory usage in bytes. - */ - public function getPeakMemoryUsage(): int - { - return isset($this->ends['pmu']) && isset($this->starts['pmu']) ? $this->ends['pmu'] - $this->starts['pmu'] : 0; - } - - /** - * Starts the profiling. - */ - public function enter(): void - { - $this->starts = [ - 'wt' => microtime(true), - 'mu' => memory_get_usage(), - 'pmu' => memory_get_peak_usage(), - ]; - } - - /** - * Stops the profiling. - */ - public function leave(): void - { - $this->ends = [ - 'wt' => microtime(true), - 'mu' => memory_get_usage(), - 'pmu' => memory_get_peak_usage(), - ]; - } - - public function reset(): void - { - $this->starts = $this->ends = $this->profiles = []; - $this->enter(); - } - - public function getIterator(): \Traversable - { - return new \ArrayIterator($this->profiles); - } - - public function serialize(): string - { - return serialize($this->__serialize()); - } - - public function unserialize($data): void - { - $this->__unserialize(unserialize($data)); - } - - /** - * @internal - */ - public function __serialize(): array - { - return [$this->template, $this->name, $this->type, $this->starts, $this->ends, $this->profiles]; - } - - /** - * @internal - */ - public function __unserialize(array $data): void - { - list($this->template, $this->name, $this->type, $this->starts, $this->ends, $this->profiles) = $data; - } -} diff --git a/system/vendor/twig/twig/src/RuntimeLoader/ContainerRuntimeLoader.php b/system/vendor/twig/twig/src/RuntimeLoader/ContainerRuntimeLoader.php deleted file mode 100644 index b360d7b..0000000 --- a/system/vendor/twig/twig/src/RuntimeLoader/ContainerRuntimeLoader.php +++ /dev/null @@ -1,37 +0,0 @@ - - * @author Robin Chalas - */ -class ContainerRuntimeLoader implements RuntimeLoaderInterface -{ - private $container; - - public function __construct(ContainerInterface $container) - { - $this->container = $container; - } - - public function load(string $class) - { - return $this->container->has($class) ? $this->container->get($class) : null; - } -} diff --git a/system/vendor/twig/twig/src/RuntimeLoader/FactoryRuntimeLoader.php b/system/vendor/twig/twig/src/RuntimeLoader/FactoryRuntimeLoader.php deleted file mode 100644 index 1306483..0000000 --- a/system/vendor/twig/twig/src/RuntimeLoader/FactoryRuntimeLoader.php +++ /dev/null @@ -1,41 +0,0 @@ - - */ -class FactoryRuntimeLoader implements RuntimeLoaderInterface -{ - private $map; - - /** - * @param array $map An array where keys are class names and values factory callables - */ - public function __construct(array $map = []) - { - $this->map = $map; - } - - public function load(string $class) - { - if (!isset($this->map[$class])) { - return null; - } - - $runtimeFactory = $this->map[$class]; - - return $runtimeFactory(); - } -} diff --git a/system/vendor/twig/twig/src/RuntimeLoader/RuntimeLoaderInterface.php b/system/vendor/twig/twig/src/RuntimeLoader/RuntimeLoaderInterface.php deleted file mode 100644 index 9e5b204..0000000 --- a/system/vendor/twig/twig/src/RuntimeLoader/RuntimeLoaderInterface.php +++ /dev/null @@ -1,27 +0,0 @@ - - */ -interface RuntimeLoaderInterface -{ - /** - * Creates the runtime implementation of a Twig element (filter/function/test). - * - * @return object|null The runtime instance or null if the loader does not know how to create the runtime for this class - */ - public function load(string $class); -} diff --git a/system/vendor/twig/twig/src/Sandbox/SecurityError.php b/system/vendor/twig/twig/src/Sandbox/SecurityError.php deleted file mode 100644 index 30a404f..0000000 --- a/system/vendor/twig/twig/src/Sandbox/SecurityError.php +++ /dev/null @@ -1,23 +0,0 @@ - - */ -class SecurityError extends Error -{ -} diff --git a/system/vendor/twig/twig/src/Sandbox/SecurityNotAllowedFilterError.php b/system/vendor/twig/twig/src/Sandbox/SecurityNotAllowedFilterError.php deleted file mode 100644 index 02d3063..0000000 --- a/system/vendor/twig/twig/src/Sandbox/SecurityNotAllowedFilterError.php +++ /dev/null @@ -1,33 +0,0 @@ - - */ -final class SecurityNotAllowedFilterError extends SecurityError -{ - private $filterName; - - public function __construct(string $message, string $functionName) - { - parent::__construct($message); - $this->filterName = $functionName; - } - - public function getFilterName(): string - { - return $this->filterName; - } -} diff --git a/system/vendor/twig/twig/src/Sandbox/SecurityNotAllowedFunctionError.php b/system/vendor/twig/twig/src/Sandbox/SecurityNotAllowedFunctionError.php deleted file mode 100644 index 4f76dc6..0000000 --- a/system/vendor/twig/twig/src/Sandbox/SecurityNotAllowedFunctionError.php +++ /dev/null @@ -1,33 +0,0 @@ - - */ -final class SecurityNotAllowedFunctionError extends SecurityError -{ - private $functionName; - - public function __construct(string $message, string $functionName) - { - parent::__construct($message); - $this->functionName = $functionName; - } - - public function getFunctionName(): string - { - return $this->functionName; - } -} diff --git a/system/vendor/twig/twig/src/Sandbox/SecurityNotAllowedMethodError.php b/system/vendor/twig/twig/src/Sandbox/SecurityNotAllowedMethodError.php deleted file mode 100644 index 8df9d0b..0000000 --- a/system/vendor/twig/twig/src/Sandbox/SecurityNotAllowedMethodError.php +++ /dev/null @@ -1,40 +0,0 @@ - - */ -final class SecurityNotAllowedMethodError extends SecurityError -{ - private $className; - private $methodName; - - public function __construct(string $message, string $className, string $methodName) - { - parent::__construct($message); - $this->className = $className; - $this->methodName = $methodName; - } - - public function getClassName(): string - { - return $this->className; - } - - public function getMethodName() - { - return $this->methodName; - } -} diff --git a/system/vendor/twig/twig/src/Sandbox/SecurityNotAllowedPropertyError.php b/system/vendor/twig/twig/src/Sandbox/SecurityNotAllowedPropertyError.php deleted file mode 100644 index 42ec4f3..0000000 --- a/system/vendor/twig/twig/src/Sandbox/SecurityNotAllowedPropertyError.php +++ /dev/null @@ -1,40 +0,0 @@ - - */ -final class SecurityNotAllowedPropertyError extends SecurityError -{ - private $className; - private $propertyName; - - public function __construct(string $message, string $className, string $propertyName) - { - parent::__construct($message); - $this->className = $className; - $this->propertyName = $propertyName; - } - - public function getClassName(): string - { - return $this->className; - } - - public function getPropertyName() - { - return $this->propertyName; - } -} diff --git a/system/vendor/twig/twig/src/Sandbox/SecurityNotAllowedTagError.php b/system/vendor/twig/twig/src/Sandbox/SecurityNotAllowedTagError.php deleted file mode 100644 index 4522150..0000000 --- a/system/vendor/twig/twig/src/Sandbox/SecurityNotAllowedTagError.php +++ /dev/null @@ -1,33 +0,0 @@ - - */ -final class SecurityNotAllowedTagError extends SecurityError -{ - private $tagName; - - public function __construct(string $message, string $tagName) - { - parent::__construct($message); - $this->tagName = $tagName; - } - - public function getTagName(): string - { - return $this->tagName; - } -} diff --git a/system/vendor/twig/twig/src/Sandbox/SecurityPolicy.php b/system/vendor/twig/twig/src/Sandbox/SecurityPolicy.php deleted file mode 100644 index a725aa4..0000000 --- a/system/vendor/twig/twig/src/Sandbox/SecurityPolicy.php +++ /dev/null @@ -1,124 +0,0 @@ - - */ -final class SecurityPolicy implements SecurityPolicyInterface -{ - private $allowedTags; - private $allowedFilters; - private $allowedMethods; - private $allowedProperties; - private $allowedFunctions; - - public function __construct(array $allowedTags = [], array $allowedFilters = [], array $allowedMethods = [], array $allowedProperties = [], array $allowedFunctions = []) - { - $this->allowedTags = $allowedTags; - $this->allowedFilters = $allowedFilters; - $this->setAllowedMethods($allowedMethods); - $this->allowedProperties = $allowedProperties; - $this->allowedFunctions = $allowedFunctions; - } - - public function setAllowedTags(array $tags): void - { - $this->allowedTags = $tags; - } - - public function setAllowedFilters(array $filters): void - { - $this->allowedFilters = $filters; - } - - public function setAllowedMethods(array $methods): void - { - $this->allowedMethods = []; - foreach ($methods as $class => $m) { - $this->allowedMethods[$class] = array_map(function ($value) { return strtr($value, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'); }, \is_array($m) ? $m : [$m]); - } - } - - public function setAllowedProperties(array $properties): void - { - $this->allowedProperties = $properties; - } - - public function setAllowedFunctions(array $functions): void - { - $this->allowedFunctions = $functions; - } - - public function checkSecurity($tags, $filters, $functions): void - { - foreach ($tags as $tag) { - if (!\in_array($tag, $this->allowedTags)) { - throw new SecurityNotAllowedTagError(sprintf('Tag "%s" is not allowed.', $tag), $tag); - } - } - - foreach ($filters as $filter) { - if (!\in_array($filter, $this->allowedFilters)) { - throw new SecurityNotAllowedFilterError(sprintf('Filter "%s" is not allowed.', $filter), $filter); - } - } - - foreach ($functions as $function) { - if (!\in_array($function, $this->allowedFunctions)) { - throw new SecurityNotAllowedFunctionError(sprintf('Function "%s" is not allowed.', $function), $function); - } - } - } - - public function checkMethodAllowed($obj, $method): void - { - if ($obj instanceof Template || $obj instanceof Markup) { - return; - } - - $allowed = false; - $method = strtr($method, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'); - foreach ($this->allowedMethods as $class => $methods) { - if ($obj instanceof $class && \in_array($method, $methods)) { - $allowed = true; - break; - } - } - - if (!$allowed) { - $class = \get_class($obj); - throw new SecurityNotAllowedMethodError(sprintf('Calling "%s" method on a "%s" object is not allowed.', $method, $class), $class, $method); - } - } - - public function checkPropertyAllowed($obj, $property): void - { - $allowed = false; - foreach ($this->allowedProperties as $class => $properties) { - if ($obj instanceof $class && \in_array($property, \is_array($properties) ? $properties : [$properties])) { - $allowed = true; - break; - } - } - - if (!$allowed) { - $class = \get_class($obj); - throw new SecurityNotAllowedPropertyError(sprintf('Calling "%s" property on a "%s" object is not allowed.', $property, $class), $class, $property); - } - } -} diff --git a/system/vendor/twig/twig/src/Sandbox/SecurityPolicyInterface.php b/system/vendor/twig/twig/src/Sandbox/SecurityPolicyInterface.php deleted file mode 100644 index 36471c5..0000000 --- a/system/vendor/twig/twig/src/Sandbox/SecurityPolicyInterface.php +++ /dev/null @@ -1,45 +0,0 @@ - - */ -interface SecurityPolicyInterface -{ - /** - * @param string[] $tags - * @param string[] $filters - * @param string[] $functions - * - * @throws SecurityError - */ - public function checkSecurity($tags, $filters, $functions): void; - - /** - * @param object $obj - * @param string $method - * - * @throws SecurityNotAllowedMethodError - */ - public function checkMethodAllowed($obj, $method): void; - - /** - * @param object $obj - * @param string $property - * - * @throws SecurityNotAllowedPropertyError - */ - public function checkPropertyAllowed($obj, $property): void; -} diff --git a/system/vendor/twig/twig/src/Source.php b/system/vendor/twig/twig/src/Source.php deleted file mode 100644 index 3cb0240..0000000 --- a/system/vendor/twig/twig/src/Source.php +++ /dev/null @@ -1,51 +0,0 @@ - - */ -final class Source -{ - private $code; - private $name; - private $path; - - /** - * @param string $code The template source code - * @param string $name The template logical name - * @param string $path The filesystem path of the template if any - */ - public function __construct(string $code, string $name, string $path = '') - { - $this->code = $code; - $this->name = $name; - $this->path = $path; - } - - public function getCode(): string - { - return $this->code; - } - - public function getName(): string - { - return $this->name; - } - - public function getPath(): string - { - return $this->path; - } -} diff --git a/system/vendor/twig/twig/src/Template.php b/system/vendor/twig/twig/src/Template.php deleted file mode 100644 index ffbaae1..0000000 --- a/system/vendor/twig/twig/src/Template.php +++ /dev/null @@ -1,422 +0,0 @@ -load() - * instead, which returns an instance of \Twig\TemplateWrapper. - * - * @author Fabien Potencier - * - * @internal - */ -abstract class Template -{ - public const ANY_CALL = 'any'; - public const ARRAY_CALL = 'array'; - public const METHOD_CALL = 'method'; - - protected $parent; - protected $parents = []; - protected $env; - protected $blocks = []; - protected $traits = []; - protected $extensions = []; - protected $sandbox; - - public function __construct(Environment $env) - { - $this->env = $env; - $this->extensions = $env->getExtensions(); - } - - /** - * Returns the template name. - * - * @return string The template name - */ - abstract public function getTemplateName(); - - /** - * Returns debug information about the template. - * - * @return array Debug information - */ - abstract public function getDebugInfo(); - - /** - * Returns information about the original template source code. - * - * @return Source - */ - abstract public function getSourceContext(); - - /** - * Returns the parent template. - * - * This method is for internal use only and should never be called - * directly. - * - * @return Template|TemplateWrapper|false The parent template or false if there is no parent - */ - public function getParent(array $context) - { - if (null !== $this->parent) { - return $this->parent; - } - - try { - $parent = $this->doGetParent($context); - - if (false === $parent) { - return false; - } - - if ($parent instanceof self || $parent instanceof TemplateWrapper) { - return $this->parents[$parent->getSourceContext()->getName()] = $parent; - } - - if (!isset($this->parents[$parent])) { - $this->parents[$parent] = $this->loadTemplate($parent); - } - } catch (LoaderError $e) { - $e->setSourceContext(null); - $e->guess(); - - throw $e; - } - - return $this->parents[$parent]; - } - - protected function doGetParent(array $context) - { - return false; - } - - public function isTraitable() - { - return true; - } - - /** - * Displays a parent block. - * - * This method is for internal use only and should never be called - * directly. - * - * @param string $name The block name to display from the parent - * @param array $context The context - * @param array $blocks The current set of blocks - */ - public function displayParentBlock($name, array $context, array $blocks = []) - { - if (isset($this->traits[$name])) { - $this->traits[$name][0]->displayBlock($name, $context, $blocks, false); - } elseif (false !== $parent = $this->getParent($context)) { - $parent->displayBlock($name, $context, $blocks, false); - } else { - throw new RuntimeError(sprintf('The template has no parent and no traits defining the "%s" block.', $name), -1, $this->getSourceContext()); - } - } - - /** - * Displays a block. - * - * This method is for internal use only and should never be called - * directly. - * - * @param string $name The block name to display - * @param array $context The context - * @param array $blocks The current set of blocks - * @param bool $useBlocks Whether to use the current set of blocks - */ - public function displayBlock($name, array $context, array $blocks = [], $useBlocks = true, self $templateContext = null) - { - if ($useBlocks && isset($blocks[$name])) { - $template = $blocks[$name][0]; - $block = $blocks[$name][1]; - } elseif (isset($this->blocks[$name])) { - $template = $this->blocks[$name][0]; - $block = $this->blocks[$name][1]; - } else { - $template = null; - $block = null; - } - - // avoid RCEs when sandbox is enabled - if (null !== $template && !$template instanceof self) { - throw new \LogicException('A block must be a method on a \Twig\Template instance.'); - } - - if (null !== $template) { - try { - $template->$block($context, $blocks); - } catch (Error $e) { - if (!$e->getSourceContext()) { - $e->setSourceContext($template->getSourceContext()); - } - - // this is mostly useful for \Twig\Error\LoaderError exceptions - // see \Twig\Error\LoaderError - if (-1 === $e->getTemplateLine()) { - $e->guess(); - } - - throw $e; - } catch (\Throwable $e) { - $e = new RuntimeError(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $template->getSourceContext(), $e); - $e->guess(); - - throw $e; - } - } elseif (false !== $parent = $this->getParent($context)) { - $parent->displayBlock($name, $context, array_merge($this->blocks, $blocks), false, $templateContext ?? $this); - } elseif (isset($blocks[$name])) { - throw new RuntimeError(sprintf('Block "%s" should not call parent() in "%s" as the block does not exist in the parent template "%s".', $name, $blocks[$name][0]->getTemplateName(), $this->getTemplateName()), -1, $blocks[$name][0]->getSourceContext()); - } else { - throw new RuntimeError(sprintf('Block "%s" on template "%s" does not exist.', $name, $this->getTemplateName()), -1, ($templateContext ?? $this)->getSourceContext()); - } - } - - /** - * Renders a parent block. - * - * This method is for internal use only and should never be called - * directly. - * - * @param string $name The block name to render from the parent - * @param array $context The context - * @param array $blocks The current set of blocks - * - * @return string The rendered block - */ - public function renderParentBlock($name, array $context, array $blocks = []) - { - if ($this->env->isDebug()) { - ob_start(); - } else { - ob_start(function () { return ''; }); - } - $this->displayParentBlock($name, $context, $blocks); - - return ob_get_clean(); - } - - /** - * Renders a block. - * - * This method is for internal use only and should never be called - * directly. - * - * @param string $name The block name to render - * @param array $context The context - * @param array $blocks The current set of blocks - * @param bool $useBlocks Whether to use the current set of blocks - * - * @return string The rendered block - */ - public function renderBlock($name, array $context, array $blocks = [], $useBlocks = true) - { - if ($this->env->isDebug()) { - ob_start(); - } else { - ob_start(function () { return ''; }); - } - $this->displayBlock($name, $context, $blocks, $useBlocks); - - return ob_get_clean(); - } - - /** - * Returns whether a block exists or not in the current context of the template. - * - * This method checks blocks defined in the current template - * or defined in "used" traits or defined in parent templates. - * - * @param string $name The block name - * @param array $context The context - * @param array $blocks The current set of blocks - * - * @return bool true if the block exists, false otherwise - */ - public function hasBlock($name, array $context, array $blocks = []) - { - if (isset($blocks[$name])) { - return $blocks[$name][0] instanceof self; - } - - if (isset($this->blocks[$name])) { - return true; - } - - if (false !== $parent = $this->getParent($context)) { - return $parent->hasBlock($name, $context); - } - - return false; - } - - /** - * Returns all block names in the current context of the template. - * - * This method checks blocks defined in the current template - * or defined in "used" traits or defined in parent templates. - * - * @param array $context The context - * @param array $blocks The current set of blocks - * - * @return array An array of block names - */ - public function getBlockNames(array $context, array $blocks = []) - { - $names = array_merge(array_keys($blocks), array_keys($this->blocks)); - - if (false !== $parent = $this->getParent($context)) { - $names = array_merge($names, $parent->getBlockNames($context)); - } - - return array_unique($names); - } - - /** - * @return Template|TemplateWrapper - */ - protected function loadTemplate($template, $templateName = null, $line = null, $index = null) - { - try { - if (\is_array($template)) { - return $this->env->resolveTemplate($template); - } - - if ($template instanceof self || $template instanceof TemplateWrapper) { - return $template; - } - - if ($template === $this->getTemplateName()) { - $class = static::class; - if (false !== $pos = strrpos($class, '___', -1)) { - $class = substr($class, 0, $pos); - } - } else { - $class = $this->env->getTemplateClass($template); - } - - return $this->env->loadTemplate($class, $template, $index); - } catch (Error $e) { - if (!$e->getSourceContext()) { - $e->setSourceContext($templateName ? new Source('', $templateName) : $this->getSourceContext()); - } - - if ($e->getTemplateLine() > 0) { - throw $e; - } - - if (!$line) { - $e->guess(); - } else { - $e->setTemplateLine($line); - } - - throw $e; - } - } - - /** - * @internal - * - * @return Template - */ - public function unwrap() - { - return $this; - } - - /** - * Returns all blocks. - * - * This method is for internal use only and should never be called - * directly. - * - * @return array An array of blocks - */ - public function getBlocks() - { - return $this->blocks; - } - - public function display(array $context, array $blocks = []) - { - $this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks)); - } - - public function render(array $context) - { - $level = ob_get_level(); - if ($this->env->isDebug()) { - ob_start(); - } else { - ob_start(function () { return ''; }); - } - try { - $this->display($context); - } catch (\Throwable $e) { - while (ob_get_level() > $level) { - ob_end_clean(); - } - - throw $e; - } - - return ob_get_clean(); - } - - protected function displayWithErrorHandling(array $context, array $blocks = []) - { - try { - $this->doDisplay($context, $blocks); - } catch (Error $e) { - if (!$e->getSourceContext()) { - $e->setSourceContext($this->getSourceContext()); - } - - // this is mostly useful for \Twig\Error\LoaderError exceptions - // see \Twig\Error\LoaderError - if (-1 === $e->getTemplateLine()) { - $e->guess(); - } - - throw $e; - } catch (\Throwable $e) { - $e = new RuntimeError(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $this->getSourceContext(), $e); - $e->guess(); - - throw $e; - } - } - - /** - * Auto-generated method to display the template with the given context. - * - * @param array $context An array of parameters to pass to the template - * @param array $blocks An array of blocks to pass to the template - */ - abstract protected function doDisplay(array $context, array $blocks = []); -} diff --git a/system/vendor/twig/twig/src/TemplateWrapper.php b/system/vendor/twig/twig/src/TemplateWrapper.php deleted file mode 100644 index 1ecd822..0000000 --- a/system/vendor/twig/twig/src/TemplateWrapper.php +++ /dev/null @@ -1,107 +0,0 @@ - - */ -final class TemplateWrapper -{ - private $env; - private $template; - - /** - * This method is for internal use only and should never be called - * directly (use Twig\Environment::load() instead). - * - * @internal - */ - public function __construct(Environment $env, Template $template) - { - $this->env = $env; - $this->template = $template; - } - - public function render(array $context = []): string - { - return $this->template->render($context); - } - - public function display(array $context = []) - { - // using func_get_args() allows to not expose the blocks argument - // as it should only be used by internal code - $this->template->display($context, \func_get_args()[1] ?? []); - } - - public function hasBlock(string $name, array $context = []): bool - { - return $this->template->hasBlock($name, $context); - } - - /** - * @return string[] An array of defined template block names - */ - public function getBlockNames(array $context = []): array - { - return $this->template->getBlockNames($context); - } - - public function renderBlock(string $name, array $context = []): string - { - $context = $this->env->mergeGlobals($context); - $level = ob_get_level(); - if ($this->env->isDebug()) { - ob_start(); - } else { - ob_start(function () { return ''; }); - } - try { - $this->template->displayBlock($name, $context); - } catch (\Throwable $e) { - while (ob_get_level() > $level) { - ob_end_clean(); - } - - throw $e; - } - - return ob_get_clean(); - } - - public function displayBlock(string $name, array $context = []) - { - $this->template->displayBlock($name, $this->env->mergeGlobals($context)); - } - - public function getSourceContext(): Source - { - return $this->template->getSourceContext(); - } - - public function getTemplateName(): string - { - return $this->template->getTemplateName(); - } - - /** - * @internal - * - * @return Template - */ - public function unwrap() - { - return $this->template; - } -} diff --git a/system/vendor/twig/twig/src/Test/IntegrationTestCase.php b/system/vendor/twig/twig/src/Test/IntegrationTestCase.php deleted file mode 100644 index e97ad41..0000000 --- a/system/vendor/twig/twig/src/Test/IntegrationTestCase.php +++ /dev/null @@ -1,266 +0,0 @@ - - * @author Karma Dordrak - */ -abstract class IntegrationTestCase extends TestCase -{ - /** - * @return string - */ - abstract protected function getFixturesDir(); - - /** - * @return RuntimeLoaderInterface[] - */ - protected function getRuntimeLoaders() - { - return []; - } - - /** - * @return ExtensionInterface[] - */ - protected function getExtensions() - { - return []; - } - - /** - * @return TwigFilter[] - */ - protected function getTwigFilters() - { - return []; - } - - /** - * @return TwigFunction[] - */ - protected function getTwigFunctions() - { - return []; - } - - /** - * @return TwigTest[] - */ - protected function getTwigTests() - { - return []; - } - - /** - * @dataProvider getTests - */ - public function testIntegration($file, $message, $condition, $templates, $exception, $outputs, $deprecation = '') - { - $this->doIntegrationTest($file, $message, $condition, $templates, $exception, $outputs, $deprecation); - } - - /** - * @dataProvider getLegacyTests - * - * @group legacy - */ - public function testLegacyIntegration($file, $message, $condition, $templates, $exception, $outputs, $deprecation = '') - { - $this->doIntegrationTest($file, $message, $condition, $templates, $exception, $outputs, $deprecation); - } - - public function getTests($name, $legacyTests = false) - { - $fixturesDir = realpath($this->getFixturesDir()); - $tests = []; - - foreach (new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($fixturesDir), \RecursiveIteratorIterator::LEAVES_ONLY) as $file) { - if (!preg_match('/\.test$/', $file)) { - continue; - } - - if ($legacyTests xor str_contains($file->getRealpath(), '.legacy.test')) { - continue; - } - - $test = file_get_contents($file->getRealpath()); - - if (preg_match('/--TEST--\s*(.*?)\s*(?:--CONDITION--\s*(.*))?\s*(?:--DEPRECATION--\s*(.*?))?\s*((?:--TEMPLATE(?:\(.*?\))?--(?:.*?))+)\s*(?:--DATA--\s*(.*))?\s*--EXCEPTION--\s*(.*)/sx', $test, $match)) { - $message = $match[1]; - $condition = $match[2]; - $deprecation = $match[3]; - $templates = self::parseTemplates($match[4]); - $exception = $match[6]; - $outputs = [[null, $match[5], null, '']]; - } elseif (preg_match('/--TEST--\s*(.*?)\s*(?:--CONDITION--\s*(.*))?\s*(?:--DEPRECATION--\s*(.*?))?\s*((?:--TEMPLATE(?:\(.*?\))?--(?:.*?))+)--DATA--.*?--EXPECT--.*/s', $test, $match)) { - $message = $match[1]; - $condition = $match[2]; - $deprecation = $match[3]; - $templates = self::parseTemplates($match[4]); - $exception = false; - preg_match_all('/--DATA--(.*?)(?:--CONFIG--(.*?))?--EXPECT--(.*?)(?=\-\-DATA\-\-|$)/s', $test, $outputs, \PREG_SET_ORDER); - } else { - throw new \InvalidArgumentException(sprintf('Test "%s" is not valid.', str_replace($fixturesDir.'/', '', $file))); - } - - $tests[] = [str_replace($fixturesDir.'/', '', $file), $message, $condition, $templates, $exception, $outputs, $deprecation]; - } - - if ($legacyTests && empty($tests)) { - // add a dummy test to avoid a PHPUnit message - return [['not', '-', '', [], '', []]]; - } - - return $tests; - } - - public function getLegacyTests() - { - return $this->getTests('testLegacyIntegration', true); - } - - protected function doIntegrationTest($file, $message, $condition, $templates, $exception, $outputs, $deprecation = '') - { - if (!$outputs) { - $this->markTestSkipped('no tests to run'); - } - - if ($condition) { - eval('$ret = '.$condition.';'); - if (!$ret) { - $this->markTestSkipped($condition); - } - } - - $loader = new ArrayLoader($templates); - - foreach ($outputs as $i => $match) { - $config = array_merge([ - 'cache' => false, - 'strict_variables' => true, - ], $match[2] ? eval($match[2].';') : []); - $twig = new Environment($loader, $config); - $twig->addGlobal('global', 'global'); - foreach ($this->getRuntimeLoaders() as $runtimeLoader) { - $twig->addRuntimeLoader($runtimeLoader); - } - - foreach ($this->getExtensions() as $extension) { - $twig->addExtension($extension); - } - - foreach ($this->getTwigFilters() as $filter) { - $twig->addFilter($filter); - } - - foreach ($this->getTwigTests() as $test) { - $twig->addTest($test); - } - - foreach ($this->getTwigFunctions() as $function) { - $twig->addFunction($function); - } - - // avoid using the same PHP class name for different cases - $p = new \ReflectionProperty($twig, 'templateClassPrefix'); - $p->setAccessible(true); - $p->setValue($twig, '__TwigTemplate_'.hash(\PHP_VERSION_ID < 80100 ? 'sha256' : 'xxh128', uniqid(mt_rand(), true), false).'_'); - - $deprecations = []; - try { - $prevHandler = set_error_handler(function ($type, $msg, $file, $line, $context = []) use (&$deprecations, &$prevHandler) { - if (\E_USER_DEPRECATED === $type) { - $deprecations[] = $msg; - - return true; - } - - return $prevHandler ? $prevHandler($type, $msg, $file, $line, $context) : false; - }); - - $template = $twig->load('index.twig'); - } catch (\Exception $e) { - if (false !== $exception) { - $message = $e->getMessage(); - $this->assertSame(trim($exception), trim(sprintf('%s: %s', \get_class($e), $message))); - $last = substr($message, \strlen($message) - 1); - $this->assertTrue('.' === $last || '?' === $last, 'Exception message must end with a dot or a question mark.'); - - return; - } - - throw new Error(sprintf('%s: %s', \get_class($e), $e->getMessage()), -1, null, $e); - } finally { - restore_error_handler(); - } - - $this->assertSame($deprecation, implode("\n", $deprecations)); - - try { - $output = trim($template->render(eval($match[1].';')), "\n "); - } catch (\Exception $e) { - if (false !== $exception) { - $this->assertSame(trim($exception), trim(sprintf('%s: %s', \get_class($e), $e->getMessage()))); - - return; - } - - $e = new Error(sprintf('%s: %s', \get_class($e), $e->getMessage()), -1, null, $e); - - $output = trim(sprintf('%s: %s', \get_class($e), $e->getMessage())); - } - - if (false !== $exception) { - list($class) = explode(':', $exception); - $constraintClass = class_exists('PHPUnit\Framework\Constraint\Exception') ? 'PHPUnit\Framework\Constraint\Exception' : 'PHPUnit_Framework_Constraint_Exception'; - $this->assertThat(null, new $constraintClass($class)); - } - - $expected = trim($match[3], "\n "); - - if ($expected !== $output) { - printf("Compiled templates that failed on case %d:\n", $i + 1); - - foreach (array_keys($templates) as $name) { - echo "Template: $name\n"; - echo $twig->compile($twig->parse($twig->tokenize($twig->getLoader()->getSourceContext($name)))); - } - } - $this->assertEquals($expected, $output, $message.' (in '.$file.')'); - } - } - - protected static function parseTemplates($test) - { - $templates = []; - preg_match_all('/--TEMPLATE(?:\((.*?)\))?--(.*?)(?=\-\-TEMPLATE|$)/s', $test, $matches, \PREG_SET_ORDER); - foreach ($matches as $match) { - $templates[$match[1] ?: 'index.twig'] = $match[2]; - } - - return $templates; - } -} diff --git a/system/vendor/twig/twig/src/Test/NodeTestCase.php b/system/vendor/twig/twig/src/Test/NodeTestCase.php deleted file mode 100644 index 8b1bef7..0000000 --- a/system/vendor/twig/twig/src/Test/NodeTestCase.php +++ /dev/null @@ -1,65 +0,0 @@ -assertNodeCompilation($source, $node, $environment, $isPattern); - } - - public function assertNodeCompilation($source, Node $node, Environment $environment = null, $isPattern = false) - { - $compiler = $this->getCompiler($environment); - $compiler->compile($node); - - if ($isPattern) { - $this->assertStringMatchesFormat($source, trim($compiler->getSource())); - } else { - $this->assertEquals($source, trim($compiler->getSource())); - } - } - - protected function getCompiler(Environment $environment = null) - { - return new Compiler($environment ?? $this->getEnvironment()); - } - - protected function getEnvironment() - { - return new Environment(new ArrayLoader([])); - } - - protected function getVariableGetter($name, $line = false) - { - $line = $line > 0 ? "// line $line\n" : ''; - - return sprintf('%s($context["%s"] ?? null)', $line, $name); - } - - protected function getAttributeGetter() - { - return 'twig_get_attribute($this->env, $this->source, '; - } -} diff --git a/system/vendor/twig/twig/src/Token.php b/system/vendor/twig/twig/src/Token.php deleted file mode 100644 index 59279b8..0000000 --- a/system/vendor/twig/twig/src/Token.php +++ /dev/null @@ -1,184 +0,0 @@ - - */ -final class Token -{ - private $value; - private $type; - private $lineno; - - public const EOF_TYPE = -1; - public const TEXT_TYPE = 0; - public const BLOCK_START_TYPE = 1; - public const VAR_START_TYPE = 2; - public const BLOCK_END_TYPE = 3; - public const VAR_END_TYPE = 4; - public const NAME_TYPE = 5; - public const NUMBER_TYPE = 6; - public const STRING_TYPE = 7; - public const OPERATOR_TYPE = 8; - public const PUNCTUATION_TYPE = 9; - public const INTERPOLATION_START_TYPE = 10; - public const INTERPOLATION_END_TYPE = 11; - public const ARROW_TYPE = 12; - public const SPREAD_TYPE = 13; - - public function __construct(int $type, $value, int $lineno) - { - $this->type = $type; - $this->value = $value; - $this->lineno = $lineno; - } - - public function __toString() - { - return sprintf('%s(%s)', self::typeToString($this->type, true), $this->value); - } - - /** - * Tests the current token for a type and/or a value. - * - * Parameters may be: - * * just type - * * type and value (or array of possible values) - * * just value (or array of possible values) (NAME_TYPE is used as type) - * - * @param array|string|int $type The type to test - * @param array|string|null $values The token value - */ - public function test($type, $values = null): bool - { - if (null === $values && !\is_int($type)) { - $values = $type; - $type = self::NAME_TYPE; - } - - return ($this->type === $type) && ( - null === $values - || (\is_array($values) && \in_array($this->value, $values)) - || $this->value == $values - ); - } - - public function getLine(): int - { - return $this->lineno; - } - - public function getType(): int - { - return $this->type; - } - - public function getValue() - { - return $this->value; - } - - public static function typeToString(int $type, bool $short = false): string - { - switch ($type) { - case self::EOF_TYPE: - $name = 'EOF_TYPE'; - break; - case self::TEXT_TYPE: - $name = 'TEXT_TYPE'; - break; - case self::BLOCK_START_TYPE: - $name = 'BLOCK_START_TYPE'; - break; - case self::VAR_START_TYPE: - $name = 'VAR_START_TYPE'; - break; - case self::BLOCK_END_TYPE: - $name = 'BLOCK_END_TYPE'; - break; - case self::VAR_END_TYPE: - $name = 'VAR_END_TYPE'; - break; - case self::NAME_TYPE: - $name = 'NAME_TYPE'; - break; - case self::NUMBER_TYPE: - $name = 'NUMBER_TYPE'; - break; - case self::STRING_TYPE: - $name = 'STRING_TYPE'; - break; - case self::OPERATOR_TYPE: - $name = 'OPERATOR_TYPE'; - break; - case self::PUNCTUATION_TYPE: - $name = 'PUNCTUATION_TYPE'; - break; - case self::INTERPOLATION_START_TYPE: - $name = 'INTERPOLATION_START_TYPE'; - break; - case self::INTERPOLATION_END_TYPE: - $name = 'INTERPOLATION_END_TYPE'; - break; - case self::ARROW_TYPE: - $name = 'ARROW_TYPE'; - break; - case self::SPREAD_TYPE: - $name = 'SPREAD_TYPE'; - break; - default: - throw new \LogicException(sprintf('Token of type "%s" does not exist.', $type)); - } - - return $short ? $name : 'Twig\Token::'.$name; - } - - public static function typeToEnglish(int $type): string - { - switch ($type) { - case self::EOF_TYPE: - return 'end of template'; - case self::TEXT_TYPE: - return 'text'; - case self::BLOCK_START_TYPE: - return 'begin of statement block'; - case self::VAR_START_TYPE: - return 'begin of print statement'; - case self::BLOCK_END_TYPE: - return 'end of statement block'; - case self::VAR_END_TYPE: - return 'end of print statement'; - case self::NAME_TYPE: - return 'name'; - case self::NUMBER_TYPE: - return 'number'; - case self::STRING_TYPE: - return 'string'; - case self::OPERATOR_TYPE: - return 'operator'; - case self::PUNCTUATION_TYPE: - return 'punctuation'; - case self::INTERPOLATION_START_TYPE: - return 'begin of string interpolation'; - case self::INTERPOLATION_END_TYPE: - return 'end of string interpolation'; - case self::ARROW_TYPE: - return 'arrow function'; - case self::SPREAD_TYPE: - return 'spread operator'; - default: - throw new \LogicException(sprintf('Token of type "%s" does not exist.', $type)); - } - } -} diff --git a/system/vendor/twig/twig/src/TokenParser/AbstractTokenParser.php b/system/vendor/twig/twig/src/TokenParser/AbstractTokenParser.php deleted file mode 100644 index 720ea67..0000000 --- a/system/vendor/twig/twig/src/TokenParser/AbstractTokenParser.php +++ /dev/null @@ -1,32 +0,0 @@ - - */ -abstract class AbstractTokenParser implements TokenParserInterface -{ - /** - * @var Parser - */ - protected $parser; - - public function setParser(Parser $parser): void - { - $this->parser = $parser; - } -} diff --git a/system/vendor/twig/twig/src/TokenParser/ApplyTokenParser.php b/system/vendor/twig/twig/src/TokenParser/ApplyTokenParser.php deleted file mode 100644 index 4dbf304..0000000 --- a/system/vendor/twig/twig/src/TokenParser/ApplyTokenParser.php +++ /dev/null @@ -1,60 +0,0 @@ -getLine(); - $name = $this->parser->getVarName(); - - $ref = new TempNameExpression($name, $lineno); - $ref->setAttribute('always_defined', true); - - $filter = $this->parser->getExpressionParser()->parseFilterExpressionRaw($ref, $this->getTag()); - - $this->parser->getStream()->expect(Token::BLOCK_END_TYPE); - $body = $this->parser->subparse([$this, 'decideApplyEnd'], true); - $this->parser->getStream()->expect(Token::BLOCK_END_TYPE); - - return new Node([ - new SetNode(true, $ref, $body, $lineno, $this->getTag()), - new PrintNode($filter, $lineno, $this->getTag()), - ]); - } - - public function decideApplyEnd(Token $token): bool - { - return $token->test('endapply'); - } - - public function getTag(): string - { - return 'apply'; - } -} diff --git a/system/vendor/twig/twig/src/TokenParser/AutoEscapeTokenParser.php b/system/vendor/twig/twig/src/TokenParser/AutoEscapeTokenParser.php deleted file mode 100644 index b674bea..0000000 --- a/system/vendor/twig/twig/src/TokenParser/AutoEscapeTokenParser.php +++ /dev/null @@ -1,58 +0,0 @@ -getLine(); - $stream = $this->parser->getStream(); - - if ($stream->test(/* Token::BLOCK_END_TYPE */ 3)) { - $value = 'html'; - } else { - $expr = $this->parser->getExpressionParser()->parseExpression(); - if (!$expr instanceof ConstantExpression) { - throw new SyntaxError('An escaping strategy must be a string or false.', $stream->getCurrent()->getLine(), $stream->getSourceContext()); - } - $value = $expr->getAttribute('value'); - } - - $stream->expect(/* Token::BLOCK_END_TYPE */ 3); - $body = $this->parser->subparse([$this, 'decideBlockEnd'], true); - $stream->expect(/* Token::BLOCK_END_TYPE */ 3); - - return new AutoEscapeNode($value, $body, $lineno, $this->getTag()); - } - - public function decideBlockEnd(Token $token): bool - { - return $token->test('endautoescape'); - } - - public function getTag(): string - { - return 'autoescape'; - } -} diff --git a/system/vendor/twig/twig/src/TokenParser/BlockTokenParser.php b/system/vendor/twig/twig/src/TokenParser/BlockTokenParser.php deleted file mode 100644 index 5878131..0000000 --- a/system/vendor/twig/twig/src/TokenParser/BlockTokenParser.php +++ /dev/null @@ -1,78 +0,0 @@ - - * {% block title %}{% endblock %} - My Webpage - * {% endblock %} - * - * @internal - */ -final class BlockTokenParser extends AbstractTokenParser -{ - public function parse(Token $token): Node - { - $lineno = $token->getLine(); - $stream = $this->parser->getStream(); - $name = $stream->expect(/* Token::NAME_TYPE */ 5)->getValue(); - if ($this->parser->hasBlock($name)) { - throw new SyntaxError(sprintf("The block '%s' has already been defined line %d.", $name, $this->parser->getBlock($name)->getTemplateLine()), $stream->getCurrent()->getLine(), $stream->getSourceContext()); - } - $this->parser->setBlock($name, $block = new BlockNode($name, new Node([]), $lineno)); - $this->parser->pushLocalScope(); - $this->parser->pushBlockStack($name); - - if ($stream->nextIf(/* Token::BLOCK_END_TYPE */ 3)) { - $body = $this->parser->subparse([$this, 'decideBlockEnd'], true); - if ($token = $stream->nextIf(/* Token::NAME_TYPE */ 5)) { - $value = $token->getValue(); - - if ($value != $name) { - throw new SyntaxError(sprintf('Expected endblock for block "%s" (but "%s" given).', $name, $value), $stream->getCurrent()->getLine(), $stream->getSourceContext()); - } - } - } else { - $body = new Node([ - new PrintNode($this->parser->getExpressionParser()->parseExpression(), $lineno), - ]); - } - $stream->expect(/* Token::BLOCK_END_TYPE */ 3); - - $block->setNode('body', $body); - $this->parser->popBlockStack(); - $this->parser->popLocalScope(); - - return new BlockReferenceNode($name, $lineno, $this->getTag()); - } - - public function decideBlockEnd(Token $token): bool - { - return $token->test('endblock'); - } - - public function getTag(): string - { - return 'block'; - } -} diff --git a/system/vendor/twig/twig/src/TokenParser/DeprecatedTokenParser.php b/system/vendor/twig/twig/src/TokenParser/DeprecatedTokenParser.php deleted file mode 100644 index 31416c7..0000000 --- a/system/vendor/twig/twig/src/TokenParser/DeprecatedTokenParser.php +++ /dev/null @@ -1,43 +0,0 @@ - - * - * @internal - */ -final class DeprecatedTokenParser extends AbstractTokenParser -{ - public function parse(Token $token): Node - { - $expr = $this->parser->getExpressionParser()->parseExpression(); - - $this->parser->getStream()->expect(Token::BLOCK_END_TYPE); - - return new DeprecatedNode($expr, $token->getLine(), $this->getTag()); - } - - public function getTag(): string - { - return 'deprecated'; - } -} diff --git a/system/vendor/twig/twig/src/TokenParser/DoTokenParser.php b/system/vendor/twig/twig/src/TokenParser/DoTokenParser.php deleted file mode 100644 index 32c8f12..0000000 --- a/system/vendor/twig/twig/src/TokenParser/DoTokenParser.php +++ /dev/null @@ -1,38 +0,0 @@ -parser->getExpressionParser()->parseExpression(); - - $this->parser->getStream()->expect(/* Token::BLOCK_END_TYPE */ 3); - - return new DoNode($expr, $token->getLine(), $this->getTag()); - } - - public function getTag(): string - { - return 'do'; - } -} diff --git a/system/vendor/twig/twig/src/TokenParser/EmbedTokenParser.php b/system/vendor/twig/twig/src/TokenParser/EmbedTokenParser.php deleted file mode 100644 index 64b4f29..0000000 --- a/system/vendor/twig/twig/src/TokenParser/EmbedTokenParser.php +++ /dev/null @@ -1,73 +0,0 @@ -parser->getStream(); - - $parent = $this->parser->getExpressionParser()->parseExpression(); - - list($variables, $only, $ignoreMissing) = $this->parseArguments(); - - $parentToken = $fakeParentToken = new Token(/* Token::STRING_TYPE */ 7, '__parent__', $token->getLine()); - if ($parent instanceof ConstantExpression) { - $parentToken = new Token(/* Token::STRING_TYPE */ 7, $parent->getAttribute('value'), $token->getLine()); - } elseif ($parent instanceof NameExpression) { - $parentToken = new Token(/* Token::NAME_TYPE */ 5, $parent->getAttribute('name'), $token->getLine()); - } - - // inject a fake parent to make the parent() function work - $stream->injectTokens([ - new Token(/* Token::BLOCK_START_TYPE */ 1, '', $token->getLine()), - new Token(/* Token::NAME_TYPE */ 5, 'extends', $token->getLine()), - $parentToken, - new Token(/* Token::BLOCK_END_TYPE */ 3, '', $token->getLine()), - ]); - - $module = $this->parser->parse($stream, [$this, 'decideBlockEnd'], true); - - // override the parent with the correct one - if ($fakeParentToken === $parentToken) { - $module->setNode('parent', $parent); - } - - $this->parser->embedTemplate($module); - - $stream->expect(/* Token::BLOCK_END_TYPE */ 3); - - return new EmbedNode($module->getTemplateName(), $module->getAttribute('index'), $variables, $only, $ignoreMissing, $token->getLine(), $this->getTag()); - } - - public function decideBlockEnd(Token $token): bool - { - return $token->test('endembed'); - } - - public function getTag(): string - { - return 'embed'; - } -} diff --git a/system/vendor/twig/twig/src/TokenParser/ExtendsTokenParser.php b/system/vendor/twig/twig/src/TokenParser/ExtendsTokenParser.php deleted file mode 100644 index 0ca46dd..0000000 --- a/system/vendor/twig/twig/src/TokenParser/ExtendsTokenParser.php +++ /dev/null @@ -1,52 +0,0 @@ -parser->getStream(); - - if ($this->parser->peekBlockStack()) { - throw new SyntaxError('Cannot use "extend" in a block.', $token->getLine(), $stream->getSourceContext()); - } elseif (!$this->parser->isMainScope()) { - throw new SyntaxError('Cannot use "extend" in a macro.', $token->getLine(), $stream->getSourceContext()); - } - - if (null !== $this->parser->getParent()) { - throw new SyntaxError('Multiple extends tags are forbidden.', $token->getLine(), $stream->getSourceContext()); - } - $this->parser->setParent($this->parser->getExpressionParser()->parseExpression()); - - $stream->expect(/* Token::BLOCK_END_TYPE */ 3); - - return new Node(); - } - - public function getTag(): string - { - return 'extends'; - } -} diff --git a/system/vendor/twig/twig/src/TokenParser/FlushTokenParser.php b/system/vendor/twig/twig/src/TokenParser/FlushTokenParser.php deleted file mode 100644 index 02c74aa..0000000 --- a/system/vendor/twig/twig/src/TokenParser/FlushTokenParser.php +++ /dev/null @@ -1,38 +0,0 @@ -parser->getStream()->expect(/* Token::BLOCK_END_TYPE */ 3); - - return new FlushNode($token->getLine(), $this->getTag()); - } - - public function getTag(): string - { - return 'flush'; - } -} diff --git a/system/vendor/twig/twig/src/TokenParser/ForTokenParser.php b/system/vendor/twig/twig/src/TokenParser/ForTokenParser.php deleted file mode 100644 index bac8ba2..0000000 --- a/system/vendor/twig/twig/src/TokenParser/ForTokenParser.php +++ /dev/null @@ -1,78 +0,0 @@ - - * {% for user in users %} - *
  • {{ user.username|e }}
  • - * {% endfor %} - * - * - * @internal - */ -final class ForTokenParser extends AbstractTokenParser -{ - public function parse(Token $token): Node - { - $lineno = $token->getLine(); - $stream = $this->parser->getStream(); - $targets = $this->parser->getExpressionParser()->parseAssignmentExpression(); - $stream->expect(/* Token::OPERATOR_TYPE */ 8, 'in'); - $seq = $this->parser->getExpressionParser()->parseExpression(); - - $stream->expect(/* Token::BLOCK_END_TYPE */ 3); - $body = $this->parser->subparse([$this, 'decideForFork']); - if ('else' == $stream->next()->getValue()) { - $stream->expect(/* Token::BLOCK_END_TYPE */ 3); - $else = $this->parser->subparse([$this, 'decideForEnd'], true); - } else { - $else = null; - } - $stream->expect(/* Token::BLOCK_END_TYPE */ 3); - - if (\count($targets) > 1) { - $keyTarget = $targets->getNode(0); - $keyTarget = new AssignNameExpression($keyTarget->getAttribute('name'), $keyTarget->getTemplateLine()); - $valueTarget = $targets->getNode(1); - } else { - $keyTarget = new AssignNameExpression('_key', $lineno); - $valueTarget = $targets->getNode(0); - } - $valueTarget = new AssignNameExpression($valueTarget->getAttribute('name'), $valueTarget->getTemplateLine()); - - return new ForNode($keyTarget, $valueTarget, $seq, null, $body, $else, $lineno, $this->getTag()); - } - - public function decideForFork(Token $token): bool - { - return $token->test(['else', 'endfor']); - } - - public function decideForEnd(Token $token): bool - { - return $token->test('endfor'); - } - - public function getTag(): string - { - return 'for'; - } -} diff --git a/system/vendor/twig/twig/src/TokenParser/FromTokenParser.php b/system/vendor/twig/twig/src/TokenParser/FromTokenParser.php deleted file mode 100644 index 31b6cde..0000000 --- a/system/vendor/twig/twig/src/TokenParser/FromTokenParser.php +++ /dev/null @@ -1,66 +0,0 @@ -parser->getExpressionParser()->parseExpression(); - $stream = $this->parser->getStream(); - $stream->expect(/* Token::NAME_TYPE */ 5, 'import'); - - $targets = []; - while (true) { - $name = $stream->expect(/* Token::NAME_TYPE */ 5)->getValue(); - - $alias = $name; - if ($stream->nextIf('as')) { - $alias = $stream->expect(/* Token::NAME_TYPE */ 5)->getValue(); - } - - $targets[$name] = $alias; - - if (!$stream->nextIf(/* Token::PUNCTUATION_TYPE */ 9, ',')) { - break; - } - } - - $stream->expect(/* Token::BLOCK_END_TYPE */ 3); - - $var = new AssignNameExpression($this->parser->getVarName(), $token->getLine()); - $node = new ImportNode($macro, $var, $token->getLine(), $this->getTag(), $this->parser->isMainScope()); - - foreach ($targets as $name => $alias) { - $this->parser->addImportedSymbol('function', $alias, 'macro_'.$name, $var); - } - - return $node; - } - - public function getTag(): string - { - return 'from'; - } -} diff --git a/system/vendor/twig/twig/src/TokenParser/IfTokenParser.php b/system/vendor/twig/twig/src/TokenParser/IfTokenParser.php deleted file mode 100644 index c0fe6df..0000000 --- a/system/vendor/twig/twig/src/TokenParser/IfTokenParser.php +++ /dev/null @@ -1,89 +0,0 @@ - - * {% for user in users %} - *
  • {{ user.username|e }}
  • - * {% endfor %} - * - * {% endif %} - * - * @internal - */ -final class IfTokenParser extends AbstractTokenParser -{ - public function parse(Token $token): Node - { - $lineno = $token->getLine(); - $expr = $this->parser->getExpressionParser()->parseExpression(); - $stream = $this->parser->getStream(); - $stream->expect(/* Token::BLOCK_END_TYPE */ 3); - $body = $this->parser->subparse([$this, 'decideIfFork']); - $tests = [$expr, $body]; - $else = null; - - $end = false; - while (!$end) { - switch ($stream->next()->getValue()) { - case 'else': - $stream->expect(/* Token::BLOCK_END_TYPE */ 3); - $else = $this->parser->subparse([$this, 'decideIfEnd']); - break; - - case 'elseif': - $expr = $this->parser->getExpressionParser()->parseExpression(); - $stream->expect(/* Token::BLOCK_END_TYPE */ 3); - $body = $this->parser->subparse([$this, 'decideIfFork']); - $tests[] = $expr; - $tests[] = $body; - break; - - case 'endif': - $end = true; - break; - - default: - throw new SyntaxError(sprintf('Unexpected end of template. Twig was looking for the following tags "else", "elseif", or "endif" to close the "if" block started at line %d).', $lineno), $stream->getCurrent()->getLine(), $stream->getSourceContext()); - } - } - - $stream->expect(/* Token::BLOCK_END_TYPE */ 3); - - return new IfNode(new Node($tests), $else, $lineno, $this->getTag()); - } - - public function decideIfFork(Token $token): bool - { - return $token->test(['elseif', 'else', 'endif']); - } - - public function decideIfEnd(Token $token): bool - { - return $token->test(['endif']); - } - - public function getTag(): string - { - return 'if'; - } -} diff --git a/system/vendor/twig/twig/src/TokenParser/ImportTokenParser.php b/system/vendor/twig/twig/src/TokenParser/ImportTokenParser.php deleted file mode 100644 index 44cb4da..0000000 --- a/system/vendor/twig/twig/src/TokenParser/ImportTokenParser.php +++ /dev/null @@ -1,44 +0,0 @@ -parser->getExpressionParser()->parseExpression(); - $this->parser->getStream()->expect(/* Token::NAME_TYPE */ 5, 'as'); - $var = new AssignNameExpression($this->parser->getStream()->expect(/* Token::NAME_TYPE */ 5)->getValue(), $token->getLine()); - $this->parser->getStream()->expect(/* Token::BLOCK_END_TYPE */ 3); - - $this->parser->addImportedSymbol('template', $var->getAttribute('name')); - - return new ImportNode($macro, $var, $token->getLine(), $this->getTag(), $this->parser->isMainScope()); - } - - public function getTag(): string - { - return 'import'; - } -} diff --git a/system/vendor/twig/twig/src/TokenParser/IncludeTokenParser.php b/system/vendor/twig/twig/src/TokenParser/IncludeTokenParser.php deleted file mode 100644 index 28beb8a..0000000 --- a/system/vendor/twig/twig/src/TokenParser/IncludeTokenParser.php +++ /dev/null @@ -1,69 +0,0 @@ -parser->getExpressionParser()->parseExpression(); - - list($variables, $only, $ignoreMissing) = $this->parseArguments(); - - return new IncludeNode($expr, $variables, $only, $ignoreMissing, $token->getLine(), $this->getTag()); - } - - protected function parseArguments() - { - $stream = $this->parser->getStream(); - - $ignoreMissing = false; - if ($stream->nextIf(/* Token::NAME_TYPE */ 5, 'ignore')) { - $stream->expect(/* Token::NAME_TYPE */ 5, 'missing'); - - $ignoreMissing = true; - } - - $variables = null; - if ($stream->nextIf(/* Token::NAME_TYPE */ 5, 'with')) { - $variables = $this->parser->getExpressionParser()->parseExpression(); - } - - $only = false; - if ($stream->nextIf(/* Token::NAME_TYPE */ 5, 'only')) { - $only = true; - } - - $stream->expect(/* Token::BLOCK_END_TYPE */ 3); - - return [$variables, $only, $ignoreMissing]; - } - - public function getTag(): string - { - return 'include'; - } -} diff --git a/system/vendor/twig/twig/src/TokenParser/MacroTokenParser.php b/system/vendor/twig/twig/src/TokenParser/MacroTokenParser.php deleted file mode 100644 index f584927..0000000 --- a/system/vendor/twig/twig/src/TokenParser/MacroTokenParser.php +++ /dev/null @@ -1,66 +0,0 @@ - - * {% endmacro %} - * - * @internal - */ -final class MacroTokenParser extends AbstractTokenParser -{ - public function parse(Token $token): Node - { - $lineno = $token->getLine(); - $stream = $this->parser->getStream(); - $name = $stream->expect(/* Token::NAME_TYPE */ 5)->getValue(); - - $arguments = $this->parser->getExpressionParser()->parseArguments(true, true); - - $stream->expect(/* Token::BLOCK_END_TYPE */ 3); - $this->parser->pushLocalScope(); - $body = $this->parser->subparse([$this, 'decideBlockEnd'], true); - if ($token = $stream->nextIf(/* Token::NAME_TYPE */ 5)) { - $value = $token->getValue(); - - if ($value != $name) { - throw new SyntaxError(sprintf('Expected endmacro for macro "%s" (but "%s" given).', $name, $value), $stream->getCurrent()->getLine(), $stream->getSourceContext()); - } - } - $this->parser->popLocalScope(); - $stream->expect(/* Token::BLOCK_END_TYPE */ 3); - - $this->parser->setMacro($name, new MacroNode($name, new BodyNode([$body]), $arguments, $lineno, $this->getTag())); - - return new Node(); - } - - public function decideBlockEnd(Token $token): bool - { - return $token->test('endmacro'); - } - - public function getTag(): string - { - return 'macro'; - } -} diff --git a/system/vendor/twig/twig/src/TokenParser/SandboxTokenParser.php b/system/vendor/twig/twig/src/TokenParser/SandboxTokenParser.php deleted file mode 100644 index c919556..0000000 --- a/system/vendor/twig/twig/src/TokenParser/SandboxTokenParser.php +++ /dev/null @@ -1,66 +0,0 @@ -parser->getStream(); - $stream->expect(/* Token::BLOCK_END_TYPE */ 3); - $body = $this->parser->subparse([$this, 'decideBlockEnd'], true); - $stream->expect(/* Token::BLOCK_END_TYPE */ 3); - - // in a sandbox tag, only include tags are allowed - if (!$body instanceof IncludeNode) { - foreach ($body as $node) { - if ($node instanceof TextNode && ctype_space($node->getAttribute('data'))) { - continue; - } - - if (!$node instanceof IncludeNode) { - throw new SyntaxError('Only "include" tags are allowed within a "sandbox" section.', $node->getTemplateLine(), $stream->getSourceContext()); - } - } - } - - return new SandboxNode($body, $token->getLine(), $this->getTag()); - } - - public function decideBlockEnd(Token $token): bool - { - return $token->test('endsandbox'); - } - - public function getTag(): string - { - return 'sandbox'; - } -} diff --git a/system/vendor/twig/twig/src/TokenParser/SetTokenParser.php b/system/vendor/twig/twig/src/TokenParser/SetTokenParser.php deleted file mode 100644 index 2fbdfe0..0000000 --- a/system/vendor/twig/twig/src/TokenParser/SetTokenParser.php +++ /dev/null @@ -1,73 +0,0 @@ -getLine(); - $stream = $this->parser->getStream(); - $names = $this->parser->getExpressionParser()->parseAssignmentExpression(); - - $capture = false; - if ($stream->nextIf(/* Token::OPERATOR_TYPE */ 8, '=')) { - $values = $this->parser->getExpressionParser()->parseMultitargetExpression(); - - $stream->expect(/* Token::BLOCK_END_TYPE */ 3); - - if (\count($names) !== \count($values)) { - throw new SyntaxError('When using set, you must have the same number of variables and assignments.', $stream->getCurrent()->getLine(), $stream->getSourceContext()); - } - } else { - $capture = true; - - if (\count($names) > 1) { - throw new SyntaxError('When using set with a block, you cannot have a multi-target.', $stream->getCurrent()->getLine(), $stream->getSourceContext()); - } - - $stream->expect(/* Token::BLOCK_END_TYPE */ 3); - - $values = $this->parser->subparse([$this, 'decideBlockEnd'], true); - $stream->expect(/* Token::BLOCK_END_TYPE */ 3); - } - - return new SetNode($capture, $names, $values, $lineno, $this->getTag()); - } - - public function decideBlockEnd(Token $token): bool - { - return $token->test('endset'); - } - - public function getTag(): string - { - return 'set'; - } -} diff --git a/system/vendor/twig/twig/src/TokenParser/TokenParserInterface.php b/system/vendor/twig/twig/src/TokenParser/TokenParserInterface.php deleted file mode 100644 index bb8db3e..0000000 --- a/system/vendor/twig/twig/src/TokenParser/TokenParserInterface.php +++ /dev/null @@ -1,46 +0,0 @@ - - */ -interface TokenParserInterface -{ - /** - * Sets the parser associated with this token parser. - */ - public function setParser(Parser $parser): void; - - /** - * Parses a token and returns a node. - * - * @return Node - * - * @throws SyntaxError - */ - public function parse(Token $token); - - /** - * Gets the tag name associated with this token parser. - * - * @return string - */ - public function getTag(); -} diff --git a/system/vendor/twig/twig/src/TokenParser/UseTokenParser.php b/system/vendor/twig/twig/src/TokenParser/UseTokenParser.php deleted file mode 100644 index 3cdbb98..0000000 --- a/system/vendor/twig/twig/src/TokenParser/UseTokenParser.php +++ /dev/null @@ -1,73 +0,0 @@ -parser->getExpressionParser()->parseExpression(); - $stream = $this->parser->getStream(); - - if (!$template instanceof ConstantExpression) { - throw new SyntaxError('The template references in a "use" statement must be a string.', $stream->getCurrent()->getLine(), $stream->getSourceContext()); - } - - $targets = []; - if ($stream->nextIf('with')) { - while (true) { - $name = $stream->expect(/* Token::NAME_TYPE */ 5)->getValue(); - - $alias = $name; - if ($stream->nextIf('as')) { - $alias = $stream->expect(/* Token::NAME_TYPE */ 5)->getValue(); - } - - $targets[$name] = new ConstantExpression($alias, -1); - - if (!$stream->nextIf(/* Token::PUNCTUATION_TYPE */ 9, ',')) { - break; - } - } - } - - $stream->expect(/* Token::BLOCK_END_TYPE */ 3); - - $this->parser->addTrait(new Node(['template' => $template, 'targets' => new Node($targets)])); - - return new Node(); - } - - public function getTag(): string - { - return 'use'; - } -} diff --git a/system/vendor/twig/twig/src/TokenParser/WithTokenParser.php b/system/vendor/twig/twig/src/TokenParser/WithTokenParser.php deleted file mode 100644 index 7d8cbe2..0000000 --- a/system/vendor/twig/twig/src/TokenParser/WithTokenParser.php +++ /dev/null @@ -1,56 +0,0 @@ - - * - * @internal - */ -final class WithTokenParser extends AbstractTokenParser -{ - public function parse(Token $token): Node - { - $stream = $this->parser->getStream(); - - $variables = null; - $only = false; - if (!$stream->test(/* Token::BLOCK_END_TYPE */ 3)) { - $variables = $this->parser->getExpressionParser()->parseExpression(); - $only = (bool) $stream->nextIf(/* Token::NAME_TYPE */ 5, 'only'); - } - - $stream->expect(/* Token::BLOCK_END_TYPE */ 3); - - $body = $this->parser->subparse([$this, 'decideWithEnd'], true); - - $stream->expect(/* Token::BLOCK_END_TYPE */ 3); - - return new WithNode($body, $variables, $only, $token->getLine(), $this->getTag()); - } - - public function decideWithEnd(Token $token): bool - { - return $token->test('endwith'); - } - - public function getTag(): string - { - return 'with'; - } -} diff --git a/system/vendor/twig/twig/src/TokenStream.php b/system/vendor/twig/twig/src/TokenStream.php deleted file mode 100644 index 1eac11a..0000000 --- a/system/vendor/twig/twig/src/TokenStream.php +++ /dev/null @@ -1,132 +0,0 @@ - - */ -final class TokenStream -{ - private $tokens; - private $current = 0; - private $source; - - public function __construct(array $tokens, Source $source = null) - { - $this->tokens = $tokens; - $this->source = $source ?: new Source('', ''); - } - - public function __toString() - { - return implode("\n", $this->tokens); - } - - public function injectTokens(array $tokens) - { - $this->tokens = array_merge(\array_slice($this->tokens, 0, $this->current), $tokens, \array_slice($this->tokens, $this->current)); - } - - /** - * Sets the pointer to the next token and returns the old one. - */ - public function next(): Token - { - if (!isset($this->tokens[++$this->current])) { - throw new SyntaxError('Unexpected end of template.', $this->tokens[$this->current - 1]->getLine(), $this->source); - } - - return $this->tokens[$this->current - 1]; - } - - /** - * Tests a token, sets the pointer to the next one and returns it or throws a syntax error. - * - * @return Token|null The next token if the condition is true, null otherwise - */ - public function nextIf($primary, $secondary = null) - { - if ($this->tokens[$this->current]->test($primary, $secondary)) { - return $this->next(); - } - } - - /** - * Tests a token and returns it or throws a syntax error. - */ - public function expect($type, $value = null, string $message = null): Token - { - $token = $this->tokens[$this->current]; - if (!$token->test($type, $value)) { - $line = $token->getLine(); - throw new SyntaxError(sprintf('%sUnexpected token "%s"%s ("%s" expected%s).', - $message ? $message.'. ' : '', - Token::typeToEnglish($token->getType()), - $token->getValue() ? sprintf(' of value "%s"', $token->getValue()) : '', - Token::typeToEnglish($type), $value ? sprintf(' with value "%s"', $value) : ''), - $line, - $this->source - ); - } - $this->next(); - - return $token; - } - - /** - * Looks at the next token. - */ - public function look(int $number = 1): Token - { - if (!isset($this->tokens[$this->current + $number])) { - throw new SyntaxError('Unexpected end of template.', $this->tokens[$this->current + $number - 1]->getLine(), $this->source); - } - - return $this->tokens[$this->current + $number]; - } - - /** - * Tests the current token. - */ - public function test($primary, $secondary = null): bool - { - return $this->tokens[$this->current]->test($primary, $secondary); - } - - /** - * Checks if end of stream was reached. - */ - public function isEOF(): bool - { - return /* Token::EOF_TYPE */ -1 === $this->tokens[$this->current]->getType(); - } - - public function getCurrent(): Token - { - return $this->tokens[$this->current]; - } - - /** - * Gets the source associated with this stream. - * - * @internal - */ - public function getSourceContext(): Source - { - return $this->source; - } -} diff --git a/system/vendor/twig/twig/src/TwigFilter.php b/system/vendor/twig/twig/src/TwigFilter.php deleted file mode 100644 index 8993026..0000000 --- a/system/vendor/twig/twig/src/TwigFilter.php +++ /dev/null @@ -1,134 +0,0 @@ - - * - * @see https://twig.symfony.com/doc/templates.html#filters - */ -final class TwigFilter -{ - private $name; - private $callable; - private $options; - private $arguments = []; - - /** - * @param callable|array{class-string, string}|null $callable A callable implementing the filter. If null, you need to overwrite the "node_class" option to customize compilation. - */ - public function __construct(string $name, $callable = null, array $options = []) - { - $this->name = $name; - $this->callable = $callable; - $this->options = array_merge([ - 'needs_environment' => false, - 'needs_context' => false, - 'is_variadic' => false, - 'is_safe' => null, - 'is_safe_callback' => null, - 'pre_escape' => null, - 'preserves_safety' => null, - 'node_class' => FilterExpression::class, - 'deprecated' => false, - 'alternative' => null, - ], $options); - } - - public function getName(): string - { - return $this->name; - } - - /** - * Returns the callable to execute for this filter. - * - * @return callable|array{class-string, string}|null - */ - public function getCallable() - { - return $this->callable; - } - - public function getNodeClass(): string - { - return $this->options['node_class']; - } - - public function setArguments(array $arguments): void - { - $this->arguments = $arguments; - } - - public function getArguments(): array - { - return $this->arguments; - } - - public function needsEnvironment(): bool - { - return $this->options['needs_environment']; - } - - public function needsContext(): bool - { - return $this->options['needs_context']; - } - - public function getSafe(Node $filterArgs): ?array - { - if (null !== $this->options['is_safe']) { - return $this->options['is_safe']; - } - - if (null !== $this->options['is_safe_callback']) { - return $this->options['is_safe_callback']($filterArgs); - } - - return null; - } - - public function getPreservesSafety(): ?array - { - return $this->options['preserves_safety']; - } - - public function getPreEscape(): ?string - { - return $this->options['pre_escape']; - } - - public function isVariadic(): bool - { - return $this->options['is_variadic']; - } - - public function isDeprecated(): bool - { - return (bool) $this->options['deprecated']; - } - - public function getDeprecatedVersion(): string - { - return \is_bool($this->options['deprecated']) ? '' : $this->options['deprecated']; - } - - public function getAlternative(): ?string - { - return $this->options['alternative']; - } -} diff --git a/system/vendor/twig/twig/src/TwigFunction.php b/system/vendor/twig/twig/src/TwigFunction.php deleted file mode 100644 index d910d1f..0000000 --- a/system/vendor/twig/twig/src/TwigFunction.php +++ /dev/null @@ -1,122 +0,0 @@ - - * - * @see https://twig.symfony.com/doc/templates.html#functions - */ -final class TwigFunction -{ - private $name; - private $callable; - private $options; - private $arguments = []; - - /** - * @param callable|array{class-string, string}|null $callable A callable implementing the function. If null, you need to overwrite the "node_class" option to customize compilation. - */ - public function __construct(string $name, $callable = null, array $options = []) - { - $this->name = $name; - $this->callable = $callable; - $this->options = array_merge([ - 'needs_environment' => false, - 'needs_context' => false, - 'is_variadic' => false, - 'is_safe' => null, - 'is_safe_callback' => null, - 'node_class' => FunctionExpression::class, - 'deprecated' => false, - 'alternative' => null, - ], $options); - } - - public function getName(): string - { - return $this->name; - } - - /** - * Returns the callable to execute for this function. - * - * @return callable|array{class-string, string}|null - */ - public function getCallable() - { - return $this->callable; - } - - public function getNodeClass(): string - { - return $this->options['node_class']; - } - - public function setArguments(array $arguments): void - { - $this->arguments = $arguments; - } - - public function getArguments(): array - { - return $this->arguments; - } - - public function needsEnvironment(): bool - { - return $this->options['needs_environment']; - } - - public function needsContext(): bool - { - return $this->options['needs_context']; - } - - public function getSafe(Node $functionArgs): ?array - { - if (null !== $this->options['is_safe']) { - return $this->options['is_safe']; - } - - if (null !== $this->options['is_safe_callback']) { - return $this->options['is_safe_callback']($functionArgs); - } - - return []; - } - - public function isVariadic(): bool - { - return (bool) $this->options['is_variadic']; - } - - public function isDeprecated(): bool - { - return (bool) $this->options['deprecated']; - } - - public function getDeprecatedVersion(): string - { - return \is_bool($this->options['deprecated']) ? '' : $this->options['deprecated']; - } - - public function getAlternative(): ?string - { - return $this->options['alternative']; - } -} diff --git a/system/vendor/twig/twig/src/TwigTest.php b/system/vendor/twig/twig/src/TwigTest.php deleted file mode 100644 index 3769ec1..0000000 --- a/system/vendor/twig/twig/src/TwigTest.php +++ /dev/null @@ -1,100 +0,0 @@ - - * - * @see https://twig.symfony.com/doc/templates.html#test-operator - */ -final class TwigTest -{ - private $name; - private $callable; - private $options; - private $arguments = []; - - /** - * @param callable|array{class-string, string}|null $callable A callable implementing the test. If null, you need to overwrite the "node_class" option to customize compilation. - */ - public function __construct(string $name, $callable = null, array $options = []) - { - $this->name = $name; - $this->callable = $callable; - $this->options = array_merge([ - 'is_variadic' => false, - 'node_class' => TestExpression::class, - 'deprecated' => false, - 'alternative' => null, - 'one_mandatory_argument' => false, - ], $options); - } - - public function getName(): string - { - return $this->name; - } - - /** - * Returns the callable to execute for this test. - * - * @return callable|array{class-string, string}|null - */ - public function getCallable() - { - return $this->callable; - } - - public function getNodeClass(): string - { - return $this->options['node_class']; - } - - public function setArguments(array $arguments): void - { - $this->arguments = $arguments; - } - - public function getArguments(): array - { - return $this->arguments; - } - - public function isVariadic(): bool - { - return (bool) $this->options['is_variadic']; - } - - public function isDeprecated(): bool - { - return (bool) $this->options['deprecated']; - } - - public function getDeprecatedVersion(): string - { - return \is_bool($this->options['deprecated']) ? '' : $this->options['deprecated']; - } - - public function getAlternative(): ?string - { - return $this->options['alternative']; - } - - public function hasOneMandatoryArgument(): bool - { - return (bool) $this->options['one_mandatory_argument']; - } -} diff --git a/system/vendor/twig/twig/src/Util/DeprecationCollector.php b/system/vendor/twig/twig/src/Util/DeprecationCollector.php deleted file mode 100644 index 378b666..0000000 --- a/system/vendor/twig/twig/src/Util/DeprecationCollector.php +++ /dev/null @@ -1,77 +0,0 @@ - - */ -final class DeprecationCollector -{ - private $twig; - - public function __construct(Environment $twig) - { - $this->twig = $twig; - } - - /** - * Returns deprecations for templates contained in a directory. - * - * @param string $dir A directory where templates are stored - * @param string $ext Limit the loaded templates by extension - * - * @return array An array of deprecations - */ - public function collectDir(string $dir, string $ext = '.twig'): array - { - $iterator = new \RegexIterator( - new \RecursiveIteratorIterator( - new \RecursiveDirectoryIterator($dir), \RecursiveIteratorIterator::LEAVES_ONLY - ), '{'.preg_quote($ext).'$}' - ); - - return $this->collect(new TemplateDirIterator($iterator)); - } - - /** - * Returns deprecations for passed templates. - * - * @param \Traversable $iterator An iterator of templates (where keys are template names and values the contents of the template) - * - * @return array An array of deprecations - */ - public function collect(\Traversable $iterator): array - { - $deprecations = []; - set_error_handler(function ($type, $msg) use (&$deprecations) { - if (\E_USER_DEPRECATED === $type) { - $deprecations[] = $msg; - } - }); - - foreach ($iterator as $name => $contents) { - try { - $this->twig->parse($this->twig->tokenize(new Source($contents, $name))); - } catch (SyntaxError $e) { - // ignore templates containing syntax errors - } - } - - restore_error_handler(); - - return $deprecations; - } -} diff --git a/system/vendor/twig/twig/src/Util/TemplateDirIterator.php b/system/vendor/twig/twig/src/Util/TemplateDirIterator.php deleted file mode 100644 index 3bef14b..0000000 --- a/system/vendor/twig/twig/src/Util/TemplateDirIterator.php +++ /dev/null @@ -1,36 +0,0 @@ - - */ -class TemplateDirIterator extends \IteratorIterator -{ - /** - * @return mixed - */ - #[\ReturnTypeWillChange] - public function current() - { - return file_get_contents(parent::current()); - } - - /** - * @return mixed - */ - #[\ReturnTypeWillChange] - public function key() - { - return (string) parent::key(); - } -} diff --git a/system/vendor/vlucas/valitron b/system/vendor/vlucas/valitron deleted file mode 160000 index fadce39..0000000 --- a/system/vendor/vlucas/valitron +++ /dev/null @@ -1 +0,0 @@ -Subproject commit fadce39f5f235755bb9794b2573af2d5bfcba85f