diff --git a/.gitignore b/.gitignore index 9fed8a4..11fd061 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,32 @@ tmp logs .idea files -archive/* \ No newline at end of file +archive/* + +# Зависимости Composer без локальных изменений не храним в Git. +/vendor/* +!/vendor/browser_detection/ +!/vendor/dbf/ +!/vendor/sms/ +!/vendor/cakephp/ +/vendor/cakephp/* +!/vendor/cakephp/cakephp/ +!/vendor/composer/ +/vendor/composer/* +!/vendor/composer/composer/ +!/vendor/dompdf/ +/vendor/dompdf/* +!/vendor/dompdf/dompdf/ +!/vendor/m1/ +/vendor/m1/* +!/vendor/m1/env/ +!/vendor/parsecsv/ +/vendor/parsecsv/* +!/vendor/parsecsv/php-parsecsv/ +!/vendor/squizlabs/ +/vendor/squizlabs/* +!/vendor/squizlabs/php_codesniffer/ +!/vendor/symfony/ +/vendor/symfony/* +!/vendor/symfony/debug/ +!/vendor/empty diff --git a/README.md b/README.md new file mode 100644 index 0000000..40040e7 --- /dev/null +++ b/README.md @@ -0,0 +1,16 @@ +# Зависимости приложения + +Версии зависимостей зафиксированы в `composer.lock`. Пакеты, совпавшие с +официальными архивами этих версий, и создаваемые Composer служебные файлы +исключены из Git. + +В `vendor` сохранены ручные DBF/SMS/BrowserDetection-библиотеки, пакеты с +локальными отличиями и пакеты без подтверждённого эталона. В том числе +сохраняются правки CakePHP и дополнительные шрифты Dompdf. Состав каталогов +задан исключениями в `.gitignore`. + +Перед восстановлением зависимостей нужно сохранить отслеживаемую часть +`vendor` в отдельную копию. После восстановления пакетов по `composer.lock` +в изолированном окружении сохранённые файлы возвращаются поверх пакетов. +Это сохраняет существующие правки и шрифты; слепая переустановка может их +перезаписать. Восстановление и проверка работы приложения выполняются отдельно. diff --git a/vendor/ajgl/breakpoint-twig-extension/.gitignore b/vendor/ajgl/breakpoint-twig-extension/.gitignore deleted file mode 100644 index 25be7c4..0000000 --- a/vendor/ajgl/breakpoint-twig-extension/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -/vendor/ -*.cache -composer.lock -phpunit.xml diff --git a/vendor/ajgl/breakpoint-twig-extension/.php_cs b/vendor/ajgl/breakpoint-twig-extension/.php_cs deleted file mode 100644 index 6587885..0000000 --- a/vendor/ajgl/breakpoint-twig-extension/.php_cs +++ /dev/null @@ -1,36 +0,0 @@ - - -For the full copyright and license information, please view the LICENSE -file that was distributed with this source code. -EOF; - -return \PhpCsFixer\Config::create() - ->setRiskyAllowed(true) - ->setRules( - [ - '@Symfony' => true, - '@Symfony:risky' => true, - 'array_syntax' => array('syntax' => 'short'), - 'fully_qualified_strict_types' => true, - 'header_comment' => array('header' => $header), - 'native_function_invocation' => false, - 'ordered_imports' => [ - 'imports_order' => ['class', 'const', 'function'], - ], - 'phpdoc_order' => true, - 'psr4' => true, - 'strict_comparison' => true, - 'strict_param' => true, - ] - ) - ->setFinder( - \PhpCsFixer\Finder::create() - ->in(__DIR__.'/src') - ->in(__DIR__.'/tests') - ) -; diff --git a/vendor/ajgl/breakpoint-twig-extension/.scrutinizer.yml b/vendor/ajgl/breakpoint-twig-extension/.scrutinizer.yml deleted file mode 100644 index 8b19e9e..0000000 --- a/vendor/ajgl/breakpoint-twig-extension/.scrutinizer.yml +++ /dev/null @@ -1,7 +0,0 @@ -# .scrutinizer.yml -checks: - php: true - -tools: - external_code_coverage: - timeout: 900 diff --git a/vendor/ajgl/breakpoint-twig-extension/.travis.yml b/vendor/ajgl/breakpoint-twig-extension/.travis.yml deleted file mode 100644 index bbcf510..0000000 --- a/vendor/ajgl/breakpoint-twig-extension/.travis.yml +++ /dev/null @@ -1,68 +0,0 @@ -language: php -sudo: false -cache: - directories: - - $HOME/.composer/cache/files - - $HOME/symfony-bridge/.phpunit - -env: - global: - - PHPUNIT_FLAGS="-v" - - SYMFONY_PHPUNIT_DIR="$HOME/symfony-bridge/.phpunit" - -matrix: - fast_finish: true - include: - # Minimum supported dependencies with the latest and oldest PHP version - - php: 7.3 - env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" SYMFONY_DEPRECATIONS_HELPER="weak_vendors" - - php: 5.6 - env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" SYMFONY_DEPRECATIONS_HELPER="weak_vendors" - - # Test the latest stable release - - php: 5.6 - - php: 7.0 - - php: 7.1 - - php: 7.2 - - php: 7.3 - env: COVERAGE=true PHPUNIT_FLAGS="-v --coverage-text" LINT=true - - # Test LTS versions. This makes sure we do not use Symfony packages with version greater - # than 2 or 3 respectively. Read more at https://github.com/symfony/lts - - php: 7.3 - env: DEPENDENCIES="symfony/lts:^2" - - php: 7.3 - env: DEPENDENCIES="symfony/lts:^3" - - # Latest commit to master - - php: 7.3 - env: STABILITY="dev" - - php: 7.4 - env: STABILITY="dev" - - php: nightly - env: STABILITY="dev" - - allow_failures: - # Dev-master is allowed to fail. - - env: STABILITY="dev" - -before_install: - - if [[ $COVERAGE != true ]]; then phpenv config-rm xdebug.ini || true; fi - - if ! [ -z "$STABILITY" ]; then composer config minimum-stability ${STABILITY}; fi; - - if ! [ -v "$DEPENDENCIES" ]; then composer require --no-update ${DEPENDENCIES}; fi; - - if [[ $LINT = true ]]; then wget https://cs.symfony.com/download/php-cs-fixer-v2.phar; fi - -install: - - composer update ${COMPOSER_FLAGS} --prefer-dist --no-interaction - - ./vendor/bin/simple-phpunit install - -script: - - composer validate --strict --no-check-lock - - if [[ $LINT = true ]]; then php php-cs-fixer-v2.phar fix --dry-run --diff --no-ansi; fi - # simple-phpunit is the PHPUnit wrapper provided by the PHPUnit Bridge component and - # it helps with testing legacy code and deprecations (composer require symfony/phpunit-bridge) - - ./vendor/bin/simple-phpunit $PHPUNIT_FLAGS - -after_script: - - wget https://scrutinizer-ci.com/ocular.phar - - php ocular.phar code-coverage:upload --format=php-clover coverage.clover diff --git a/vendor/ajgl/breakpoint-twig-extension/CHANGELOG.md b/vendor/ajgl/breakpoint-twig-extension/CHANGELOG.md deleted file mode 100644 index 17d5dec..0000000 --- a/vendor/ajgl/breakpoint-twig-extension/CHANGELOG.md +++ /dev/null @@ -1,60 +0,0 @@ -# [CHANGELOG](http://keepachangelog.com/) -All notable changes to this project will be documented in this file. -This project adheres to [Semantic Versioning](http://semver.org/). - -## [Unreleased][unreleased] - - -## [0.3.4] - 2019-04-10 - -### Fixed -- Population of `$arguments` variable - - -## [0.3.3] - 2019-03-18 - -### Fixed -- Population of `$arguments` variable -- Usage of deprecated classes - - -## [0.3.2] - 2018-12-10 - -### Added -- Add support for Symfony 4 - -## [0.3.1] - 2017-11-20 - -### Changed -- Require PHP 5.6 - -### Fixed -- Update requirements to allow twig 2.x - - -## [0.3.0] - 2016-03-31 - -### Added -- Add `$environment` and `$context` variables -- Allow to inspect function arguments - - -## [0.2.0] - 2016-03-10 - -### Added -- Add Symfony Bundle - - -## 0.1.0 - 2016-03-09 - -### Added -- Add `breakpoint` function - - -[unreleased]: https://github.com/ajgarlag/AjglBreakpointTwigExtension/compare/0.3.4...master -[0.3.4]: https://github.com/ajgarlag/AjglBreakpointTwigExtension/compare/0.3.3...0.3.4 -[0.3.3]: https://github.com/ajgarlag/AjglBreakpointTwigExtension/compare/0.3.2...0.3.3 -[0.3.2]: https://github.com/ajgarlag/AjglBreakpointTwigExtension/compare/0.3.1...0.3.2 -[0.3.1]: https://github.com/ajgarlag/AjglBreakpointTwigExtension/compare/0.3.0...0.3.1 -[0.3.0]: https://github.com/ajgarlag/AjglBreakpointTwigExtension/compare/0.2.0...0.3.0 -[0.2.0]: https://github.com/ajgarlag/AjglBreakpointTwigExtension/compare/0.1.0...0.2.0 diff --git a/vendor/ajgl/breakpoint-twig-extension/LICENSE b/vendor/ajgl/breakpoint-twig-extension/LICENSE deleted file mode 100644 index 9aeafa2..0000000 --- a/vendor/ajgl/breakpoint-twig-extension/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -Copyright (c) 2013-2016 Antonio J. García Lagar - -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/vendor/ajgl/breakpoint-twig-extension/README.md b/vendor/ajgl/breakpoint-twig-extension/README.md deleted file mode 100644 index 5844613..0000000 --- a/vendor/ajgl/breakpoint-twig-extension/README.md +++ /dev/null @@ -1,124 +0,0 @@ -AjglBreakpointTwigExtension -=========================== - -The AjglBreakpointTwigExtension component allows you set breakpoints in twig templates. - -[![Build Status](https://travis-ci.org/ajgarlag/AjglBreakpointTwigExtension.png?branch=master)](https://travis-ci.org/ajgarlag/AjglBreakpointTwigExtension) -[![Latest Stable Version](https://poser.pugx.org/ajgl/breakpoint-twig-extension/v/stable.png)](https://packagist.org/packages/ajgl/breakpoint-twig-extension) -[![Latest Unstable Version](https://poser.pugx.org/ajgl/breakpoint-twig-extension/v/unstable.png)](https://packagist.org/packages/ajgl/breakpoint-twig-extension) -[![Total Downloads](https://poser.pugx.org/ajgl/breakpoint-twig-extension/downloads.png)](https://packagist.org/packages/ajgl/breakpoint-twig-extension) -[![Montly Downloads](https://poser.pugx.org/ajgl/breakpoint-twig-extension/d/monthly.png)](https://packagist.org/packages/ajgl/breakpoint-twig-extension) -[![Daily Downloads](https://poser.pugx.org/ajgl/breakpoint-twig-extension/d/daily.png)](https://packagist.org/packages/ajgl/breakpoint-twig-extension) -[![License](https://poser.pugx.org/ajgl/breakpoint-twig-extension/license.png)](https://packagist.org/packages/ajgl/breakpoint-twig-extension) -[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/ajgarlag/AjglBreakpointTwigExtension/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/ajgarlag/AjglBreakpointTwigExtension/?branch=master) -[![Code Coverage](https://scrutinizer-ci.com/g/ajgarlag/AjglBreakpointTwigExtension/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/ajgarlag/AjglBreakpointTwigExtension/?branch=master) -[![SensioLabsInsight](https://insight.sensiolabs.com/projects/e0f1276d-6ded-4a20-9b3f-1a7c77a92015/mini.png)](https://insight.sensiolabs.com/projects/e0f1276d-6ded-4a20-9b3f-1a7c77a92015) - -This component requires the [Xdebug] PHP extension to be installed. - - -Installation ------------- - -To install the latest stable version of this component, open a console and execute the following command: -``` -$ composer require ajgl/breakpoint-twig-extension -``` - - -Usage ------ - -The first step is to register the extension into the twig environment -```php -/* @var $twig Twig_Environment */ -$twig->addExtension(new Ajgl\Twig\Extension\BreakpointExtension()); -``` - -Once registered, you can call the new `breakpoint` function: -```twig - - - - - title - - - {{ breakpoint() }} - - -``` - -Once stopped, your debugger will allow you to inspect the `$environment` and `$context` variables. - -### Function arguments - -Any argument passed to the twig function will be added to the `$arguments` array, so you can inspect it easily. - -```twig - - - - - title - - - {{ breakpoint(app.user, app.session) }} - - -``` - -Symfony Bundle --------------- - -If you want to use this extension in your Symfony application, you can enable the -Symfony Bundle included in this package. - -The bundle will register the twig extension automatically. So, once enabled, you -can insert the `breakpoint` twig function in your templates. - -### Symfony 2/3 - -```php -// app/AppKernel.php -if (in_array($this->getEnvironment(), array('dev', 'test'), true)) { - $bundles[] = new Ajgl\Twig\Extension\SymfonyBundle\AjglBreakpointTwigExtensionBundle(); -} -``` - -### Symfony 4 - -```php -// config/bundles.php -//... -return [ - //... - Ajgl\Twig\Extension\SymfonyBundle\AjglBreakpointTwigExtensionBundle::class => ['dev' => true] -]; -``` - -License -------- - -This component is under the MIT license. See the complete license in the [LICENSE] file. - - -Reporting an issue or a feature request ---------------------------------------- - -Issues and feature requests are tracked in the [Github issue tracker]. - - -Author Information ------------------- - -Developed with ♥ by [Antonio J. García Lagar]. - -If you find this component useful, please add a ★ in the [GitHub repository page] and/or the [Packagist package page]. - -[Xdebug]: https://xdebug.org/ -[LICENSE]: LICENSE -[Github issue tracker]: https://github.com/ajgarlag/AjglBreakpointTwigExtension/issues -[Antonio J. García Lagar]: http://aj.garcialagar.es -[GitHub repository page]: https://github.com/ajgarlag/AjglBreakpointTwigExtension -[Packagist package page]: https://packagist.org/packages/ajgl/breakpoint-twig-extension diff --git a/vendor/ajgl/breakpoint-twig-extension/composer.json b/vendor/ajgl/breakpoint-twig-extension/composer.json deleted file mode 100644 index f05e3e0..0000000 --- a/vendor/ajgl/breakpoint-twig-extension/composer.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "name": "ajgl/breakpoint-twig-extension", - "description": "Twig extension to set breakpoints", - "keywords": ["twig", "xdebug", "breakpoint"], - "homepage": "https://github.com/ajgarlag/AjglBreakpointTwigExtension", - "license": "MIT", - "authors": [ - { - "name": "Antonio J. García Lagar", - "email": "aj@garcialagar.es", - "homepage": "http://aj.garcialagar.es", - "role": "developer" - } - ], - "autoload": { - "psr-4": { "Ajgl\\Twig\\Extension\\": "src/" } - }, - "autoload-dev": { - "psr-4": { "Ajgl\\Twig\\Extension\\Tests\\": "tests/" } - }, - "require": { - "php": ">=5.6", - "twig/twig": "^1.14|^2.0" - }, - "require-dev": { - "symfony/framework-bundle": "^2.7|^3.2|^4.1", - "symfony/twig-bundle": "^2.7|^3.2|^4.1", - "symfony/phpunit-bridge": "^3.4|^4.1" - }, - "suggest": { - "ext-xdebug": "The Xdebug extension is required for the breakpoint to work", - "symfony/framework-bundle": "The framework bundle to integrate the extension into Symfony", - "symfony/twig-bundle": "The twig bundle to integrate the extension into Symfony" - }, - "scripts": { - "phpunit": "vendor/bin/simple-phpunit --colors=always", - "test": [ - "@phpunit" - ] - }, - "extra": { - "branch-alias": { - "dev-master": "0.3.x-dev" - } - } -} diff --git a/vendor/ajgl/breakpoint-twig-extension/phpunit.xml.dist b/vendor/ajgl/breakpoint-twig-extension/phpunit.xml.dist deleted file mode 100644 index ec8dc6e..0000000 --- a/vendor/ajgl/breakpoint-twig-extension/phpunit.xml.dist +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - ./tests - - - - - - ./src - - - - diff --git a/vendor/ajgl/breakpoint-twig-extension/src/BreakpointExtension.php b/vendor/ajgl/breakpoint-twig-extension/src/BreakpointExtension.php deleted file mode 100644 index f839d68..0000000 --- a/vendor/ajgl/breakpoint-twig-extension/src/BreakpointExtension.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 Ajgl\Twig\Extension; - -use Twig\Environment; -use Twig\Extension\AbstractExtension; -use Twig\TwigFunction; - -/** - * @author Antonio J. García Lagar - */ -class BreakpointExtension extends AbstractExtension -{ - public function getName() - { - return 'breakpoint'; - } - - public function getFunctions() - { - return [ - new TwigFunction('breakpoint', [$this, 'setBreakpoint'], ['needs_environment' => true, 'needs_context' => true]), - ]; - } - - /** - * If Xdebug is detected, makes the debugger break. - * - * @param Environment $environment the environment instance - * @param mixed $context variables from the Twig template - */ - public function setBreakpoint(Environment $environment, $context) - { - if (function_exists('xdebug_break')) { - $arguments = func_get_args(); - $arguments = array_slice($arguments, 2); - xdebug_break(); - } - } -} diff --git a/vendor/ajgl/breakpoint-twig-extension/src/SymfonyBundle/AjglBreakpointTwigExtensionBundle.php b/vendor/ajgl/breakpoint-twig-extension/src/SymfonyBundle/AjglBreakpointTwigExtensionBundle.php deleted file mode 100644 index 2caa7ca..0000000 --- a/vendor/ajgl/breakpoint-twig-extension/src/SymfonyBundle/AjglBreakpointTwigExtensionBundle.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 Ajgl\Twig\Extension\SymfonyBundle; - -use Symfony\Component\HttpKernel\Bundle\Bundle; - -/** - * @author Antonio J. García Lagar - */ -class AjglBreakpointTwigExtensionBundle extends Bundle -{ -} diff --git a/vendor/ajgl/breakpoint-twig-extension/src/SymfonyBundle/DependencyInjection/AjglBreakpointTwigExtensionExtension.php b/vendor/ajgl/breakpoint-twig-extension/src/SymfonyBundle/DependencyInjection/AjglBreakpointTwigExtensionExtension.php deleted file mode 100644 index cf25daa..0000000 --- a/vendor/ajgl/breakpoint-twig-extension/src/SymfonyBundle/DependencyInjection/AjglBreakpointTwigExtensionExtension.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 Ajgl\Twig\Extension\SymfonyBundle\DependencyInjection; - -use Symfony\Component\Config\FileLocator; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Loader; -use Symfony\Component\HttpKernel\DependencyInjection\Extension; - -/** - * @author Antonio J. García Lagar - */ -class AjglBreakpointTwigExtensionExtension extends Extension -{ - public function load(array $config, ContainerBuilder $container) - { - $loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); - $loader->load('twig.xml'); - } -} diff --git a/vendor/ajgl/breakpoint-twig-extension/src/SymfonyBundle/Resources/config/twig.xml b/vendor/ajgl/breakpoint-twig-extension/src/SymfonyBundle/Resources/config/twig.xml deleted file mode 100644 index e7bd832..0000000 --- a/vendor/ajgl/breakpoint-twig-extension/src/SymfonyBundle/Resources/config/twig.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - diff --git a/vendor/ajgl/breakpoint-twig-extension/tests/BreakpointExtensionTest.php b/vendor/ajgl/breakpoint-twig-extension/tests/BreakpointExtensionTest.php deleted file mode 100644 index 3f88bdf..0000000 --- a/vendor/ajgl/breakpoint-twig-extension/tests/BreakpointExtensionTest.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 Ajgl\Twig\Extension\Tests; - -use Ajgl\Twig\Extension\BreakpointExtension; -use PHPUnit\Framework\TestCase; - -/** - * @author Antonio J. García Lagar - */ -class BreakpointExtensionTest extends TestCase -{ - /** - * @var BreakpointExtension - */ - protected $extension; - - protected function setUp() - { - $this->extension = new BreakpointExtension(); - } - - public function testGetName() - { - $this->assertSame('breakpoint', $this->extension->getName()); - } - - public function testGetFunctions() - { - $functions = $this->extension->getFunctions(); - $this->assertCount(1, $functions); - $function = reset($functions); - $this->assertInstanceOf('Twig_SimpleFunction', $function); - $callable = $function->getCallable(); - $this->assertTrue(is_array($callable)); - $this->assertCount(2, $callable); - $this->assertSame($this->extension, $callable[0]); - $this->assertSame('setBreakpoint', $callable[1]); - } -} diff --git a/vendor/ajgl/breakpoint-twig-extension/tests/SymfonyBundle/DependencyInjection/AjglBreakpointTwigExtensionExtensionTest.php b/vendor/ajgl/breakpoint-twig-extension/tests/SymfonyBundle/DependencyInjection/AjglBreakpointTwigExtensionExtensionTest.php deleted file mode 100644 index 7c51e6f..0000000 --- a/vendor/ajgl/breakpoint-twig-extension/tests/SymfonyBundle/DependencyInjection/AjglBreakpointTwigExtensionExtensionTest.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 Ajgl\Twig\Extension\Tests\SymfonyBundle\DependencyInjection; - -use Ajgl\Twig\Extension\SymfonyBundle\DependencyInjection\AjglBreakpointTwigExtensionExtension; -use PHPUnit\Framework\TestCase; -use Symfony\Component\DependencyInjection\ContainerBuilder; - -/** - * @author Antonio J. García Lagar - */ -class AjglBreakpointTwigExtensionExtensionTest extends TestCase -{ - /** - * @var ContainerBuilder - */ - protected $container; - - /** - * @var AjglBreakpointTwigExtensionExtension - */ - protected $extension; - - protected function setUp() - { - $this->container = new ContainerBuilder(); - $this->extension = new AjglBreakpointTwigExtensionExtension(); - } - - public function testTwigExtensionsDefinition() - { - $this->extension->load([], $this->container); - $this->assertTrue($this->container->hasDefinition('ajgl_twig_extension.breakpoint')); - $definition = $this->container->getDefinition('ajgl_twig_extension.breakpoint'); - $this->assertSame( - 'Ajgl\Twig\Extension\BreakpointExtension', - $definition->getClass() - ); - $this->assertNotNull($definition->getTag('twig.extension')); - } -} diff --git a/vendor/aptoma/twig-markdown/.travis.yml b/vendor/aptoma/twig-markdown/.travis.yml deleted file mode 100644 index 62d7420..0000000 --- a/vendor/aptoma/twig-markdown/.travis.yml +++ /dev/null @@ -1,27 +0,0 @@ -language: php -sudo: false - -php: - - 5.4 - - 5.5 - - 5.6 - - 7 - -env: - global: - # travis encrypt CODECLIMATE_REPO_TOKEN= - - secure: "n4I9GwRCxi9UGjhDGe79SV6Nr/fRKpA8N+qqqbkveJv01Z4IRcAsRBRxKrSAX8zJUoFhlJK73VeRnBfdSBddsL3RqgDMbHilZFy6yC7Dj/vVyNe90RPWxc5J7w3sidT2g1OsgWueiUis8y3dGOQd2sewfcb2pZa29/eQusBV5i0=" - -install: - - composer install - -before_script: - - mkdir -p build/logs - -script: - - vendor/bin/phpunit --coverage-clover build/logs/clover.xml - -after_script: - - php vendor/bin/coveralls -v - - ./vendor/bin/test-reporter --stdout > codeclimate.json - - "curl -X POST -d @codeclimate.json -H 'Content-Type: application/json' -H 'User-Agent: Code Climate (PHP Test Reporter v1.0.1-dev)' https://codeclimate.com/test_reports" diff --git a/vendor/aptoma/twig-markdown/CHANGELOG.md b/vendor/aptoma/twig-markdown/CHANGELOG.md deleted file mode 100644 index 09db06d..0000000 --- a/vendor/aptoma/twig-markdown/CHANGELOG.md +++ /dev/null @@ -1,23 +0,0 @@ -CHANGELOG -========= - -2.0.0 ------ - -- **BC**: Require Twig v1.12, in order to replace deprecated Twig_Filter_Method with Twig_SimpleFilter -- **Added**: Add support for ParsedownEnging - -1.2.0 ------ - -- **Added**: Add support for GitHub's markdown engine - -1.1.0 ------ - -- **Added**: Add support for PHP League CommonMark engine - -1.0.0 ------ - -- **BC**: Remove deprecated dflydev-markdown parser diff --git a/vendor/aptoma/twig-markdown/README.md b/vendor/aptoma/twig-markdown/README.md deleted file mode 100644 index b6807ef..0000000 --- a/vendor/aptoma/twig-markdown/README.md +++ /dev/null @@ -1,171 +0,0 @@ -Twig Markdown Extension -======================= - -[![Build Status](https://secure.travis-ci.org/aptoma/twig-markdown.png?branch=master)](http://travis-ci.org/aptoma/twig-markdown) -[![Coverage Status](https://img.shields.io/coveralls/aptoma/twig-markdown.svg)](https://coveralls.io/r/aptoma/twig-markdown) - -Twig Markdown extension provides a new filter and a tag to allow parsing of -content as Markdown in [Twig][1] templates. - -This extension could be integrated with several Markdown parser as it provides an interface, which allows you to customize your Markdown parser. - -### Supported parsers - - * [michelf/php-markdown](https://github.com/michelf/php-markdown) (+ MarkdownExtra) - * [league/commonmark](http://commonmark.thephpleague.com/) - * [KnpLabs/php-github-api](https://github.com/KnpLabs/php-github-api) - * [erusev/parsedown](https://github.com/erusev/parsedown) - -## Features - - * Filter support `{{ "# Heading Level 1"|markdown }}` - * Tag support `{% markdown %}{% endmarkdown %}` - -When used as a tag, the indentation level of the first line sets the default indentation level for the rest of the tag content. -From this indentation level, all same indentation or outdented levels text will be transformed as regular text. - -This feature allows you to write your Markdown content at any indentation level without caring of Markdown internal transformation: - -```php -
-

{{ title }}

- - {% markdown %} - This is a list that is indented to match the context around the markdown tag: - - * List item 1 - * List item 2 - * Sub List Item - * Sub Sub List Item - - The following block will be transformed as code, as it is indented more than the - surrounding content: - - $code = "good"; - - {% endmarkdown %} - -
-``` - -## Installation - -Run the composer command to install the latest stable version: - -```bash -composer require aptoma/twig-markdown -``` - -Or update your `composer.json`: - -```json -{ - "require": { - "aptoma/twig-markdown": "~1.1" - } -} -``` - -You can choose to provide your own Markdown engine, although we recommend -using [michelf/php-markdown](https://github.com/michelf/php-markdown): - -```bash -composer require michelf/php-markdown ~1.3 -``` - -```json -{ - "require": { - "michelf/php-markdown": "~1.3" - } -} -``` - -You may also use the [PHP League CommonMark engine](http://commonmark.thephpleague.com/): - -```bash -composer require league/commonmark ~0.5 -``` - -```json -{ - "require": { - "league/commonmark": "~0.5" - } -} -``` - -## Usage - -### Twig Extension - -The Twig extension provides the `markdown` tag and filter support. - -Assuming that you are using [composer](http://getcomposer.org) autoloading, -add the extension to the Twig environment: - -```php - -use Aptoma\Twig\Extension\MarkdownExtension; -use Aptoma\Twig\Extension\MarkdownEngine; - -$engine = new MarkdownEngine\MichelfMarkdownEngine(); - -$twig->addExtension(new MarkdownExtension($engine)); -``` - -### Twig Token Parser - -The Twig token parser provides the `markdown` tag only! - -```php -use Aptoma\Twig\Extension\MarkdownEngine; -use Aptoma\Twig\TokenParser\MarkdownTokenParser; - -$engine = new MarkdownEngine\MichelfMarkdownEngine(); - -$twig->addTokenParser(new MarkdownTokenParser($engine)); -``` - -### GitHub Markdown Engine - -`MarkdownEngine\GitHubMarkdownEngine` provides an interface to GitHub's markdown engine using their public API via [`KnpLabs\php-github-api`][2]. To reduce API calls, rendered documents are hashed and cached in the filesystem. You can pass a GitHub repository and the path to be used for caching to the constructor: - -```php -use Aptoma\Twig\Extension\MarkdownEngine; - -$engine = new MarkdownEngine\GitHubMarkdownEngine( - 'aptoma/twig-markdown', // The GitHub repository to use as a context - true, // Whether to use GitHub's Flavored Markdown (GFM) - '/tmp/markdown-cache', // Path on filesystem to store rendered documents -); -``` - -In order to authenticate the API client (for instance), it's possible to pass an own instance of `\GitHub\Client` instead of letting the engine create one itself: - -```php -$client = new \GitHub\Client; -$client->authenticate('GITHUB_CLIENT_ID', 'GITHUB_CLIENT_SECRET', \Github\Client::AUTH_URL_CLIENT_ID); - -$engine = new MarkdownEngine\GitHubMarkdownEngine('aptoma/twig-markdown', true, '/tmp/markdown-cache', $client); -``` - -### Using a different Markdown parser engine - -If you want to use a different Markdown parser, you need to create an adapter -that implements `Aptoma\Twig\Extension\MarkdownEngineInterface.php`. Have -a look at `Aptoma\Twig\Extension\MarkdownEngine\MichelfMarkdownEngine` for an -example. - -## Tests - -The test suite uses PHPUnit: - - $ phpunit - -## License - -Twig Markdown Extension is licensed under the MIT license. - -[1]: http://twig.sensiolabs.org -[2]: https://github.com/knplabs/php-github-api diff --git a/vendor/aptoma/twig-markdown/composer.json b/vendor/aptoma/twig-markdown/composer.json deleted file mode 100644 index 491c1f0..0000000 --- a/vendor/aptoma/twig-markdown/composer.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "aptoma/twig-markdown", - "description": "Twig extension to work with Markdown content", - "keywords": ["twig", "markdown"], - "license": "MIT", - "authors": [ - { - "name": "Gunnar Lium", - "email": "gunnar@aptoma.com" - }, - { - "name": "Joris Berthelot", - "email": "joris@berthelot.tel" - } - ], - "require": { - "twig/twig": "~1.12" - }, - "require-dev": { - "phpunit/phpunit": "~4.0", - "satooshi/php-coveralls": "~0.6", - "codeclimate/php-test-reporter": "dev-master", - "michelf/php-markdown": "~1", - "league/commonmark": "~0.5", - "knplabs/github-api": "~1.2", - "erusev/parsedown": "^1.6" - }, - "suggest": { - "michelf/php-markdown": "Original Markdown engine with MarkdownExtra.", - "knplabs/github-api": "Needed for using GitHub's Markdown engine provided through their API." - }, - "autoload": { - "psr-0": { "Aptoma": "src/" } - } -} diff --git a/vendor/aptoma/twig-markdown/composer.lock b/vendor/aptoma/twig-markdown/composer.lock deleted file mode 100644 index dac9b0d..0000000 --- a/vendor/aptoma/twig-markdown/composer.lock +++ /dev/null @@ -1,1772 +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#composer-lock-the-lock-file", - "This file is @generated automatically" - ], - "hash": "cc0f13dd7a782442ae3b39805823a56b", - "packages": [ - { - "name": "twig/twig", - "version": "v1.22.3", - "source": { - "type": "git", - "url": "https://github.com/twigphp/Twig.git", - "reference": "ebfc36b7e77b0c1175afe30459cf943010245540" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/ebfc36b7e77b0c1175afe30459cf943010245540", - "reference": "ebfc36b7e77b0c1175afe30459cf943010245540", - "shasum": "" - }, - "require": { - "php": ">=5.2.7" - }, - "require-dev": { - "symfony/debug": "~2.7", - "symfony/phpunit-bridge": "~2.7" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.22-dev" - } - }, - "autoload": { - "psr-0": { - "Twig_": "lib/" - } - }, - "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": "Armin Ronacher", - "email": "armin.ronacher@active-4.com", - "role": "Project Founder" - }, - { - "name": "Twig Team", - "homepage": "http://twig.sensiolabs.org/contributors", - "role": "Contributors" - } - ], - "description": "Twig, the flexible, fast, and secure template language for PHP", - "homepage": "http://twig.sensiolabs.org", - "keywords": [ - "templating" - ], - "time": "2015-10-13 07:07:02" - } - ], - "packages-dev": [ - { - "name": "codeclimate/php-test-reporter", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/codeclimate/php-test-reporter.git", - "reference": "892163d67e3bd9c190d43655acb69657da765c7b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/codeclimate/php-test-reporter/zipball/892163d67e3bd9c190d43655acb69657da765c7b", - "reference": "892163d67e3bd9c190d43655acb69657da765c7b", - "shasum": "" - }, - "require": { - "ext-curl": "*", - "php": ">=5.3", - "satooshi/php-coveralls": "0.6.*", - "symfony/console": ">=2.0" - }, - "require-dev": { - "ext-xdebug": "*", - "phpunit/phpunit": "3.7.*@stable" - }, - "bin": [ - "composer/bin/test-reporter" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "0.2.x-dev" - } - }, - "autoload": { - "psr-0": { - "CodeClimate\\Component": "src/", - "CodeClimate\\Bundle": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Code Climate", - "email": "hello@codeclimate.com", - "homepage": "https://codeclimate.com" - } - ], - "description": "PHP client for reporting test coverage to Code Climate", - "homepage": "https://github.com/codeclimate/php-test-reporter", - "keywords": [ - "codeclimate", - "coverage" - ], - "time": "2015-10-15 14:41:10" - }, - { - "name": "doctrine/instantiator", - "version": "1.0.5", - "source": { - "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", - "shasum": "" - }, - "require": { - "php": ">=5.3,<8.0-DEV" - }, - "require-dev": { - "athletic/athletic": "~0.1.8", - "ext-pdo": "*", - "ext-phar": "*", - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "~2.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "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": "http://ocramius.github.com/" - } - ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://github.com/doctrine/instantiator", - "keywords": [ - "constructor", - "instantiate" - ], - "time": "2015-06-14 21:17:01" - }, - { - "name": "erusev/parsedown", - "version": "1.6.0", - "source": { - "type": "git", - "url": "https://github.com/erusev/parsedown.git", - "reference": "3ebbd730b5c2cf5ce78bc1bf64071407fc6674b7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/erusev/parsedown/zipball/3ebbd730b5c2cf5ce78bc1bf64071407fc6674b7", - "reference": "3ebbd730b5c2cf5ce78bc1bf64071407fc6674b7", - "shasum": "" - }, - "type": "library", - "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" - ], - "time": "2015-10-04 16:44:32" - }, - { - "name": "guzzle/guzzle", - "version": "v3.9.3", - "source": { - "type": "git", - "url": "https://github.com/guzzle/guzzle3.git", - "reference": "0645b70d953bc1c067bbc8d5bc53194706b628d9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle3/zipball/0645b70d953bc1c067bbc8d5bc53194706b628d9", - "reference": "0645b70d953bc1c067bbc8d5bc53194706b628d9", - "shasum": "" - }, - "require": { - "ext-curl": "*", - "php": ">=5.3.3", - "symfony/event-dispatcher": "~2.1" - }, - "replace": { - "guzzle/batch": "self.version", - "guzzle/cache": "self.version", - "guzzle/common": "self.version", - "guzzle/http": "self.version", - "guzzle/inflection": "self.version", - "guzzle/iterator": "self.version", - "guzzle/log": "self.version", - "guzzle/parser": "self.version", - "guzzle/plugin": "self.version", - "guzzle/plugin-async": "self.version", - "guzzle/plugin-backoff": "self.version", - "guzzle/plugin-cache": "self.version", - "guzzle/plugin-cookie": "self.version", - "guzzle/plugin-curlauth": "self.version", - "guzzle/plugin-error-response": "self.version", - "guzzle/plugin-history": "self.version", - "guzzle/plugin-log": "self.version", - "guzzle/plugin-md5": "self.version", - "guzzle/plugin-mock": "self.version", - "guzzle/plugin-oauth": "self.version", - "guzzle/service": "self.version", - "guzzle/stream": "self.version" - }, - "require-dev": { - "doctrine/cache": "~1.3", - "monolog/monolog": "~1.0", - "phpunit/phpunit": "3.7.*", - "psr/log": "~1.0", - "symfony/class-loader": "~2.1", - "zendframework/zend-cache": "2.*,<2.3", - "zendframework/zend-log": "2.*,<2.3" - }, - "suggest": { - "guzzlehttp/guzzle": "Guzzle 5 has moved to a new package name. The package you have installed, Guzzle 3, is deprecated." - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.9-dev" - } - }, - "autoload": { - "psr-0": { - "Guzzle": "src/", - "Guzzle\\Tests": "tests/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - }, - { - "name": "Guzzle Community", - "homepage": "https://github.com/guzzle/guzzle/contributors" - } - ], - "description": "PHP HTTP client. This library is deprecated in favor of https://packagist.org/packages/guzzlehttp/guzzle", - "homepage": "http://guzzlephp.org/", - "keywords": [ - "client", - "curl", - "framework", - "http", - "http client", - "rest", - "web service" - ], - "time": "2015-03-18 18:23:50" - }, - { - "name": "knplabs/github-api", - "version": "1.5.1", - "source": { - "type": "git", - "url": "https://github.com/KnpLabs/php-github-api.git", - "reference": "832b7be695ed2733741cd5c79166b4a88fb50786" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/KnpLabs/php-github-api/zipball/832b7be695ed2733741cd5c79166b4a88fb50786", - "reference": "832b7be695ed2733741cd5c79166b4a88fb50786", - "shasum": "" - }, - "require": { - "ext-curl": "*", - "guzzle/guzzle": "~3.7", - "php": ">=5.3.2" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "suggest": { - "knplabs/gaufrette": "Needed for optional Gaufrette cache" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4.x-dev" - } - }, - "autoload": { - "psr-4": { - "Github\\": "lib/Github/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Thibault Duplessis", - "email": "thibault.duplessis@gmail.com", - "homepage": "http://ornicar.github.com" - }, - { - "name": "KnpLabs Team", - "homepage": "http://knplabs.com" - } - ], - "description": "GitHub API v3 client", - "homepage": "https://github.com/KnpLabs/php-github-api", - "keywords": [ - "api", - "gh", - "gist", - "github" - ], - "time": "2015-10-11 02:38:28" - }, - { - "name": "league/commonmark", - "version": "0.11.3", - "source": { - "type": "git", - "url": "https://github.com/thephpleague/commonmark.git", - "reference": "d22d6a6a4b049faccc2f8e491cce6076eeb165c7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/d22d6a6a4b049faccc2f8e491cce6076eeb165c7", - "reference": "d22d6a6a4b049faccc2f8e491cce6076eeb165c7", - "shasum": "" - }, - "require": { - "ext-mbstring": "*", - "php": ">=5.4.8" - }, - "replace": { - "colinodell/commonmark-php": "*" - }, - "require-dev": { - "erusev/parsedown": "~1.0", - "jgm/commonmark": "0.22", - "jgm/smartpunct": "0.22", - "michelf/php-markdown": "~1.4", - "mikehaertl/php-shellcommand": "~1.1.0", - "phpunit/phpunit": "~4.3", - "phpunit/phpunit-mock-objects": "2.3.0", - "symfony/finder": "~2.3" - }, - "bin": [ - "bin/commonmark" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "0.12-dev" - } - }, - "autoload": { - "psr-4": { - "League\\CommonMark\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Colin O'Dell", - "email": "colinodell@gmail.com", - "homepage": "http://www.colinodell.com", - "role": "Lead Developer" - } - ], - "description": "Markdown parser for PHP based on the CommonMark spec", - "homepage": "https://github.com/thephpleague/commonmark", - "keywords": [ - "commonmark", - "markdown", - "parser" - ], - "time": "2015-09-25 12:40:32" - }, - { - "name": "michelf/php-markdown", - "version": "1.5.0", - "source": { - "type": "git", - "url": "https://github.com/michelf/php-markdown.git", - "reference": "e1aabe18173231ebcefc90e615565742fc1c7fd9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/michelf/php-markdown/zipball/e1aabe18173231ebcefc90e615565742fc1c7fd9", - "reference": "e1aabe18173231ebcefc90e615565742fc1c7fd9", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-lib": "1.4.x-dev" - } - }, - "autoload": { - "psr-0": { - "Michelf": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "John Gruber", - "homepage": "http://daringfireball.net/" - }, - { - "name": "Michel Fortin", - "email": "michel.fortin@michelf.ca", - "homepage": "https://michelf.ca/", - "role": "Developer" - } - ], - "description": "PHP Markdown", - "homepage": "https://michelf.ca/projects/php-markdown/", - "keywords": [ - "markdown" - ], - "time": "2015-03-01 12:03:08" - }, - { - "name": "phpdocumentor/reflection-docblock", - "version": "2.0.4", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/d68dbdc53dc358a816f00b300704702b2eaff7b8", - "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "suggest": { - "dflydev/markdown": "~1.0", - "erusev/parsedown": "~1.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "psr-0": { - "phpDocumentor": [ - "src/" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "mike.vanriel@naenius.com" - } - ], - "time": "2015-02-03 12:10:50" - }, - { - "name": "phpspec/prophecy", - "version": "v1.5.0", - "source": { - "type": "git", - "url": "https://github.com/phpspec/prophecy.git", - "reference": "4745ded9307786b730d7a60df5cb5a6c43cf95f7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/4745ded9307786b730d7a60df5cb5a6c43cf95f7", - "reference": "4745ded9307786b730d7a60df5cb5a6c43cf95f7", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.0.2", - "phpdocumentor/reflection-docblock": "~2.0", - "sebastian/comparator": "~1.1" - }, - "require-dev": { - "phpspec/phpspec": "~2.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4.x-dev" - } - }, - "autoload": { - "psr-0": { - "Prophecy\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - }, - { - "name": "Marcello Duarte", - "email": "marcello.duarte@gmail.com" - } - ], - "description": "Highly opinionated mocking framework for PHP 5.3+", - "homepage": "https://github.com/phpspec/prophecy", - "keywords": [ - "Double", - "Dummy", - "fake", - "mock", - "spy", - "stub" - ], - "time": "2015-08-13 10:07:40" - }, - { - "name": "phpunit/php-code-coverage", - "version": "2.2.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/eabf68b476ac7d0f73793aada060f1c1a9bf8979", - "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "phpunit/php-file-iterator": "~1.3", - "phpunit/php-text-template": "~1.2", - "phpunit/php-token-stream": "~1.3", - "sebastian/environment": "^1.3.2", - "sebastian/version": "~1.0" - }, - "require-dev": { - "ext-xdebug": ">=2.1.4", - "phpunit/phpunit": "~4" - }, - "suggest": { - "ext-dom": "*", - "ext-xdebug": ">=2.2.1", - "ext-xmlwriter": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.2.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.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" - ], - "time": "2015-10-06 15:47:00" - }, - { - "name": "phpunit/php-file-iterator", - "version": "1.4.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/6150bf2c35d3fc379e50c7602b75caceaa39dbf0", - "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.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" - ], - "time": "2015-06-21 13:08:43" - }, - { - "name": "phpunit/php-text-template", - "version": "1.2.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "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" - ], - "time": "2015-06-21 13:50:34" - }, - { - "name": "phpunit/php-timer", - "version": "1.0.7", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3e82f4e9fc92665fafd9157568e4dcb01d014e5b", - "reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Utility class for timing", - "homepage": "https://github.com/sebastianbergmann/php-timer/", - "keywords": [ - "timer" - ], - "time": "2015-06-21 08:01:12" - }, - { - "name": "phpunit/php-token-stream", - "version": "1.4.8", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da", - "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Wrapper around PHP's tokenizer extension.", - "homepage": "https://github.com/sebastianbergmann/php-token-stream/", - "keywords": [ - "tokenizer" - ], - "time": "2015-09-15 10:49:45" - }, - { - "name": "phpunit/phpunit", - "version": "4.8.14", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "b4900675926860bef091644849305399b986efa2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/b4900675926860bef091644849305399b986efa2", - "reference": "b4900675926860bef091644849305399b986efa2", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-json": "*", - "ext-pcre": "*", - "ext-reflection": "*", - "ext-spl": "*", - "php": ">=5.3.3", - "phpspec/prophecy": "^1.3.1", - "phpunit/php-code-coverage": "~2.1", - "phpunit/php-file-iterator": "~1.4", - "phpunit/php-text-template": "~1.2", - "phpunit/php-timer": ">=1.0.6", - "phpunit/phpunit-mock-objects": "~2.3", - "sebastian/comparator": "~1.1", - "sebastian/diff": "~1.2", - "sebastian/environment": "~1.3", - "sebastian/exporter": "~1.2", - "sebastian/global-state": "~1.0", - "sebastian/version": "~1.0", - "symfony/yaml": "~2.1|~3.0" - }, - "suggest": { - "phpunit/php-invoker": "~1.1" - }, - "bin": [ - "phpunit" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.8.x-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": "The PHP Unit Testing framework.", - "homepage": "https://phpunit.de/", - "keywords": [ - "phpunit", - "testing", - "xunit" - ], - "time": "2015-10-17 15:03:30" - }, - { - "name": "phpunit/phpunit-mock-objects", - "version": "2.3.8", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/ac8e7a3db35738d56ee9a76e78a4e03d97628983", - "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.0.2", - "php": ">=5.3.3", - "phpunit/php-text-template": "~1.2", - "sebastian/exporter": "~1.2" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "suggest": { - "ext-soap": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.3.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Mock Object library for PHPUnit", - "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", - "keywords": [ - "mock", - "xunit" - ], - "time": "2015-10-02 06:51:40" - }, - { - "name": "psr/log", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/fe0936ee26643249e916849d48e3a51d5f5e278b", - "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b", - "shasum": "" - }, - "type": "library", - "autoload": { - "psr-0": { - "Psr\\Log\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for logging libraries", - "keywords": [ - "log", - "psr", - "psr-3" - ], - "time": "2012-12-21 11:40:51" - }, - { - "name": "satooshi/php-coveralls", - "version": "v0.6.1", - "source": { - "type": "git", - "url": "https://github.com/satooshi/php-coveralls.git", - "reference": "dd0df95bd37a7cf5c5c50304dfe260ffe4b50760" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/satooshi/php-coveralls/zipball/dd0df95bd37a7cf5c5c50304dfe260ffe4b50760", - "reference": "dd0df95bd37a7cf5c5c50304dfe260ffe4b50760", - "shasum": "" - }, - "require": { - "ext-curl": "*", - "ext-json": "*", - "ext-simplexml": "*", - "guzzle/guzzle": ">=3.0", - "php": ">=5.3", - "psr/log": "1.0.0", - "symfony/config": ">=2.0", - "symfony/console": ">=2.0", - "symfony/stopwatch": ">=2.2", - "symfony/yaml": ">=2.0" - }, - "require-dev": { - "apigen/apigen": "2.8.*@stable", - "pdepend/pdepend": "dev-master", - "phpmd/phpmd": "dev-master", - "phpunit/php-invoker": ">=1.1.0,<1.2.0", - "phpunit/phpunit": "3.7.*@stable", - "sebastian/finder-facade": "dev-master", - "sebastian/phpcpd": "1.4.*@stable", - "squizlabs/php_codesniffer": "1.4.*@stable", - "theseer/fdomdocument": "dev-master" - }, - "bin": [ - "composer/bin/coveralls" - ], - "type": "library", - "autoload": { - "psr-0": { - "Contrib\\Component": "src/", - "Contrib\\Bundle": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Kitamura Satoshi", - "email": "with.no.parachute@gmail.com", - "homepage": "https://www.facebook.com/satooshi.jp" - } - ], - "description": "PHP client library for Coveralls API", - "homepage": "https://github.com/satooshi/php-coveralls", - "keywords": [ - "ci", - "coverage", - "github", - "test" - ], - "time": "2013-05-04 08:07:33" - }, - { - "name": "sebastian/comparator", - "version": "1.2.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "937efb279bd37a375bcadf584dec0726f84dbf22" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/937efb279bd37a375bcadf584dec0726f84dbf22", - "reference": "937efb279bd37a375bcadf584dec0726f84dbf22", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "sebastian/diff": "~1.2", - "sebastian/exporter": "~1.2" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides the functionality to compare PHP values for equality", - "homepage": "http://www.github.com/sebastianbergmann/comparator", - "keywords": [ - "comparator", - "compare", - "equality" - ], - "time": "2015-07-26 15:48:44" - }, - { - "name": "sebastian/diff", - "version": "1.3.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "863df9687835c62aa423a22412d26fa2ebde3fd3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/863df9687835c62aa423a22412d26fa2ebde3fd3", - "reference": "863df9687835c62aa423a22412d26fa2ebde3fd3", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Diff implementation", - "homepage": "http://www.github.com/sebastianbergmann/diff", - "keywords": [ - "diff" - ], - "time": "2015-02-22 15:13:53" - }, - { - "name": "sebastian/environment", - "version": "1.3.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "6324c907ce7a52478eeeaede764f48733ef5ae44" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/6324c907ce7a52478eeeaede764f48733ef5ae44", - "reference": "6324c907ce7a52478eeeaede764f48733ef5ae44", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3.x-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" - ], - "time": "2015-08-03 06:14:51" - }, - { - "name": "sebastian/exporter", - "version": "1.2.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "7ae5513327cb536431847bcc0c10edba2701064e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/7ae5513327cb536431847bcc0c10edba2701064e", - "reference": "7ae5513327cb536431847bcc0c10edba2701064e", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "sebastian/recursion-context": "~1.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - } - ], - "description": "Provides the functionality to export PHP variables for visualization", - "homepage": "http://www.github.com/sebastianbergmann/exporter", - "keywords": [ - "export", - "exporter" - ], - "time": "2015-06-21 07:55:53" - }, - { - "name": "sebastian/global-state", - "version": "1.1.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.2" - }, - "suggest": { - "ext-uopz": "*" - }, - "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" - } - ], - "description": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", - "keywords": [ - "global state" - ], - "time": "2015-10-12 03:26:01" - }, - { - "name": "sebastian/recursion-context", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "994d4a811bafe801fb06dccbee797863ba2792ba" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/994d4a811bafe801fb06dccbee797863ba2792ba", - "reference": "994d4a811bafe801fb06dccbee797863ba2792ba", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - } - ], - "description": "Provides functionality to recursively process PHP variables", - "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2015-06-21 08:04:50" - }, - { - "name": "sebastian/version", - "version": "1.0.6", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/version.git", - "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", - "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", - "shasum": "" - }, - "type": "library", - "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", - "time": "2015-06-21 13:59:46" - }, - { - "name": "symfony/config", - "version": "v2.7.5", - "source": { - "type": "git", - "url": "https://github.com/symfony/config.git", - "reference": "9698fdf0a750d6887d5e7729d5cf099765b20e61" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/9698fdf0a750d6887d5e7729d5cf099765b20e61", - "reference": "9698fdf0a750d6887d5e7729d5cf099765b20e61", - "shasum": "" - }, - "require": { - "php": ">=5.3.9", - "symfony/filesystem": "~2.3" - }, - "require-dev": { - "symfony/phpunit-bridge": "~2.7" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Config\\": "" - } - }, - "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": "Symfony Config Component", - "homepage": "https://symfony.com", - "time": "2015-09-21 15:02:29" - }, - { - "name": "symfony/console", - "version": "v2.7.5", - "source": { - "type": "git", - "url": "https://github.com/symfony/console.git", - "reference": "06cb17c013a82f94a3d840682b49425cd00a2161" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/06cb17c013a82f94a3d840682b49425cd00a2161", - "reference": "06cb17c013a82f94a3d840682b49425cd00a2161", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/event-dispatcher": "~2.1", - "symfony/phpunit-bridge": "~2.7", - "symfony/process": "~2.1" - }, - "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/process": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Console\\": "" - } - }, - "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": "Symfony Console Component", - "homepage": "https://symfony.com", - "time": "2015-09-25 08:32:23" - }, - { - "name": "symfony/event-dispatcher", - "version": "v2.7.5", - "source": { - "type": "git", - "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "ae4dcc2a8d3de98bd794167a3ccda1311597c5d9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/ae4dcc2a8d3de98bd794167a3ccda1311597c5d9", - "reference": "ae4dcc2a8d3de98bd794167a3ccda1311597c5d9", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/config": "~2.0,>=2.0.5", - "symfony/dependency-injection": "~2.6", - "symfony/expression-language": "~2.6", - "symfony/phpunit-bridge": "~2.7", - "symfony/stopwatch": "~2.3" - }, - "suggest": { - "symfony/dependency-injection": "", - "symfony/http-kernel": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\EventDispatcher\\": "" - } - }, - "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": "Symfony EventDispatcher Component", - "homepage": "https://symfony.com", - "time": "2015-09-22 13:49:29" - }, - { - "name": "symfony/filesystem", - "version": "v2.7.5", - "source": { - "type": "git", - "url": "https://github.com/symfony/filesystem.git", - "reference": "a17f8a17c20e8614c15b8e116e2f4bcde102cfab" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/a17f8a17c20e8614c15b8e116e2f4bcde102cfab", - "reference": "a17f8a17c20e8614c15b8e116e2f4bcde102cfab", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "require-dev": { - "symfony/phpunit-bridge": "~2.7" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Filesystem\\": "" - } - }, - "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": "Symfony Filesystem Component", - "homepage": "https://symfony.com", - "time": "2015-09-09 17:42:36" - }, - { - "name": "symfony/stopwatch", - "version": "v2.7.5", - "source": { - "type": "git", - "url": "https://github.com/symfony/stopwatch.git", - "reference": "08dd97b3f22ab9ee658cd16e6758f8c3c404336e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/08dd97b3f22ab9ee658cd16e6758f8c3c404336e", - "reference": "08dd97b3f22ab9ee658cd16e6758f8c3c404336e", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "require-dev": { - "symfony/phpunit-bridge": "~2.7" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Stopwatch\\": "" - } - }, - "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": "Symfony Stopwatch Component", - "homepage": "https://symfony.com", - "time": "2015-09-22 13:49:29" - }, - { - "name": "symfony/yaml", - "version": "v2.7.5", - "source": { - "type": "git", - "url": "https://github.com/symfony/yaml.git", - "reference": "31cb2ad0155c95b88ee55fe12bc7ff92232c1770" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/31cb2ad0155c95b88ee55fe12bc7ff92232c1770", - "reference": "31cb2ad0155c95b88ee55fe12bc7ff92232c1770", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "require-dev": { - "symfony/phpunit-bridge": "~2.7" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Yaml\\": "" - } - }, - "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": "Symfony Yaml Component", - "homepage": "https://symfony.com", - "time": "2015-09-14 14:14:09" - } - ], - "aliases": [], - "minimum-stability": "stable", - "stability-flags": { - "codeclimate/php-test-reporter": 20 - }, - "prefer-stable": false, - "prefer-lowest": false, - "platform": [], - "platform-dev": [] -} diff --git a/vendor/aptoma/twig-markdown/phpunit.xml.dist b/vendor/aptoma/twig-markdown/phpunit.xml.dist deleted file mode 100644 index f67a579..0000000 --- a/vendor/aptoma/twig-markdown/phpunit.xml.dist +++ /dev/null @@ -1,18 +0,0 @@ - - - - - ./tests/ - - - diff --git a/vendor/aptoma/twig-markdown/src/Aptoma/Twig/Extension/MarkdownEngine/GitHubMarkdownEngine.php b/vendor/aptoma/twig-markdown/src/Aptoma/Twig/Extension/MarkdownEngine/GitHubMarkdownEngine.php deleted file mode 100644 index 10905c2..0000000 --- a/vendor/aptoma/twig-markdown/src/Aptoma/Twig/Extension/MarkdownEngine/GitHubMarkdownEngine.php +++ /dev/null @@ -1,76 +0,0 @@ - - */ -class GitHubMarkdownEngine implements MarkdownEngineInterface -{ - /** - * Constructor - * - * @param string $contextRepo The repository context. Pass a GitHub repo - * such as 'aptoma/twig-markdown' to render e.g. issues #23 in the - * context of the repo. - * @param bool $gfm Whether to use GitHub's Flavored Markdown or the - * standard markdown. Default is true. - * @param string $cacheDir Location on disk where rendered documents should - * be stored. - * @param \Github\Client $client Client object to use. A new Github\Client() - * object is constructed automatically if $client is null. - */ - public function __construct($contextRepo = null, $gfm = true, $cacheDir = '/tmp/github-markdown-cache', \GitHub\Client $client=null) - { - $this->repo = $contextRepo; - $this->mode = $gfm ? 'gfm' : 'markdown'; - $this->cacheDir = rtrim($cacheDir, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR; - if (!is_dir($this->cacheDir)) { - @mkdir($this->cacheDir, 0777, true); - } - - if ($client === null) { - $client = new \Github\Client(); - } - $this->api = $client->api('markdown'); - } - - /** - * {@inheritdoc} - */ - public function transform($content) - { - $cacheFile = $this->getCachePath($content); - if (file_exists($cacheFile)) { - return file_get_contents($cacheFile);; - } - - $response = $this->api->render($content, $this->mode, $this->repo); - file_put_contents($cacheFile, $response); - return $response; - } - - /** - * {@inheritdoc} - */ - public function getName() - { - return 'KnpLabs\php-github-api'; - } - - private function getCachePath($content) - { - return $this->cacheDir . md5($content) . '_' . $this->mode. '_' . str_replace('/', '.', $this->repo); - } - - private $api; - private $cacheDir; - private $repo; - private $mode; -} diff --git a/vendor/aptoma/twig-markdown/src/Aptoma/Twig/Extension/MarkdownEngine/MichelfMarkdownEngine.php b/vendor/aptoma/twig-markdown/src/Aptoma/Twig/Extension/MarkdownEngine/MichelfMarkdownEngine.php deleted file mode 100644 index 92899ea..0000000 --- a/vendor/aptoma/twig-markdown/src/Aptoma/Twig/Extension/MarkdownEngine/MichelfMarkdownEngine.php +++ /dev/null @@ -1,32 +0,0 @@ - - */ -class MichelfMarkdownEngine implements MarkdownEngineInterface -{ - /** - * {@inheritdoc} - */ - public function transform($content) - { - return MarkdownExtra::defaultTransform($content); - } - - /** - * {@inheritdoc} - */ - public function getName() - { - return 'Michelf\Markdown'; - } -} diff --git a/vendor/aptoma/twig-markdown/src/Aptoma/Twig/Extension/MarkdownEngine/PHPLeagueCommonMarkEngine.php b/vendor/aptoma/twig-markdown/src/Aptoma/Twig/Extension/MarkdownEngine/PHPLeagueCommonMarkEngine.php deleted file mode 100644 index e10a7d2..0000000 --- a/vendor/aptoma/twig-markdown/src/Aptoma/Twig/Extension/MarkdownEngine/PHPLeagueCommonMarkEngine.php +++ /dev/null @@ -1,49 +0,0 @@ - - */ -class PHPLeagueCommonMarkEngine implements MarkdownEngineInterface -{ - /** - * @var \League\CommonMark\CommonMarkConverter - */ - private $converter; - - /** - * Constructor - * - * Accepts CommonMarkConverter or creates one automatically - * - * @param \League\CommonMark\CommonMarkConverter $converter - */ - public function __construct(CommonMarkConverter $converter = null) - { - $this->converter = $converter ?: new CommonMarkConverter(); - } - - /** - * {@inheritdoc} - */ - public function transform($content) - { - return $this->converter->convertToHtml($content); - } - - /** - * {@inheritdoc} - */ - public function getName() - { - return 'League\CommonMark'; - } -} diff --git a/vendor/aptoma/twig-markdown/src/Aptoma/Twig/Extension/MarkdownEngine/ParsedownEngine.php b/vendor/aptoma/twig-markdown/src/Aptoma/Twig/Extension/MarkdownEngine/ParsedownEngine.php deleted file mode 100644 index 62ee679..0000000 --- a/vendor/aptoma/twig-markdown/src/Aptoma/Twig/Extension/MarkdownEngine/ParsedownEngine.php +++ /dev/null @@ -1,45 +0,0 @@ - - */ -class ParsedownEngine implements MarkdownEngineInterface -{ - /** - * @var Parsedown - */ - protected $engine; - - /** - * @param string|null $instanceName - */ - public function __construct($instanceName = null) - { - $this->engine = Parsedown::instance($instanceName); - } - - /** - * {@inheritdoc} - */ - public function transform($content) - { - return $this->engine->parse($content); - } - - /** - * {@inheritdoc} - */ - public function getName() - { - return 'erusev/parsedown'; - } -} diff --git a/vendor/aptoma/twig-markdown/src/Aptoma/Twig/Extension/MarkdownEngineInterface.php b/vendor/aptoma/twig-markdown/src/Aptoma/Twig/Extension/MarkdownEngineInterface.php deleted file mode 100644 index cfc34b3..0000000 --- a/vendor/aptoma/twig-markdown/src/Aptoma/Twig/Extension/MarkdownEngineInterface.php +++ /dev/null @@ -1,28 +0,0 @@ - - */ -interface MarkdownEngineInterface -{ - /** - * Transforms the given markdown data in HTML - * - * @param $content Markdown data - * @return string - */ - public function transform($content); - - /** - * Return Markdown engine vendor ID - * - * @return string - */ - public function getName(); -} diff --git a/vendor/aptoma/twig-markdown/src/Aptoma/Twig/Extension/MarkdownExtension.php b/vendor/aptoma/twig-markdown/src/Aptoma/Twig/Extension/MarkdownExtension.php deleted file mode 100644 index 522d49c..0000000 --- a/vendor/aptoma/twig-markdown/src/Aptoma/Twig/Extension/MarkdownExtension.php +++ /dev/null @@ -1,69 +0,0 @@ - - * @author Joris Berthelot - */ -class MarkdownExtension extends \Twig_Extension -{ - - /** - * @var MarkdownEngineInterface $markdownEngine - */ - private $markdownEngine; - - /** - * @param MarkdownEngineInterface $markdownEngine The Markdown parser engine - */ - public function __construct(MarkdownEngineInterface $markdownEngine) - { - $this->markdownEngine = $markdownEngine; - } - - /** - * {@inheritdoc} - */ - public function getFilters() - { - return array( - new \Twig_SimpleFilter( - 'markdown', - array($this, 'parseMarkdown'), - array('is_safe' => array('html')) - ) - ); - } - - /** - * Transform Markdown content to HTML - * - * @param $content The Markdown content to be transformed - * @return string The result of the Markdown engine transformation - */ - public function parseMarkdown($content) - { - return $this->markdownEngine->transform($content); - } - - /** - * {@inheritdoc} - */ - public function getTokenParsers() - { - return array(new MarkdownTokenParser($this->markdownEngine)); - } - - /** - * {@inheritdoc} - */ - public function getName() - { - return 'markdown'; - } -} diff --git a/vendor/aptoma/twig-markdown/src/Aptoma/Twig/Node/MarkdownNode.php b/vendor/aptoma/twig-markdown/src/Aptoma/Twig/Node/MarkdownNode.php deleted file mode 100644 index 9e38a35..0000000 --- a/vendor/aptoma/twig-markdown/src/Aptoma/Twig/Node/MarkdownNode.php +++ /dev/null @@ -1,38 +0,0 @@ - - * @author Joris Berthelot - */ -class MarkdownNode extends \Twig_Node -{ - public function __construct(\Twig_NodeInterface $body, $lineno, $tag = 'markdown') - { - parent::__construct(array('body' => $body), array(), $lineno, $tag); - } - - /** - * Compiles the node to PHP. - * - * @param \Twig_Compiler A Twig_Compiler instance - */ - public function compile(\Twig_Compiler $compiler) - { - $compiler - ->addDebugInfo($this) - ->write('ob_start();' . PHP_EOL) - ->subcompile($this->getNode('body')) - ->write('$content = ob_get_clean();' . PHP_EOL) - ->write('preg_match("/^\s*/", $content, $matches);' . PHP_EOL) - ->write('$lines = explode("\n", $content);' . PHP_EOL) - ->write('$content = preg_replace(\'/^\' . $matches[0]. \'/\', "", $lines);' . PHP_EOL) - ->write('$content = join("\n", $content);' . PHP_EOL) - ->write('echo $this->env->getTokenParsers()->getTokenParser(\'markdown\')->getEngine()->transform($content);' . PHP_EOL); - } -} diff --git a/vendor/aptoma/twig-markdown/src/Aptoma/Twig/TokenParser/MarkdownTokenParser.php b/vendor/aptoma/twig-markdown/src/Aptoma/Twig/TokenParser/MarkdownTokenParser.php deleted file mode 100644 index 9f587f9..0000000 --- a/vendor/aptoma/twig-markdown/src/Aptoma/Twig/TokenParser/MarkdownTokenParser.php +++ /dev/null @@ -1,76 +0,0 @@ - - * @author Joris Berthelot - */ -class MarkdownTokenParser extends \Twig_TokenParser -{ - /** - * @var The Markdown engine - */ - protected $markdownEngine; - - /** - * @param MarkdownEngineInterface $markdownEngine The Markdown parser engine - */ - public function __construct(MarkdownEngineInterface $markdownEngine) - { - $this->markdownEngine = $markdownEngine; - } - - /** - * Markdown parser engine getter - * - * @return MarkdownEngineInterface - */ - public function getEngine() - { - return $this->markdownEngine; - } - - /** - * Parses a token and returns a node. - * - * @param \Twig_Token $token A \Twig_Token instance - * - * @throws \Twig_Error_Syntax - * @return \Twig_NodeInterface A \Twig_NodeInterface instance - */ - public function parse(\Twig_Token $token) - { - $lineno = $token->getLine(); - - $this->parser->getStream()->expect(\Twig_Token::BLOCK_END_TYPE); - $body = $this->parser->subparse(array($this, 'decideMarkdownEnd'), true); - $this->parser->getStream()->expect(\Twig_Token::BLOCK_END_TYPE); - - return new MarkdownNode($body, $lineno, $this->getTag()); - } - - /** - * Decide if current token marks end of Markdown block. - * - * @param \Twig_Token $token - * @return bool - */ - public function decideMarkdownEnd(\Twig_Token $token) - { - return $token->test('endmarkdown'); - } - - /** - * Gets the tag name associated with this token parser. - * - * @return string The tag name - */ - public function getTag() - { - return 'markdown'; - } -} diff --git a/vendor/aptoma/twig-markdown/tests/Aptoma/Twig/Extension/MarkdownEngine/GithubMarkdownEngineTest.php b/vendor/aptoma/twig-markdown/tests/Aptoma/Twig/Extension/MarkdownEngine/GithubMarkdownEngineTest.php deleted file mode 100644 index 054205b..0000000 --- a/vendor/aptoma/twig-markdown/tests/Aptoma/Twig/Extension/MarkdownEngine/GithubMarkdownEngineTest.php +++ /dev/null @@ -1,31 +0,0 @@ - - */ -class GitHubMarkdownEngineTest extends MarkdownExtensionTest -{ - public function getParseMarkdownTests() - { - return array( - array('{{ "# Main Title"|markdown }}', '

Main Title

'), - array('{{ content|markdown }}', '

Main Title

', array('content' => '# Main Title')), - // Check if GFM is working - array('{{ "@aptoma"|markdown }}', - '

@aptoma

'), - ); - } - - protected function getEngine() - { - return new GitHubMarkdownEngine(); - } -} diff --git a/vendor/aptoma/twig-markdown/tests/Aptoma/Twig/Extension/MarkdownEngine/PHPLeagueCommonMarkEngineTest.php b/vendor/aptoma/twig-markdown/tests/Aptoma/Twig/Extension/MarkdownEngine/PHPLeagueCommonMarkEngineTest.php deleted file mode 100644 index 806ca02..0000000 --- a/vendor/aptoma/twig-markdown/tests/Aptoma/Twig/Extension/MarkdownEngine/PHPLeagueCommonMarkEngineTest.php +++ /dev/null @@ -1,23 +0,0 @@ - - */ -class PHPLeagueCommonMarkEngineTest extends MarkdownExtensionTest -{ - protected function getEngine() - { - return new PHPLeagueCommonMarkEngine(); - } -} diff --git a/vendor/aptoma/twig-markdown/tests/Aptoma/Twig/Extension/MarkdownEngine/ParsedownEngineTest.php b/vendor/aptoma/twig-markdown/tests/Aptoma/Twig/Extension/MarkdownEngine/ParsedownEngineTest.php deleted file mode 100644 index 5337ca0..0000000 --- a/vendor/aptoma/twig-markdown/tests/Aptoma/Twig/Extension/MarkdownEngine/ParsedownEngineTest.php +++ /dev/null @@ -1,32 +0,0 @@ - - */ -class ParsedownEngineTest extends MarkdownExtensionTest -{ - public function getParseMarkdownTests() - { - return array( - array('{{ "# Main Title"|markdown }}', '

Main Title

'), - array('{{ content|markdown }}', '

Main Title

', array('content' => '# Main Title')), - array('{% markdown %}{{ content }}{% endmarkdown %}', '

Main Title

', array('content' => '# Main Title')) - ); - } - - protected function getEngine() - { - return new ParsedownEngine(); - } -} diff --git a/vendor/aptoma/twig-markdown/tests/Aptoma/Twig/Extension/MarkdownExtensionTest.php b/vendor/aptoma/twig-markdown/tests/Aptoma/Twig/Extension/MarkdownExtensionTest.php deleted file mode 100644 index b21dad1..0000000 --- a/vendor/aptoma/twig-markdown/tests/Aptoma/Twig/Extension/MarkdownExtensionTest.php +++ /dev/null @@ -1,41 +0,0 @@ - - */ -class MarkdownExtensionTest extends \PHPUnit_Framework_TestCase -{ - /** - * @dataProvider getParseMarkdownTests - */ - public function testParseMarkdown($template, $expected, $context = array()) - { - $this->assertEquals($expected, $this->getTemplate($template)->render($context)); - } - - public function getParseMarkdownTests() - { - return array( - array('{{ "# Main Title"|markdown }}', '

Main Title

' . PHP_EOL), - array('{{ content|markdown }}', '

Main Title

' . PHP_EOL, array('content' => '# Main Title')) - ); - } - - protected function getEngine() - { - return new MichelfMarkdownEngine(); - } - - protected function getTemplate($template) - { - $loader = new \Twig_Loader_Array(array('index' => $template)); - $twig = new \Twig_Environment($loader, array('debug' => true, 'cache' => false)); - $twig->addExtension(new MarkdownExtension($this->getEngine())); - - return $twig->loadTemplate('index'); - } -} diff --git a/vendor/aptoma/twig-markdown/tests/Aptoma/Twig/TokenParser/MarkdownTokenParserTest.php b/vendor/aptoma/twig-markdown/tests/Aptoma/Twig/TokenParser/MarkdownTokenParserTest.php deleted file mode 100644 index 34c7a88..0000000 --- a/vendor/aptoma/twig-markdown/tests/Aptoma/Twig/TokenParser/MarkdownTokenParserTest.php +++ /dev/null @@ -1,109 +0,0 @@ - - */ -class MarkdownTokenParserTest extends \Twig_Test_NodeTestCase -{ - public function testConstructor() - { - $body = new \Twig_Node(array(new \Twig_Node_Text("#Title\n\nparagraph\n", 1))); - $node = new MarkdownNode($body, 1); - - $this->assertEquals($body, $node->getNode('body')); - } - - /** - * Test that the generated code actually do what we expect - * - * The contents of this test is the same that we write in the compile method. - * This requires manual synchronization, which we should probably not rely on. - */ - public function testMarkdownPrepareBehavior() - { - $body = " #Title\n\n paragraph\n\n code"; - $bodyPrepared = "#Title\n\nparagraph\n\n code"; - - ob_start(); - echo $body; - $content = ob_get_clean(); - preg_match("/^\s*/", $content, $matches); - $lines = explode("\n", $content); - $content = preg_replace('/^' . $matches[0]. '/', "", $lines); - $content = join("\n", $content); - - // Assert prepared content looks right - $this->assertEquals($bodyPrepared, $content); - - // Assert Markdown output - $expectedOutput = "

Title

\n\n

paragraph

\n\n
code\n
\n"; - $this->assertEquals($expectedOutput, $this->getEngine()->transform($content)); - } - - /** - * Test that the generated code looks as expected - * - * @dataProvider getTests - */ - public function testCompile($node, $source, $environment = null) - { - parent::testCompile($node, $source, $environment); - } - - protected function getEngine() - { - return new MichelfMarkdownEngine(); - } - - public function getTests() - { - $tests = array(); - - $body = new \Twig_Node(array(new \Twig_Node_Text("#Title\n\nparagraph\n", 1))); - $node = new MarkdownNode($body, 1); - - $tests['simple text'] = array($node, <<env->getTokenParsers()->getTokenParser('markdown')->getEngine()->transform(\$content); -EOF - ); - - $body = new \Twig_Node(array(new \Twig_Node_Text(" #Title\n\n paragraph\n\n code\n", 1))); - $node = new MarkdownNode($body, 1); - - $tests['text with leading indent'] = array($node, <<env->getTokenParsers()->getTokenParser('markdown')->getEngine()->transform(\$content); -EOF - ); - - return $tests; - } -} diff --git a/vendor/asm89/twig-cache-extension/.gitignore b/vendor/asm89/twig-cache-extension/.gitignore deleted file mode 100644 index 8844fdc..0000000 --- a/vendor/asm89/twig-cache-extension/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -phpunit.xml -composer.lock -composer.phar -/vendor/ diff --git a/vendor/asm89/twig-cache-extension/.travis.yml b/vendor/asm89/twig-cache-extension/.travis.yml deleted file mode 100644 index c138041..0000000 --- a/vendor/asm89/twig-cache-extension/.travis.yml +++ /dev/null @@ -1,44 +0,0 @@ -language: php - -matrix: - include: - - php: 5.6 - dist: xenial - env: 'COMPOSER_FLAGS="--prefer-stable --prefer-lowest" TWIG_VERSION="^1.0"' - - php: 5.6 - dist: xenial - env: TWIG_VERSION="^1.0" - - php: 7.0 - dist: xenial - env: TWIG_VERSION="^1.0" - - php: 7.1 - dist: bionic - env: TWIG_VERSION="^1.0" - - php: 7.2 - dist: bionic - env: TWIG_VERSION="^1.0" - - php: 7.3 - dist: bionic - env: TWIG_VERSION="^1.0" - - php: 7.4 - dist: bionic - env: TWIG_VERSION="^1.0" - - php: 7.0 - dist: xenial - env: TWIG_VERSION="^2.0" - - php: 7.1 - dist: bionic - env: TWIG_VERSION="^2.0" - - php: 7.2 - dist: bionic - env: TWIG_VERSION="^2.0" - - php: 7.3 - dist: bionic - env: TWIG_VERSION="^2.0" - - php: 7.4 - dist: bionic - env: TWIG_VERSION="^2.0" - -install: composer require twig/twig:${TWIG_VERSION} - -script: composer test diff --git a/vendor/asm89/twig-cache-extension/LICENSE b/vendor/asm89/twig-cache-extension/LICENSE deleted file mode 100644 index 6e6b088..0000000 --- a/vendor/asm89/twig-cache-extension/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2013 Alexander - -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/vendor/asm89/twig-cache-extension/README.md b/vendor/asm89/twig-cache-extension/README.md deleted file mode 100644 index 38c0887..0000000 --- a/vendor/asm89/twig-cache-extension/README.md +++ /dev/null @@ -1,238 +0,0 @@ -Twig cache extension -==================== - -The missing cache extension for Twig. The extension allows for caching rendered parts of -templates using several cache strategies. - -[![Build Status](https://secure.travis-ci.org/asm89/twig-cache-extension.png?branch=master)](http://travis-ci.org/asm89/twig-cache-extension) - -## Installation - -The extension is installable via composer: - -```json -{ - "require": { - "asm89/twig-cache-extension": "~1.0" - } -} -``` - -## Quick start - -### Setup - -A minimal setup for adding the extension with the `LifeTimeCacheStrategy` and -doctrine array cache is as following: - -```php -addExtension($cacheExtension); -``` - -### Want to use a PSR-6 cache pool? - -Instead of using the default `DoctrineCacheAdapter` the extension also has -a `PSR-6` compatible adapter. You need to instantiate one of the cache pool -implementations as can be found on: http://php-cache.readthedocs.io/en/latest/ - -Example: Making use of the `ApcuCachePool` via the `PsrCacheAdapter`: - -```bash -composer require cache/apcu-adapter -``` - -```php -addExtension($cacheExtension); -``` - -### Usage - -To cache a part of a template in Twig surround the code with a `cache` block. -The cache block takes two parameters, first an "annotation" part, second the -"value" the cache strategy can work with. Example: - -```jinja -{% cache 'v1/summary' 900 %} - {# heavy lifting template stuff here, include/render other partials etc #} -{% endcache %} -``` - -Cache blocks can be nested: - -```jinja -{% cache 'v1' 900 %} - {% for item in items %} - {% cache 'v1' item %} - {# ... #} - {% endcache %} - {% endfor %} -{% endcache %} -``` - -The annotation can also be an expression: - -```jinja -{% set version = 42 %} -{% cache 'hello_v' ~ version 900 %} - Hello {{ name }}! -{% endcache %} -``` - -## Cache strategies - -The extension ships with a few cache strategies out of the box. Setup and usage -of all of them is described below. - -### Lifetime - -See the ["Quick start"](#quick-start) for usage information of the `LifetimeCacheStrategy`. - -### Generational - -Strategy for generational caching. - -In theory the strategy only saves fragments to the cache with infinite -lifetime. The key of the strategy lies in the fact that the keys for blocks -will change as the value for which the key is generated changes. - -For example: entities containing a last update time, would include a timestamp -in the key. For an interesting blog post about this type of caching see: -http://37signals.com/svn/posts/3113-how-key-based-cache-expiration-works - -### Blackhole - -Strategy for development mode. - -In development mode it often not very useful to cache fragments. The blackhole -strategy provides an easy way to not cache anything it all. It always generates -a new key and does not fetch or save any fragments. - -#### Setup - -In order to use the strategy you need to setup a `KeyGenerator` class that is -able to generate a cache key for a given value. - -The following naive example always assumes the value is an object with the methods -`getId()` and `getUpdatedAt()` method. The key then composed from the class -name, the id and the updated time of the object: - -```php -getId() . '_' . $value->getUpdatedAt(); - } - -} -``` - -Next the `GenerationalCacheStrategy` needs to be setup with the keygenerator. - -```php -addExtension($cacheExtension); -``` - -#### Usage - -The strategy expects an object as value for determining the cache key of the -block: - -```jinja -{% cache 'v1/summary' item %} - {# heavy lifting template stuff here, include/render other partials etc #} -{% endcache %} -``` - -### Using multiple strategies - -Different cache strategies are useful for different usecases. It is possible to -mix multiple strategies in an application with the -`IndexedChainingCacheStrategy`. The strategy takes an array of `'name' => -$strategy` and delegates the caching to the appropriate strategy. - -#### Setup - -```php - $lifetimeCacheStrategy, - 'gen' => $generationalCacheStrategy, -)); -$cacheExtension = new CacheExtension($cacheStrategy); - -$twig->addExtension($cacheExtension); -``` - -#### Usage - -The strategy expects an array with as key the name of the strategy which it -needs to delegate to and as value the appropriate value for the delegated -strategy. - -```jinja -{# delegate to lifetime strategy #} -{% cache 'v1/summary' {time: 300} %} - {# heavy lifting template stuff here, include/render other partials etc #} -{% endcache %} - -{# delegate to generational strategy #} -{% cache 'v1/summary' {gen: item} %} - {# heavy lifting template stuff here, include/render other partials etc #} -{% endcache %} -``` - -## Implementing a cache strategy - -Creating separate caches for different access levels, languages or other -usecases can be done by implementing a custom cache strategy. In order to do so -implement the `CacheProviderInterface`. It is recommended to use composition -and wrap a custom strategy around an existing one. - -## Authors - -Alexander - -## License - -twig-cache-extension is licensed under the MIT License - see the LICENSE file for details diff --git a/vendor/asm89/twig-cache-extension/composer.json b/vendor/asm89/twig-cache-extension/composer.json deleted file mode 100644 index 176befb..0000000 --- a/vendor/asm89/twig-cache-extension/composer.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "name": "asm89/twig-cache-extension", - "description": "Cache fragments of templates directly within Twig.", - "keywords": ["twig", "cache", "extension"], - "homepage": "https://github.com/asm89/twig-cache-extension", - "type": "library", - "license": "MIT", - "authors": [ - { - "name": "Alexander", - "email": "iam.asm89@gmail.com" - } - ], - "require": { - "php": ">=5.3.2", - "twig/twig": "^1.0|^2.0" - }, - "require-dev": { - "phpunit/phpunit": "^5.0 || ^4.8.10", - "doctrine/cache": "~1.0" - }, - "scripts": { - "test": "phpunit" - }, - "suggest": { - "psr/cache-implementation": "To make use of PSR-6 cache implementation via PsrCacheAdapter." - }, - "autoload": { - "psr-4": { - "": "lib/" - } - }, - "autoload-dev": { - "psr-4": { - "": "test/" - } - }, - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - } -} diff --git a/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheProvider/DoctrineCacheAdapter.php b/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheProvider/DoctrineCacheAdapter.php deleted file mode 100644 index bb627fa..0000000 --- a/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheProvider/DoctrineCacheAdapter.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 Asm89\Twig\CacheExtension\CacheProvider; - -use Asm89\Twig\CacheExtension\CacheProviderInterface; -use Doctrine\Common\Cache\Cache; - -/** - * Adapter class to use the cache classes provider by Doctrine. - * - * @author Alexander - */ -class DoctrineCacheAdapter implements CacheProviderInterface -{ - private $cache; - - /** - * @param Cache $cache - */ - public function __construct(Cache $cache) - { - $this->cache = $cache; - } - - /** - * {@inheritDoc} - */ - public function fetch($key) - { - return $this->cache->fetch($key); - } - - /** - * {@inheritDoc} - */ - public function save($key, $value, $lifetime = 0) - { - return $this->cache->save($key, $value, $lifetime); - } -} diff --git a/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheProvider/PsrCacheAdapter.php b/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheProvider/PsrCacheAdapter.php deleted file mode 100644 index 3a525bc..0000000 --- a/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheProvider/PsrCacheAdapter.php +++ /dev/null @@ -1,68 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Asm89\Twig\CacheExtension\CacheProvider; - -use Asm89\Twig\CacheExtension\CacheProviderInterface; -use Psr\Cache\CacheItemPoolInterface; - -/** - * Adapter class to make extension interoperable with every PSR-6 adapter. - * - * @see http://php-cache.readthedocs.io/ - * - * @author Rvanlaak - */ -class PsrCacheAdapter implements CacheProviderInterface -{ - /** - * @var CacheItemPoolInterface - */ - private $cache; - - /** - * @param CacheItemPoolInterface $cache - */ - public function __construct(CacheItemPoolInterface $cache) - { - $this->cache = $cache; - } - - /** - * @param string $key - * @return mixed|false - */ - public function fetch($key) - { - // PSR-6 implementation returns null, CacheProviderInterface expects false - $item = $this->cache->getItem($key); - if ($item->isHit()) { - return $item->get(); - } - return false; - } - - /** - * @param string $key - * @param string $value - * @param int|\DateInterval $lifetime - * @return bool - */ - public function save($key, $value, $lifetime = 0) - { - $item = $this->cache->getItem($key); - $item->set($value); - $item->expiresAfter($lifetime); - - return $this->cache->save($item); - } - -} diff --git a/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheProviderInterface.php b/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheProviderInterface.php deleted file mode 100644 index 7a0a560..0000000 --- a/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheProviderInterface.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Asm89\Twig\CacheExtension; - -/** - * Cache provider interface. - * - * @author Alexander - */ -interface CacheProviderInterface -{ - /** - * @param string $key - * - * @return mixed False, if there was no value to be fetched. Null or a string otherwise. - */ - public function fetch($key); - - /** - * @param string $key - * @param string $value - * @param integer $lifetime - * - * @return boolean - */ - public function save($key, $value, $lifetime = 0); -} diff --git a/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheStrategy/BlackholeCacheStrategy.php b/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheStrategy/BlackholeCacheStrategy.php deleted file mode 100644 index fcc9445..0000000 --- a/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheStrategy/BlackholeCacheStrategy.php +++ /dev/null @@ -1,53 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Asm89\Twig\CacheExtension\CacheStrategy; - -use Asm89\Twig\CacheExtension\CacheStrategyInterface; - -/** - * CacheStrategy which doesn't cache at all - * - * This strategy can be used in development mode, e.g. editing twig templates, - * to prevent previously cached versions from being rendered. - * - * @see https://github.com/asm89/twig-cache-extension/pull/29 - * - * @author Hagen Hübel - * - * @package Asm89\Twig\CacheExtension\CacheStrategy - */ -class BlackholeCacheStrategy implements CacheStrategyInterface -{ - /** - * {@inheritDoc} - */ - public function fetchBlock($key) - { - return false; - } - - /** - * {@inheritDoc} - */ - public function generateKey($annotation, $value) - { - return microtime(true) . mt_rand(); - } - - /** - * {@inheritDoc} - */ - public function saveBlock($key, $block) - { - // fire and forget - } -} \ No newline at end of file diff --git a/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheStrategy/GenerationalCacheStrategy.php b/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheStrategy/GenerationalCacheStrategy.php deleted file mode 100644 index a67ea78..0000000 --- a/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheStrategy/GenerationalCacheStrategy.php +++ /dev/null @@ -1,79 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Asm89\Twig\CacheExtension\CacheStrategy; - -use Asm89\Twig\CacheExtension\CacheProviderInterface; -use Asm89\Twig\CacheExtension\CacheStrategyInterface; -use Asm89\Twig\CacheExtension\Exception\InvalidCacheKeyException; - -/** - * Strategy for generational caching. - * - * In theory the strategy only saves fragments to the cache with infinite - * lifetime. The key of the strategy lies in the fact that the keys for blocks - * will change as the value for which the key is generated changes. - * - * For example: entities containing a last update time, would include a - * timestamp in the key. - * - * @see http://37signals.com/svn/posts/3113-how-key-based-cache-expiration-works - * - * @author Alexander - */ -class GenerationalCacheStrategy implements CacheStrategyInterface -{ - private $keyGenerator; - private $cache; - private $lifetime; - - /** - * @param CacheProviderInterface $cache - * @param KeyGeneratorInterface $keyGenerator - * @param integer $lifetime - */ - public function __construct(CacheProviderInterface $cache, KeyGeneratorInterface $keyGenerator, $lifetime = 0) - { - $this->keyGenerator = $keyGenerator; - $this->cache = $cache; - $this->lifetime = $lifetime; - } - - /** - * {@inheritDoc} - */ - public function fetchBlock($key) - { - return $this->cache->fetch($key); - } - - /** - * {@inheritDoc} - */ - public function generateKey($annotation, $value) - { - $key = $this->keyGenerator->generateKey($value); - - if (null === $key) { - throw new InvalidCacheKeyException(); - } - - return $annotation . '__GCS__' . $key; - } - - /** - * {@inheritDoc} - */ - public function saveBlock($key, $block) - { - return $this->cache->save($key, $block, $this->lifetime); - } -} diff --git a/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheStrategy/IndexedChainingCacheStrategy.php b/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheStrategy/IndexedChainingCacheStrategy.php deleted file mode 100644 index 7305f04..0000000 --- a/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheStrategy/IndexedChainingCacheStrategy.php +++ /dev/null @@ -1,76 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Asm89\Twig\CacheExtension\CacheStrategy; - -use Asm89\Twig\CacheExtension\CacheStrategyInterface; -use Asm89\Twig\CacheExtension\Exception\NonExistingStrategyException; -use Asm89\Twig\CacheExtension\Exception\NonExistingStrategyKeyException; - -/** - * Combines several configured cache strategies. - * - * Useful for combining for example generational cache strategy with a lifetime - * cache strategy, but also useful when combining several generational cache - * strategies which differ on cache lifetime (infinite, 1hr, 5m). - * - * @author Alexander - */ -class IndexedChainingCacheStrategy implements CacheStrategyInterface -{ - /** - * @var CacheStrategyInterface[] - */ - private $strategies; - - /** - * @param array $strategies - */ - public function __construct(array $strategies) - { - $this->strategies = $strategies; - } - - /** - * {@inheritDoc} - */ - public function fetchBlock($key) - { - return $this->strategies[$key['strategyKey']]->fetchBlock($key['key']); - } - - /** - * {@inheritDoc} - */ - public function generateKey($annotation, $value) - { - if (!is_array($value) || null === $strategyKey = key($value)) { - throw new NonExistingStrategyKeyException(); - } - - if (!isset($this->strategies[$strategyKey])) { - throw new NonExistingStrategyException($strategyKey); - } - - return array( - 'strategyKey' => $strategyKey, - 'key' => $this->strategies[$strategyKey]->generateKey($annotation, current($value)), - ); - } - - /** - * {@inheritDoc} - */ - public function saveBlock($key, $block) - { - return $this->strategies[$key['strategyKey']]->saveBlock($key['key'], $block); - } -} diff --git a/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheStrategy/KeyGeneratorInterface.php b/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheStrategy/KeyGeneratorInterface.php deleted file mode 100644 index ed98210..0000000 --- a/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheStrategy/KeyGeneratorInterface.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 Asm89\Twig\CacheExtension\CacheStrategy; - -/** - * Generates a key for a given value. - * - * @author Alexander - */ -interface KeyGeneratorInterface -{ - /** - * Generate a cache key for a given value. - * - * @param mixed $value - * - * @return string - */ - public function generateKey($value); -} diff --git a/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheStrategy/LifetimeCacheStrategy.php b/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheStrategy/LifetimeCacheStrategy.php deleted file mode 100644 index cb83516..0000000 --- a/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheStrategy/LifetimeCacheStrategy.php +++ /dev/null @@ -1,68 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Asm89\Twig\CacheExtension\CacheStrategy; - -use Asm89\Twig\CacheExtension\CacheProviderInterface; -use Asm89\Twig\CacheExtension\CacheStrategyInterface; -use Asm89\Twig\CacheExtension\Exception\InvalidCacheLifetimeException; - -/** - * Strategy for caching with a pre-defined lifetime. - * - * The value passed to the strategy is the lifetime of the cache block in - * seconds. - * - * @author Alexander - */ -class LifetimeCacheStrategy implements CacheStrategyInterface -{ - private $cache; - - /** - * @param CacheProviderInterface $cache - */ - public function __construct(CacheProviderInterface $cache) - { - $this->cache = $cache; - } - - /** - * {@inheritDoc} - */ - public function fetchBlock($key) - { - return $this->cache->fetch($key['key']); - } - - /** - * {@inheritDoc} - */ - public function generateKey($annotation, $value) - { - if (!is_numeric($value)) { - throw new InvalidCacheLifetimeException($value); - } - - return array( - 'lifetime' => $value, - 'key' => '__LCS__' . $annotation, - ); - } - - /** - * {@inheritDoc} - */ - public function saveBlock($key, $block) - { - return $this->cache->save($key['key'], $block, $key['lifetime']); - } -} diff --git a/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheStrategyInterface.php b/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheStrategyInterface.php deleted file mode 100644 index 4a6e580..0000000 --- a/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheStrategyInterface.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 Asm89\Twig\CacheExtension; - -/** - * Cache strategy interface. - * - * @author Alexander - */ -interface CacheStrategyInterface -{ - /** - * Fetch the block for a given key. - * - * @param mixed $key - * - * @return mixed - */ - public function fetchBlock($key); - - /** - * Generate a key for the value. - * - * @param string $annotation - * @param mixed $value - * - * @return mixed - */ - public function generateKey($annotation, $value); - - /** - * Save the contents of a rendered block. - * - * @param mixed $key - * @param string $block - * - * @return mixed - */ - public function saveBlock($key, $block); -} diff --git a/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/Exception/BaseException.php b/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/Exception/BaseException.php deleted file mode 100644 index 470b161..0000000 --- a/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/Exception/BaseException.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. - */ - -namespace Asm89\Twig\CacheExtension\Exception; - -/** - * @todo Replace \RuntimeException with \InvalidArgumentException at version 2.0 - */ -class BaseException extends \RuntimeException -{ - -} diff --git a/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/Exception/InvalidCacheKeyException.php b/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/Exception/InvalidCacheKeyException.php deleted file mode 100644 index 3327559..0000000 --- a/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/Exception/InvalidCacheKeyException.php +++ /dev/null @@ -1,23 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Asm89\Twig\CacheExtension\Exception; - -class InvalidCacheKeyException extends BaseException -{ - /** - * {@inheritdoc} - */ - public function __construct($message = 'Key generator did not return a key.', $code = 0, \Exception $previous = null) - { - parent::__construct($message, $code, $previous); - } -} diff --git a/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/Exception/InvalidCacheLifetimeException.php b/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/Exception/InvalidCacheLifetimeException.php deleted file mode 100644 index e780355..0000000 --- a/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/Exception/InvalidCacheLifetimeException.php +++ /dev/null @@ -1,23 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Asm89\Twig\CacheExtension\Exception; - -class InvalidCacheLifetimeException extends BaseException -{ - /** - * {@inheritdoc} - */ - public function __construct($lifetime, $code = 0, \Exception $previous = null) - { - parent::__construct(sprintf('Value "%s" is not a valid lifetime.', gettype($lifetime)), $code, $previous); - } -} diff --git a/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/Exception/NonExistingStrategyException.php b/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/Exception/NonExistingStrategyException.php deleted file mode 100644 index c4ea6f6..0000000 --- a/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/Exception/NonExistingStrategyException.php +++ /dev/null @@ -1,23 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Asm89\Twig\CacheExtension\Exception; - -class NonExistingStrategyException extends BaseException -{ - /** - * {@inheritdoc} - */ - public function __construct($strategyKey, $code = 0, \Exception $previous = null) - { - parent::__construct(sprintf('No strategy configured with key "%s".', $strategyKey), $code, $previous); - } -} diff --git a/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/Exception/NonExistingStrategyKeyException.php b/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/Exception/NonExistingStrategyKeyException.php deleted file mode 100644 index eef30a7..0000000 --- a/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/Exception/NonExistingStrategyKeyException.php +++ /dev/null @@ -1,23 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Asm89\Twig\CacheExtension\Exception; - -class NonExistingStrategyKeyException extends BaseException -{ - /** - * {@inheritdoc} - */ - public function __construct($message = 'No strategy key found in value.', $code = 0, \Exception $previous = null) - { - parent::__construct($message, $code, $previous); - } -} diff --git a/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/Extension.php b/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/Extension.php deleted file mode 100644 index b7c653b..0000000 --- a/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/Extension.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 Asm89\Twig\CacheExtension; - -/** - * Extension for caching template blocks with twig. - * - * @author Alexander - */ -class Extension extends \Twig_Extension -{ - private $cacheStrategy; - - /** - * @param CacheStrategyInterface $cacheStrategy - */ - public function __construct(CacheStrategyInterface $cacheStrategy) - { - $this->cacheStrategy = $cacheStrategy; - } - - /** - * @return CacheStrategyInterface - */ - public function getCacheStrategy() - { - return $this->cacheStrategy; - } - - /** - * {@inheritDoc} - */ - public function getName() - { - if (version_compare(\Twig_Environment::VERSION, '1.26.0', '>=')) { - return __CLASS__; - } - return 'asm89_cache'; - } - - /** - * {@inheritDoc} - */ - public function getTokenParsers() - { - return array( - new TokenParser\Cache(), - ); - } -} diff --git a/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/Node/CacheNode.php b/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/Node/CacheNode.php deleted file mode 100644 index 2597289..0000000 --- a/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/Node/CacheNode.php +++ /dev/null @@ -1,71 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Asm89\Twig\CacheExtension\Node; - -/** - * Cache twig node. - * - * @author Alexander - */ -class CacheNode extends \Twig_Node -{ - private static $cacheCount = 1; - - /** - * @param \Twig_Node_Expression $annotation - * @param \Twig_Node_Expression $keyInfo - * @param \Twig_NodeInterface $body - * @param integer $lineno - * @param string $tag - */ - public function __construct(\Twig_Node_Expression $annotation, \Twig_Node_Expression $keyInfo, \Twig_Node $body, $lineno, $tag = null) - { - parent::__construct(array('key_info' => $keyInfo, 'body' => $body, 'annotation' => $annotation), array(), $lineno, $tag); - } - - /** - * {@inheritDoc} - */ - public function compile(\Twig_Compiler $compiler) - { - $i = self::$cacheCount++; - - if (version_compare(\Twig_Environment::VERSION, '1.26.0', '>=')) { - $extension = 'Asm89\Twig\CacheExtension\Extension'; - } else { - $extension = 'asm89_cache'; - } - - $compiler - ->addDebugInfo($this) - ->write("\$asm89CacheStrategy".$i." = \$this->env->getExtension('{$extension}')->getCacheStrategy();\n") - ->write("\$asm89Key".$i." = \$asm89CacheStrategy".$i."->generateKey(") - ->subcompile($this->getNode('annotation')) - ->raw(", ") - ->subcompile($this->getNode('key_info')) - ->write(");\n") - ->write("\$asm89CacheBody".$i." = \$asm89CacheStrategy".$i."->fetchBlock(\$asm89Key".$i.");\n") - ->write("if (\$asm89CacheBody".$i." === false) {\n") - ->indent() - ->write("ob_start();\n") - ->indent() - ->subcompile($this->getNode('body')) - ->outdent() - ->write("\n") - ->write("\$asm89CacheBody".$i." = ob_get_clean();\n") - ->write("\$asm89CacheStrategy".$i."->saveBlock(\$asm89Key".$i.", \$asm89CacheBody".$i.");\n") - ->outdent() - ->write("}\n") - ->write("echo \$asm89CacheBody".$i.";\n") - ; - } -} diff --git a/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/TokenParser/Cache.php b/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/TokenParser/Cache.php deleted file mode 100644 index 3d45a66..0000000 --- a/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/TokenParser/Cache.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 Asm89\Twig\CacheExtension\TokenParser; - -use Asm89\Twig\CacheExtension\Node\CacheNode; - -/** - * Parser for cache/endcache blocks. - * - * @author Alexander - */ -class Cache extends \Twig_TokenParser -{ - /** - * @param \Twig_Token $token - * - * @return boolean - */ - public function decideCacheEnd(\Twig_Token $token) - { - return $token->test('endcache'); - } - - /** - * {@inheritDoc} - */ - public function getTag() - { - return 'cache'; - } - - /** - * {@inheritDoc} - */ - public function parse(\Twig_Token $token) - { - $lineno = $token->getLine(); - $stream = $this->parser->getStream(); - - $annotation = $this->parser->getExpressionParser()->parseExpression(); - - $key = $this->parser->getExpressionParser()->parseExpression(); - - $stream->expect(\Twig_Token::BLOCK_END_TYPE); - $body = $this->parser->subparse(array($this, 'decideCacheEnd'), true); - $stream->expect(\Twig_Token::BLOCK_END_TYPE); - - return new CacheNode($annotation, $key, $body, $lineno, $this->getTag()); - } -} diff --git a/vendor/asm89/twig-cache-extension/phpunit.xml.dist b/vendor/asm89/twig-cache-extension/phpunit.xml.dist deleted file mode 100644 index 888e305..0000000 --- a/vendor/asm89/twig-cache-extension/phpunit.xml.dist +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - ./test/Asm89/ - - - - - - ./lib/ - - - diff --git a/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/CacheProvider/DoctrineCacheAdapterTest.php b/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/CacheProvider/DoctrineCacheAdapterTest.php deleted file mode 100644 index bea9851..0000000 --- a/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/CacheProvider/DoctrineCacheAdapterTest.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 Asm89\Twig\CacheExtension\Tests\CacheProvider; - -use Asm89\Twig\CacheExtension\CacheProvider\DoctrineCacheAdapter; - -class DoctrineCacheAdapterTest extends \PHPUnit_Framework_TestCase -{ - public function testFetch() - { - $cacheMock = $this->createCacheMock(); - $cacheMock->expects($this->any()) - ->method('fetch') - ->will($this->returnValue('fromcache')); - - $cache = new DoctrineCacheAdapter($cacheMock); - - $this->assertEquals('fromcache', $cache->fetch('test')); - } - - public function testSave() - { - $cacheMock = $this->createCacheMock(); - $cacheMock->expects($this->once()) - ->method('save') - ->with('key', 'value', 42); - - $cache = new DoctrineCacheAdapter($cacheMock); - - $cache->save('key', 'value', 42); - } - - public function createCacheMock() - { - return $this->createMock('Doctrine\Common\Cache\Cache'); - } -} diff --git a/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/CacheStrategy/GenerationCacheStrategyTest.php b/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/CacheStrategy/GenerationCacheStrategyTest.php deleted file mode 100644 index d74ecde..0000000 --- a/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/CacheStrategy/GenerationCacheStrategyTest.php +++ /dev/null @@ -1,80 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Asm89\Twig\CacheExtension\Tests\CacheStrategy; - -use Asm89\Twig\CacheExtension\CacheStrategy\GenerationalCacheStrategy; - -class GenerationalCacheStrategyTest extends \PHPUnit_Framework_TestCase -{ - private $keyGeneratorMock; - private $cacheProviderMock; - - public function createCacheStrategy($lifetime = 0) - { - $this->keyGeneratorMock = $this->createKeyGeneratorMock(); - $this->cacheProviderMock = $this->createCacheProviderMock(); - - return new GenerationalCacheStrategy($this->cacheProviderMock, $this->keyGeneratorMock, $lifetime); - } - - public function testGenerateKeyContainsAnnotation() - { - $strategy = $this->createCacheStrategy(); - $this->keyGeneratorMock->expects($this->any()) - ->method('generateKey') - ->will($this->returnValue('foo')); - - $this->assertEquals('v42__GCS__foo', $strategy->generateKey('v42', 'value')); - } - - /** - * @expectedException \Asm89\Twig\CacheExtension\Exception\InvalidCacheKeyException - */ - public function testGenerationKeyThrowsExceptionWhenKeyGeneratorReturnsNull() - { - $strategy = $this->createCacheStrategy(); - - $strategy->generateKey('v42', 'value'); - } - - /** - * @dataProvider getLifeTimes - */ - public function testSaveBlockUsesConfiguredLifetime($lifetime) - { - $strategy = $this->createCacheStrategy($lifetime); - $this->cacheProviderMock->expects($this->any()) - ->method('save') - ->with('key', 'value', $lifetime) - ->will($this->returnValue('foo')); - - $strategy->saveBlock('key', 'value'); - } - - public function getLifetimes() - { - return array( - array(0), - array(60), - ); - } - - public function createKeyGeneratorMock() - { - return $this->createMock('Asm89\Twig\CacheExtension\CacheStrategy\KeyGeneratorInterface'); - } - - public function createCacheProviderMock() - { - return $this->createMock('Asm89\Twig\CacheExtension\CacheProviderInterface'); - } -} diff --git a/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/CacheStrategy/IndexedChainingCacheStrategyTest.php b/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/CacheStrategy/IndexedChainingCacheStrategyTest.php deleted file mode 100644 index 480a0b1..0000000 --- a/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/CacheStrategy/IndexedChainingCacheStrategyTest.php +++ /dev/null @@ -1,80 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Asm89\Twig\CacheExtension\Tests\CacheStrategy; - -use Asm89\Twig\CacheExtension\CacheStrategy\IndexedChainingCacheStrategy; - -class IndexedChainingCacheStrategyTest extends \PHPUnit_Framework_TestCase -{ - private $cacheStrategyMocks = array(); - - public function createCacheStrategy() - { - foreach($this->getStrategies() as $config) { - list($key, $return) = $config; - - $cacheStrategyMock = $this->createCacheStrategyMock(); - $cacheStrategyMock->expects($this->any()) - ->method('generateKey') - ->will($this->returnValue($return)); - - $this->cacheStrategyMocks[$key] = $cacheStrategyMock; - } - - return new IndexedChainingCacheStrategy($this->cacheStrategyMocks); - } - - /** - * @dataProvider getStrategies - */ - public function testGenerateKeyProxiesToAppropriateStrategy($key, $return) - { - $strategy = $this->createCacheStrategy(); - - $generatedKey = $strategy->generateKey('v42', array($key => 'proxied_value')); - - $this->assertEquals($return, $generatedKey['key']); - $this->assertEquals($key, $generatedKey['strategyKey']); - } - - /** - * @expectedException \Asm89\Twig\CacheExtension\Exception\NonExistingStrategyKeyException - */ - public function testGenerateKeyThrowsExceptionOnMissingKey() - { - $strategy = $this->createCacheStrategy(); - $strategy->generateKey('v42', 'proxied_value'); - } - - /** - * @expectedException \Asm89\Twig\CacheExtension\Exception\NonExistingStrategyException - * @expectedExceptionMessage No strategy configured with key "unknown" - */ - public function testGenerateKeyThrowsExceptionOnUnknownKey() - { - $strategy = $this->createCacheStrategy(); - $strategy->generateKey('v42', array('unknown' => 'proxied_value')); - } - - public function getStrategies() - { - return array( - array('foo', 'foo_key'), - array('bar', 'bar_key'), - ); - } - - public function createCacheStrategyMock() - { - return $this->createMock('Asm89\Twig\CacheExtension\CacheStrategyInterface'); - } -} diff --git a/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/CacheStrategy/LifetimeCacheStrategyTest.php b/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/CacheStrategy/LifetimeCacheStrategyTest.php deleted file mode 100644 index 10d1a86..0000000 --- a/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/CacheStrategy/LifetimeCacheStrategyTest.php +++ /dev/null @@ -1,68 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Asm89\Twig\CacheExtension\Tests\CacheStrategy; - -use Asm89\Twig\CacheExtension\CacheStrategy\LifetimeCacheStrategy; - -class LifetimeCacheStrategyTest extends \PHPUnit_Framework_TestCase -{ - private $cacheProviderMock; - - public function createCacheStrategy() - { - $this->cacheProviderMock = $this->createCacheProviderMock(); - - return new LifetimeCacheStrategy($this->cacheProviderMock); - } - - public function testGenerateKeyUsesGivenLifetime() - { - $strategy = $this->createCacheStrategy(); - - $key = $strategy->generateKey('v42', 42); - - $this->assertEquals(42, $key['lifetime']); - } - - public function testGenerateKeyAnnotatesKey() - { - $strategy = $this->createCacheStrategy(); - - $key = $strategy->generateKey('the_annotation', 42); - - $this->assertContains('the_annotation', $key['key']); - } - - /** - * @dataProvider getInvalidLifetimeValues - * @expectedException \Asm89\Twig\CacheExtension\Exception\InvalidCacheLifetimeException - */ - public function testGenerateKeyThrowsExceptionWhenNoLifetimeProvided($value) - { - $strategy = $this->createCacheStrategy(); - - $strategy->generateKey('v42', $value); - } - - public function getInvalidLifetimeValues() - { - return array( - array('foo'), - array(array('foo')), - ); - } - - public function createCacheProviderMock() - { - return $this->createMock('Asm89\Twig\CacheExtension\CacheProviderInterface'); - } -} diff --git a/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/FunctionalExtensionTest.php b/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/FunctionalExtensionTest.php deleted file mode 100644 index 77a58e6..0000000 --- a/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/FunctionalExtensionTest.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 Asm89\Twig\CacheExtension\Tests; - -use Asm89\Twig\CacheExtension\CacheProvider\DoctrineCacheAdapter; -use Asm89\Twig\CacheExtension\CacheStrategy\KeyGeneratorInterface; -use Asm89\Twig\CacheExtension\CacheStrategy\GenerationalCacheStrategy; -use Asm89\Twig\CacheExtension\CacheStrategy\IndexedChainingCacheStrategy; -use Asm89\Twig\CacheExtension\CacheStrategy\LifetimeCacheStrategy; -use Asm89\Twig\CacheExtension\Extension; -use Doctrine\Common\Cache\ArrayCache; -use Twig_Loader_Filesystem; -use Twig_Environment; - -class FunctionalExtensionTest extends \PHPUnit_Framework_TestCase -{ - private $cache; - - protected function createCacheProvider() - { - $this->cache = new ArrayCache(); - - return new DoctrineCacheAdapter($this->cache); - } - - protected function createCacheStrategy($name = null) - { - $cacheProvider = $this->createCacheProvider(); - $keyGenerator = $this->createKeyGenerator(); - $lifetime = 0; - - switch ($name) { - case 'time': - return new LifetimeCacheStrategy($cacheProvider); - case 'indexed': - return new IndexedChainingCacheStrategy(array( - 'gcs' => new GenerationalCacheStrategy($cacheProvider, $keyGenerator, $lifetime), - 'time' => new LifetimeCacheStrategy($cacheProvider), - )); - default: - return new GenerationalCacheStrategy($cacheProvider, $keyGenerator, $lifetime); - } - } - - protected function createKeyGenerator() - { - return new KeyGenerator(); - } - - protected function createTwig($cacheStrategyName = null) - { - $loader = new Twig_Loader_Filesystem(__DIR__ . '/fixtures/'); - $twig = new Twig_Environment($loader); - - $cacheExtension = new Extension($this->createCacheStrategy($cacheStrategyName)); - - $twig->addExtension($cacheExtension); - - return $twig; - } - - protected function getValue($value, $updatedAt) - { - return new Value($value, $updatedAt); - } - - public function testCachesWithSameCacheKey() - { - $twig = $this->createTwig(); - - $rendered = $twig->render('gcs_value.twig', array('value' => $this->getValue('asm89', 1))); - $this->assertEquals('Hello asm89!', $rendered); - - $rendered2 = $twig->render('gcs_value.twig', array('value' => $this->getValue('fabpot', 1))); - $this->assertEquals('Hello asm89!', $rendered2); - } - - public function testDifferentCacheOnDifferentAnnotation() - { - $twig = $this->createTwig(); - - $rendered = $twig->render('gcs_value.twig', array('value' => $this->getValue('asm89', 1))); - $this->assertEquals('Hello asm89!', $rendered); - - $rendered2 = $twig->render('gcs_value.twig', array('value' => $this->getValue('fabpot', 1))); - $this->assertEquals('Hello asm89!', $rendered2); - - $rendered3 = $twig->render('gcs_value_v2.twig', array('value' => $this->getValue('fabpot', 1))); - $this->assertEquals('Hello fabpot!', $rendered3); - } - - public function testLifetimeCacheStrategy() - { - $twig = $this->createTwig('time'); - - $rendered = $twig->render('lcs_value.twig', array('value' => $this->getValue('asm89', 1))); - $this->assertEquals('Hello asm89!', $rendered); - - $rendered2 = $twig->render('lcs_value.twig', array('value' => $this->getValue('fabpot', 1))); - $this->assertEquals('Hello asm89!', $rendered2); - - $this->cache->flushAll(); - - $rendered3 = $twig->render('lcs_value.twig', array('value' => $this->getValue('fabpot', 1))); - $this->assertEquals('Hello fabpot!', $rendered3); - } - - public function testIndexedChainingStrategy() - { - $twig = $this->createTwig('indexed'); - - $rendered = $twig->render('ics_value.twig', array('value' => $this->getValue('asm89', 1))); - $this->assertEquals('Hello asm89!', $rendered); - - $rendered2 = $twig->render('ics_value.twig', array('value' => $this->getValue('fabpot', 1))); - $this->assertEquals('Hello asm89!', $rendered2); - - $this->cache->flushAll(); - - $rendered3 = $twig->render('ics_value.twig', array('value' => $this->getValue('fabpot', 1))); - $this->assertEquals('Hello fabpot!', $rendered3); - } - - /** - * @expectedException Twig_Error_Runtime - * @expectedExceptionMessage An exception has been thrown during the rendering of a template ("No strategy key found in value.") - */ - public function testIndexedChainingStrategyNeedsKey() - { - $twig = $this->createTwig('indexed'); - - $twig->render('ics_no_key.twig', array('value' => $this->getValue('asm89', 1))); - } - - public function testAnnotationExpression() - { - $twig = $this->createTwig('indexed'); - - $rendered = $twig->render('annotation_expression.twig', array('value' => $this->getValue('asm89', 1), 'version' => 1)); - $this->assertEquals('Hello asm89!Hello asm89!', $rendered); - } -} - -class KeyGenerator implements KeyGeneratorInterface -{ - public function generateKey($value) - { - return get_class($value) . '_' . $value->getUpdatedAt(); - } - -} - -class Value -{ - private $value; - private $updatedAt; - - public function __construct($value, $updatedAt) - { - $this->value = $value; - $this->updatedAt = $updatedAt; - } - - public function getUpdatedAt() - { - return $this->updatedAt; - } - - public function __toString() - { - return $this->value; - } -} diff --git a/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/fixtures/annotation_expression.twig b/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/fixtures/annotation_expression.twig deleted file mode 100644 index 8f4587b..0000000 --- a/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/fixtures/annotation_expression.twig +++ /dev/null @@ -1,3 +0,0 @@ -{%- set k = "v'" ~ version -%} -{%- cache k {time: 10} -%}Hello {{ value }}!{%- endcache -%} -{%- cache 'bob'|capitalize {gcs: value} %}Hello {{ value }}!{%- endcache -%} diff --git a/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/fixtures/annotation_not_string.twig b/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/fixtures/annotation_not_string.twig deleted file mode 100644 index d962ded..0000000 --- a/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/fixtures/annotation_not_string.twig +++ /dev/null @@ -1,2 +0,0 @@ -{% set annotation = 'v1' %} -{% cache annotation value %}Hello {{ value }}!{% endcache %} diff --git a/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/fixtures/gcs_value.twig b/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/fixtures/gcs_value.twig deleted file mode 100644 index 59a39bf..0000000 --- a/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/fixtures/gcs_value.twig +++ /dev/null @@ -1 +0,0 @@ -{% cache 'v1' value %}Hello {{ value }}!{% endcache %} diff --git a/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/fixtures/gcs_value_v2.twig b/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/fixtures/gcs_value_v2.twig deleted file mode 100644 index e728117..0000000 --- a/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/fixtures/gcs_value_v2.twig +++ /dev/null @@ -1 +0,0 @@ -{% cache 'v2' value %}Hello {{ value }}!{% endcache %} diff --git a/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/fixtures/ics_no_key.twig b/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/fixtures/ics_no_key.twig deleted file mode 100644 index 12b924b..0000000 --- a/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/fixtures/ics_no_key.twig +++ /dev/null @@ -1 +0,0 @@ -{% cache 'v1' 10 %}Hello {{ value }}!{% endcache %} diff --git a/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/fixtures/ics_value.twig b/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/fixtures/ics_value.twig deleted file mode 100644 index efc52ea..0000000 --- a/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/fixtures/ics_value.twig +++ /dev/null @@ -1 +0,0 @@ -{% cache 'v1' {time: 10} %}Hello {{ value }}!{% endcache %} diff --git a/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/fixtures/lcs_value.twig b/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/fixtures/lcs_value.twig deleted file mode 100644 index 12b924b..0000000 --- a/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/fixtures/lcs_value.twig +++ /dev/null @@ -1 +0,0 @@ -{% cache 'v1' 10 %}Hello {{ value }}!{% endcache %} diff --git a/vendor/asm89/twig-cache-extension/test/bootstrap.php b/vendor/asm89/twig-cache-extension/test/bootstrap.php deleted file mode 100644 index d456719..0000000 --- a/vendor/asm89/twig-cache-extension/test/bootstrap.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 (file_exists($file = __DIR__.'/../vendor/autoload.php')) { - $autoload = require_once $file; -} else { - throw new RuntimeException('Install dependencies to run test suite.'); -} diff --git a/vendor/aura/intl/.scrutinizer.yml b/vendor/aura/intl/.scrutinizer.yml deleted file mode 100644 index 7c7c845..0000000 --- a/vendor/aura/intl/.scrutinizer.yml +++ /dev/null @@ -1,10 +0,0 @@ -filter: - paths: ["src/*"] -tools: - external_code_coverage: true - php_code_coverage: true - php_sim: true - php_mess_detector: true - php_pdepend: true - php_analyzer: true - php_cpd: true diff --git a/vendor/aura/intl/.travis.yml b/vendor/aura/intl/.travis.yml deleted file mode 100644 index 823c704..0000000 --- a/vendor/aura/intl/.travis.yml +++ /dev/null @@ -1,14 +0,0 @@ -sudo: false -language: php -php: - - 5.6 - - hhvm - - 7 -before_script: - - composer self-update - - composer install -script: - - phpunit --coverage-clover=coverage.clover -after_script: - - wget https://scrutinizer-ci.com/ocular.phar - - php ocular.phar code-coverage:upload --format=php-clover coverage.clover diff --git a/vendor/aura/intl/CHANGELOG.md b/vendor/aura/intl/CHANGELOG.md deleted file mode 100644 index 12e8990..0000000 --- a/vendor/aura/intl/CHANGELOG.md +++ /dev/null @@ -1,66 +0,0 @@ -# CHANGELOG - -## 3.0.0 - -- Final release. No changes after first beta. - -## 3.0.0-beta1 - -- Removed `aura/installer-default` from composer.json which was used by aura framework version 1 to install in package folder. -- Fixes [issue 17](https://github.com/auraphp/Aura.Intl/issues/17) by removing Aura.Di wiring trait tests. -- Changed directory structure from PSR-0 to PSR-4. -- Supported PHP version : 5.6+. -- There is no other BC breaks from 1.x version - - -## 1.1.1 - -Hygiene release: Composer update. - -## 1.1.0 - -- Merge pull request #11 from lorenzo/feature/format-key. If Translator::translate() cannot translate, it now returns the incoming translation key as the translated message. This makes it easier to use the key as a human readable string, which can contain formatting placeholders. With this feature the developer will be able to see immediate feedback of their translation messages without having to translate to a specific locale beforehand. - -## 1.0.1 - -Hygiene release. - -- Merge pull request #10 from harikt/fixdoc; fixes #9, add a test for failure. The expected exception need to be fixed. - -- Merge pull request #8 from harikt/v2config, adding v2 config files. - -- Merge pull request #7 from harikt/issue6, add a test to show it works. Thank you @samdark. - -- Point travis status badge to develop branch - -## 1.0.0 - -- [CHG] When interpolating array values into strings, now converts the array - to comma-separated values instead of printing 'Array'. - -- [DOC] PHP 5.5 appears to be able to format strings with missing token - replacements; updated tests to account for this. - -## 1.0.0-beta2 - -- [FIX] Multiple typo fixes; thanks, @pborreli. - -- [CHG] Use {foo} instead of {:foo} in line with PSR-3 placeholders. - -- [NEW] Add a PackageFactory - -- [NEW] Add more-detailed exception classes - -- [ADD] In config, add 'intl_package_factory' as a service - -- [CHG] Throw IcuVersionTooLow Exception if IntlFormatter is instantiated with - ICU Version lower than 4.8; Skip all IntlFormatter tests if the intl - extension is not loaded. Thanks, @mapthegod. - -- [CHG] In the FormatterLocator, registry entries *must* be wrapped in a - callable from now on. - - -## 1.0.0-beta1 - -Initial release. diff --git a/vendor/aura/intl/CONTRIBUTING.md b/vendor/aura/intl/CONTRIBUTING.md deleted file mode 100644 index b68f9b8..0000000 --- a/vendor/aura/intl/CONTRIBUTING.md +++ /dev/null @@ -1,7 +0,0 @@ -# Contributing - -We are happy to review any contributions you want to make. When contributing, please follow the rules outlined at . - -The time between submitting a contribution and its review one may be extensive; do not be discouraged if there is not immediate feedback. - -Thanks! diff --git a/vendor/aura/intl/LICENSE b/vendor/aura/intl/LICENSE deleted file mode 100644 index 5f5f3b6..0000000 --- a/vendor/aura/intl/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2017, Aura for PHP - -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/vendor/aura/intl/README.md b/vendor/aura/intl/README.md deleted file mode 100644 index 0537d47..0000000 --- a/vendor/aura/intl/README.md +++ /dev/null @@ -1,59 +0,0 @@ -# Aura.Intl - -The Aura.Intl package provides internationalization (I18N) tools, specifically -package-oriented per-locale message translation. - -## Installation and Autoloading - -This package is installable and PSR-4 autoloadable via Composer as -[aura/intl][]. - -Alternatively, [download a release][], or clone this repository, then map the -`Aura\Intl\` namespace to the package `src/` directory. - -## Dependencies - -This package requires PHP 5.6 or later; it has been tested on PHP 5.6, 7.0 -and HHVM. We recommend using the latest available version of PHP as a matter of -principle. - -Aura library packages may sometimes depend on external interfaces, but never on -external implementations. This allows compliance with community standards -without compromising flexibility. For specifics, please examine the package -[composer.json][] file. - -## Quality - -[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/auraphp/Aura.Intl/badges/quality-score.png?b=3.x)](https://scrutinizer-ci.com/g/auraphp/Aura.Intl/) -[![Code Coverage](https://scrutinizer-ci.com/g/auraphp/Aura.Intl/badges/coverage.png?b=3.x)](https://scrutinizer-ci.com/g/auraphp/Aura.Intl/) -[![Build Status](https://travis-ci.org/auraphp/Aura.Intl.png?branch=3.x)](https://travis-ci.org/auraphp/Aura.Intl) - -This project adheres to [Semantic Versioning](http://semver.org/). - -To run the unit tests at the command line, issue `composer install` and then -`phpunit` at the package root. This requires [Composer][] to be available as -`composer`, and [PHPUnit][] to be available as `phpunit`. - -This package attempts to comply with [PSR-1][], [PSR-2][], and [PSR-4][]. If -you notice compliance oversights, please send a patch via pull request. - -## Community - -To ask questions, provide feedback, or otherwise communicate with other Aura -users, please join our [Google Group][], follow [@auraphp][], or chat with us -on Freenode in the #auraphp channel. - -## Documentation - -This package is fully documented [here](./docs/index.md). - -[PSR-1]: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-1-basic-coding-standard.md -[PSR-2]: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md -[PSR-4]: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-4-autoloader.md -[Composer]: http://getcomposer.org/ -[PHPUnit]: http://phpunit.de/ -[Google Group]: http://groups.google.com/group/auraphp -[@auraphp]: http://twitter.com/auraphp -[download a release]: https://github.com/auraphp/Aura.Intl/releases -[aura/intl]: https://packagist.org/packages/aura/intl -[composer.json]: ./composer.json diff --git a/vendor/aura/intl/composer.json b/vendor/aura/intl/composer.json deleted file mode 100644 index 6366d0a..0000000 --- a/vendor/aura/intl/composer.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "aura/intl", - "type": "library", - "description": "The Aura Intl package provides internationalization tools, specifically message translation.", - "keywords": [ - "intl", - "internationalization", - "i18n", - "l10n", - "localization", - "globalization", - "g11n" - ], - "homepage": "https://github.com/auraphp/Aura.Intl", - "license": "MIT", - "authors": [ - { - "name": "Aura.Intl Contributors", - "homepage": "https://github.com/auraphp/Aura.Intl/contributors" - } - ], - "require": { - "php": "^5.6|^7.0" - }, - "autoload": { - "psr-4": { - "Aura\\Intl\\": "src/" - } - }, - "autoload-dev": { - "psr-4": { - "Aura\\Intl\\": "tests/" - } - } -} diff --git a/vendor/aura/intl/docs/index.md b/vendor/aura/intl/docs/index.md deleted file mode 100644 index f097c5f..0000000 --- a/vendor/aura/intl/docs/index.md +++ /dev/null @@ -1,218 +0,0 @@ -# Aura.Intl - -The Aura.Intl package provides internationalization (I18N) tools, specifically -package-oriented per-locale message translation. - -## Getting Started - -You can instantiate _TranslatorLocator_ object from _TranslatorLocatorFactory_ -as below - -```php -newInstance(); -?> -``` - -Alternatively, we can add the Aura.Intl package `/path/to/Aura.Intl/src` to -our autoloader and build a translator locator manually: - -```php - function () { return new \Aura\Intl\BasicFormatter; }, - 'intl' => function () { return new \Aura\Intl\IntlFormatter; }, - ]), - new TranslatorFactory, - 'en_US' -); -?> -``` - -## Setting Localized Messages For A Package - -We can set localized messages for a package through the `PackageLocator` object -from the translator locator. We create a new `Package` with messages and place -it into the locator as a callable. The messages take the form of a message key and -and message string. - -```php -getPackages(); - -// place into the locator for Vendor.Package -$packages->set('Vendor.Package', 'en_US', function() { - // create a US English message set - $package = new Package; - $package->setMessages([ - 'FOO' => 'The text for "foo."', - 'BAR' => 'The text for "bar."', - ]); - return $package; -}); - -// place into the locator for a Vendor.Package -$packages->set('Vendor.Package', 'pt_BR', function() { - // a Brazilian Portuguese message set - $package = new Package; - $package->setMessages([ - 'FOO' => 'O texto de "foo".', - 'BAR' => 'O texto de "bar".', - ]); - return $package; -}); -?> -``` - - -## Setting The Default Locale - -We can set the default locale for translations using the `setLocale()` method: - -```php -setLocale('pt_BR'); -?> -``` - -## Getting A Localized Message - -Now that the translator locator has messages and a default locale, we can get -an individual package translator. The package translator is suitable for -injection into another class, or for standalone use. - -```php -get('Vendor.Package'); -echo $translator->translate('FOO'); // 'O texto de "foo".' -?> -``` - -You can get a translator for a non-default locale as well: - -```php -get('Vendor.Package', 'en_US'); -echo $translator->translate('FOO'); // 'The text for "foo."' -?> -``` - - -## Replacing Message Tokens With Values - -We often need to use dynamic values in translated messages. First, the -message string needs to have a token placeholder for the dynamic value: - -```php -getPackages(); - -$packages->set('Vendor.Dynamic', 'en_US', function() { - - // US English messages - $package = new Package; - $package->setMessages([ - 'PAGE' => 'Page {page} of {pages} pages.', - ]); - return $package; -}); - -$packages->set('Vendor.Dynamic', 'pt_BR', function() { - // Brazilian Portuguese messages - $package = new Package; - $package->setMessages([ - 'PAGE' => 'Página {page} de {pages} páginas.', - ]); - return $package; -}); -?> -``` - -Then, when we translate the message, we provide an array of tokens and -replacement values. These will be interpolated into the message string. - -```php -get('Vendor.Dynamic'); -echo $translator->translate('PAGE', [ - 'page' => 1, - 'pages' => 1, -]); // 'Página 1 de 1 páginas.' -?> -``` - -## Pluralized Messages - -Usually, we need to use different messages when a value is singular or plural. -The `BasicFormatter` is not capable of presenting different messages based on -different token values. The `IntlFormatter` *is* capable, but the PHP -[`intl`](http://php.net/intl) extension must be loaded to take advantage of -it, and we must specify the `'intl'` formatter for the package in the catalog. - -When using the `IntlFormatter`, we can build our message strings to present -singular or plural messages, as in the following example: - -```php -getCatalog(); - -// get the Vendor.Dynamic package en_US locale and set -// US English messages with pluralization. note the use -// of # instead of {pages} herein; using the placeholder -// "inside itself" with the Intl formatter causes trouble. -$package->setMessages([ - 'PAGE' => '{pages,plural,' - . '=0{No pages.}' - . '=1{One page only.}' - . 'other{Page {page} of # pages.}' - . '}' -]); - -// use the 'intl' formatter for this package and locale -$package->setFormatter('intl'); - -// now that we have added the pluralizable messages, -// get the US English translator for the package -$translator = $translators->get('Vendor.Dynamic', 'en_US'); - -// zero translation -echo $translator->translate('PAGE', [ - 'page' => 0, - 'pages' => 0, -]); // 'No pages.' - -// singular translation -echo $translator->translate('PAGE', [ - 'page' => 1, - 'pages' => 1, -]); // 'One page only.' - -// plural translation -echo $translator->translate('PAGE', [ - 'page' => 3, - 'pages' => 10, -]); // 'Page 3 of 10 pages.' -?> -``` - -Note that you can use other tokens within a pluralized token string to build -more complex messages. For more information, see the following: - - diff --git a/vendor/aura/intl/phpunit.php b/vendor/aura/intl/phpunit.php deleted file mode 100644 index ceaada7..0000000 --- a/vendor/aura/intl/phpunit.php +++ /dev/null @@ -1,9 +0,0 @@ - - - - ./tests - - - - - ./src/ - - - diff --git a/vendor/aura/intl/src/BasicFormatter.php b/vendor/aura/intl/src/BasicFormatter.php deleted file mode 100644 index 2d02a77..0000000 --- a/vendor/aura/intl/src/BasicFormatter.php +++ /dev/null @@ -1,47 +0,0 @@ - $value) { - // convert an array to a CSV string - if (is_array($value)) { - $value = '"' . implode('", "', $value) . '"'; - } - $replace['{' . $token . '}'] = $value; - } - return strtr($string, $replace); - } -} diff --git a/vendor/aura/intl/src/Exception.php b/vendor/aura/intl/src/Exception.php deleted file mode 100644 index c869805..0000000 --- a/vendor/aura/intl/src/Exception.php +++ /dev/null @@ -1,22 +0,0 @@ - $spec) { - $this->set($name, $spec); - } - } - - /** - * - * Sets a formatter into the registry by name. - * - * @param string $name The formatter name. - * - * @param callable $spec A callable that returns a formatter object. - * - * @return void - * - */ - public function set($name, $spec) - { - $this->registry[$name] = $spec; - $this->converted[$name] = false; - } - - /** - * - * Gets a formatter from the registry by name. - * - * @param string $name The formatter to retrieve. - * - * @return FormatterInterface A formatter object. - * - * @throws Exception\FormatterNotMapped - * - */ - public function get($name) - { - if (! isset($this->registry[$name])) { - throw new Exception\FormatterNotMapped($name); - } - - if (! $this->converted[$name]) { - $func = $this->registry[$name]; - $this->registry[$name] = $func(); - $this->converted[$name] = true; - } - - return $this->registry[$name]; - } -} diff --git a/vendor/aura/intl/src/IntlFormatter.php b/vendor/aura/intl/src/IntlFormatter.php deleted file mode 100644 index 719d6f9..0000000 --- a/vendor/aura/intl/src/IntlFormatter.php +++ /dev/null @@ -1,98 +0,0 @@ - $value) { - // convert an array to a CSV string - if (is_array($value)) { - $value = '"' . implode('", "', $value) . '"'; - } - - $values[$token] = $value; - } - - try { - $formatter = new MessageFormatter($locale, $string); - if (! $formatter) { - $this->throwCannotInstantiateFormatter(); - } - } catch (\Exception $e) { - $this->throwCannotInstantiateFormatter(); - } - - $result = $formatter->format($values); - if ($result === false) { - throw new Exception\CannotFormat( - $formatter->getErrorMessage(), - $formatter->getErrorCode() - ); - } - - return $result; - } - - /** - * - * Throws exception - * - * @throws Exception\CannotInstantiateFormatter - */ - protected function throwCannotInstantiateFormatter() - { - throw new Exception\CannotInstantiateFormatter( - intl_get_error_message(), - intl_get_error_code() - ); - } -} diff --git a/vendor/aura/intl/src/Package.php b/vendor/aura/intl/src/Package.php deleted file mode 100644 index b714e83..0000000 --- a/vendor/aura/intl/src/Package.php +++ /dev/null @@ -1,197 +0,0 @@ -formatter = $formatter; - $this->fallback = $fallback; - $this->messages = $messages; - } - - /** - * - * Sets the messages for this package. - * - * @param array $messages The messages for this package. - * - * @return void - * - */ - public function setMessages(array $messages) - { - $this->messages = $messages; - } - - /** - * - * Adds one message for this package. - * - * @param string $key the key of the message - * - * @param string $message the actual message - * - * @return void - * - */ - public function addMessage($key, $message) - { - $this->messages[$key] = $message; - } - - /** - * - * Adds new messages for this package. - * - * @param array $messages The messages to add in this package. - * - * @return void - * - */ - public function addMessages($messages) - { - $this->messages = array_merge($this->messages, $messages); - } - - /** - * - * Gets the messages for this package. - * - * @return array - * - */ - public function getMessages() - { - return $this->messages; - } - - - /** - * - * Gets the message of the given key for this package. - * - * @param string $key the key of the message to return - * - * @return mixed The message translation string, or false if not found. - * - */ - public function getMessage($key) - { - if (isset($this->messages[$key])) { - return $this->messages[$key]; - } - - return false; - } - - /** - * - * Sets the formatter name for this package. - * - * @param string $formatter The formatter name for this package. - * - * @return void - * - */ - public function setFormatter($formatter) - { - $this->formatter = $formatter; - } - - /** - * - * Gets the formatter name for this package. - * - * @return string - * - */ - public function getFormatter() - { - return $this->formatter; - } - - /** - * - * Sets the fallback package name. - * - * @param string $fallback The fallback package name. - * - * @return void - * - */ - public function setFallback($fallback) - { - $this->fallback = $fallback; - } - - /** - * - * Gets the fallback package name. - * - * @return string - * - */ - public function getFallback() - { - return $this->fallback; - } -} diff --git a/vendor/aura/intl/src/PackageFactory.php b/vendor/aura/intl/src/PackageFactory.php deleted file mode 100644 index a7a4a27..0000000 --- a/vendor/aura/intl/src/PackageFactory.php +++ /dev/null @@ -1,47 +0,0 @@ -setFallback($info['fallback']); - } - if (isset($info['formatter'])) { - $package->setFormatter($info['formatter']); - } - if (isset($info['messages'])) { - $package->setMessages($info['messages']); - } - return $package; - } -} diff --git a/vendor/aura/intl/src/PackageLocator.php b/vendor/aura/intl/src/PackageLocator.php deleted file mode 100644 index d719c37..0000000 --- a/vendor/aura/intl/src/PackageLocator.php +++ /dev/null @@ -1,107 +0,0 @@ - $locales) { - foreach ($locales as $locale => $spec) { - $this->set($name, $locale, $spec); - } - } - } - - /** - * - * Sets a Package object. - * - * @param string $name The package name. - * - * @param string $locale The locale for the package. - * - * @param callable $spec A callable that returns a package. - * - * @return void - * - */ - public function set($name, $locale, callable $spec) - { - $this->registry[$name][$locale] = $spec; - $this->converted[$name][$locale] = false; - } - - /** - * - * Gets a Package object. - * - * @param string $name The package name. - * - * @param string $locale The locale for the package. - * - * @return Package - * - */ - public function get($name, $locale) - { - if (! isset($this->registry[$name][$locale])) { - throw new Exception("Package '$name' with locale '$locale' is not registered."); - } - - if (! $this->converted[$name][$locale]) { - $func = $this->registry[$name][$locale]; - $this->registry[$name][$locale] = $func(); - $this->converted[$name][$locale] = true; - } - - return $this->registry[$name][$locale]; - } -} diff --git a/vendor/aura/intl/src/PackageLocatorInterface.php b/vendor/aura/intl/src/PackageLocatorInterface.php deleted file mode 100644 index e4b8532..0000000 --- a/vendor/aura/intl/src/PackageLocatorInterface.php +++ /dev/null @@ -1,49 +0,0 @@ -locale = $locale; - $this->package = $package; - $this->formatter = $formatter; - $this->fallback = $fallback; - } - - /** - * - * Gets the message translation by its key. - * - * @param string $key The message key. - * - * @return mixed The message translation string, or false if not found. - * - */ - protected function getMessage($key) - { - $message = $this->package->getMessage($key); - if ($message) { - return $message; - } - - if ($this->fallback) { - // get the message from the fallback translator - $message = $this->fallback->getMessage($key); - if ($message) { - // speed optimization: retain locally - $this->package->addMessage($key, $message); - // done! - return $message; - } - } - - // no local message, no fallback - return false; - } - - /** - * - * Translates the message indicated by they key, replacing token values - * along the way. - * - * @param string $key The message key. - * - * @param array $tokens_values Token values to interpolate into the - * message. - * - * @return string The translated message with tokens replaced. - * - */ - public function translate($key, array $tokens_values = []) - { - // get the message string - $message = $this->getMessage($key); - - // do we have a message string? - if (! $message) { - // no, return the message key as-is - $message = $key; - } - - // are there token replacement values? - if (empty($tokens_values)) { - // no, return the message string as-is - return $message; - } - - // run message string through formatter to replace tokens with values - return $this->formatter->format($this->locale, $message, $tokens_values); - } - - /** - * - * An object of type Package - * - * @return Package - * - */ - public function getPackage() - { - return $this->package; - } -} diff --git a/vendor/aura/intl/src/TranslatorFactory.php b/vendor/aura/intl/src/TranslatorFactory.php deleted file mode 100644 index 8cc5438..0000000 --- a/vendor/aura/intl/src/TranslatorFactory.php +++ /dev/null @@ -1,57 +0,0 @@ -class; - return new $class($locale, $package, $formatter, $fallback); - } -} diff --git a/vendor/aura/intl/src/TranslatorInterface.php b/vendor/aura/intl/src/TranslatorInterface.php deleted file mode 100644 index 8367a4c..0000000 --- a/vendor/aura/intl/src/TranslatorInterface.php +++ /dev/null @@ -1,32 +0,0 @@ -packages = $packages; - $this->factory = $factory; - $this->formatters = $formatters; - $this->setLocale($locale); - } - - /** - * - * Sets the default locale code. - * - * @param string $locale The new locale code. - * - * @return void - * - */ - public function setLocale($locale) - { - $this->locale = $locale; - } - - /** - * - * Returns the default locale code. - * - * @return string - * - */ - public function getLocale() - { - return $this->locale; - } - - /** - * - * The TranslatorFactory object - * - * @return TranslatorFactory - */ - public function getFactory() - { - return $this->factory; - } - - /** - * - * An object of type PackageLocator - * - * @return PackageLocator - * - */ - public function getPackages() - { - return $this->packages; - } - - /** - * - * An object of type FormatterLocator - * - * @return FormatterLocator - * - */ - public function getFormatters() - { - return $this->formatters; - } - - /** - * - * Gets a translator from the registry by package for a locale. - * - * @param string $name The translator package to retrieve. - * - * @param string $locale The locale to use; if empty, uses the default - * locale. - * - * @return TranslatorInterface A translator object. - * - */ - public function get($name, $locale = null) - { - if (! $name) { - return null; - } - - if (! $locale) { - $locale = $this->getLocale(); - } - - if (! isset($this->registry[$name][$locale])) { - - // get the package descriptor - $package = $this->packages->get($name, $locale); - - // build a translator; note the recursive nature of the - // 'fallback' param at the very end. - $translator = $this->factory->newInstance( - $locale, - $package, - $this->formatters->get($package->getFormatter()), - $this->get($package->getFallback(), $locale) - ); - - // retain in the registry - $this->registry[$name][$locale] = $translator; - } - - return $this->registry[$name][$locale]; - } -} diff --git a/vendor/aura/intl/src/TranslatorLocatorFactory.php b/vendor/aura/intl/src/TranslatorLocatorFactory.php deleted file mode 100644 index 907e60c..0000000 --- a/vendor/aura/intl/src/TranslatorLocatorFactory.php +++ /dev/null @@ -1,45 +0,0 @@ - function () { - return new \Aura\Intl\BasicFormatter; - }, - 'intl' => function () { - return new \Aura\Intl\IntlFormatter; - }, - ]), - new TranslatorFactory, - 'en_US' - ); - } -} diff --git a/vendor/aura/intl/tests/BasicFormatterTest.php b/vendor/aura/intl/tests/BasicFormatterTest.php deleted file mode 100644 index b70781b..0000000 --- a/vendor/aura/intl/tests/BasicFormatterTest.php +++ /dev/null @@ -1,29 +0,0 @@ -newFormatter(); - - $locale = 'en_US'; - $expect = 'Hello world 88!'; - $tokens_values = ['foo' => 'world', 'bar' => '88', 'baz' => '!']; - - $string = 'Hello {foo} {bar}{baz}'; - $actual = $formatter->format($locale, $string, $tokens_values); - $this->assertSame($expect, $actual); - - $tokens_values = ['array' => ['foo', 'bar', 'baz']]; - $string = 'Array {array}'; - $expect = 'Array "foo", "bar", "baz"'; - $actual = $formatter->format($locale, $string, $tokens_values); - $this->assertSame($expect, $actual); - } -} diff --git a/vendor/aura/intl/tests/FormatterLocatorTest.php b/vendor/aura/intl/tests/FormatterLocatorTest.php deleted file mode 100644 index c128679..0000000 --- a/vendor/aura/intl/tests/FormatterLocatorTest.php +++ /dev/null @@ -1,37 +0,0 @@ - function () { - return new \Aura\Intl\MockFormatter; - }, - ]); - - $expect = 'Aura\Intl\MockFormatter'; - $actual = $formatters->get('mock'); - $this->assertInstanceOf($expect, $actual); - } - - public function testSetAndGet() - { - $formatters = new FormatterLocator; - $formatters->set('mock', function () { - return new \Aura\Intl\MockFormatter; - }); - - $expect = 'Aura\Intl\MockFormatter'; - $actual = $formatters->get('mock'); - $this->assertInstanceOf($expect, $actual); - } - - public function testGet_noSuchFormatter() - { - $formatters = new FormatterLocator; - $this->setExpectedException('Aura\Intl\Exception\FormatterNotMapped'); - $formatters->get('noSuchFormatter'); - } -} diff --git a/vendor/aura/intl/tests/IntlFormatterTest.php b/vendor/aura/intl/tests/IntlFormatterTest.php deleted file mode 100644 index ea8399c..0000000 --- a/vendor/aura/intl/tests/IntlFormatterTest.php +++ /dev/null @@ -1,195 +0,0 @@ -markTestSkipped('This test is skipped if the Intl Extension is not loaded.'); - } - } - - public function testIntlVersion() - { - $this->setExpectedException('Aura\Intl\Exception\IcuVersionTooLow'); - $formatter = new IntlFormatter('4.7'); - } - - /** - * This test fails on PHP 5.4.4 - * The return value expected is No pages , but returns false - * - * var_dump( msgfmt_get_error_message($fmt) ); - * U_ZERO_ERROR - * - * It seems $fmt = msgfmt_create($locale, $string); is not creating with - * this string , so the msgfmt_format() throws expects parameter 1 to be - * MessageFormatter, null given error. - */ - public function testFormat_plural() - { - $formatter = $this->newFormatter(); - $locale = 'en_US'; - $string = '{pages,plural,' - . '=0{No pages.}' - . '=1{One page only.}' - . 'other{Page {page} of # pages.}' - . '}'; - - $tokens_values = ['page' => 0, 'pages' => 0]; - $expect = 'No pages.'; - $actual = $formatter->format($locale, $string, $tokens_values); - $this->assertSame($expect, $actual); - - $tokens_values = ['page' => 1, 'pages' => 1]; - $expect = 'One page only.'; - $actual = $formatter->format($locale, $string, $tokens_values); - $this->assertSame($expect, $actual); - - $tokens_values = ['page' => 1, 'pages' => 2]; - $expect = 'Page 1 of 2 pages.'; - $actual = $formatter->format($locale, $string, $tokens_values); - $this->assertSame($expect, $actual); - } - - /** - * @dataProvider provide_testFormat_select - */ - public function testFormat_select($tokens_values, $expect) - { - $locale = 'en_US'; - $string = " - {gender, select, - female { - {count, plural, offset:1 - =0 {{from} does not give a party.} - =1 {{from} invites {to} to her party.} - =2 {{from} invites {to} and one other person to her party.} - other {{from} invites {to} as one of the # people invited to her party.} - } - } - male { - {count, plural, offset:1 - =0 {{from} does not give a party.} - =1 {{from} invites {to} to his party.} - =2 {{from} invites {to} and one other person to his party.} - other {{from} invites {to} as one of the # other people invited to his party.} - } - } - other { - {count, plural, offset:1 - =0 {{from} does not give a party.} - =1 {{from} invites {to} to their party.} - =2 {{from} invites {to} and one other person to their party.} - other {{from} invites {to} as one of the # other people invited to their party.} - } - } - }"; - - $formatter = $this->newFormatter(); - $actual = $formatter->format($locale, $string, $tokens_values); - $this->assertSame(trim($expect), trim($actual)); - } - - public function provide_testFormat_select() - { - return [ - [array('gender' => 'female', 'count' => 0, 'from' => 'Alice', 'to' => 'Bob'), 'Alice does not give a party.'], - [array('gender' => 'male', 'count' => 1, 'from' => 'Bob', 'to' => 'Alice'), 'Bob invites Alice to his party.'], - [array('gender' => 'none', 'count' => 2, 'from' => 'Alice', 'to' => 'Bob'), 'Alice invites Bob and one other person to their party.'], - [array('gender' => 'female', 'count' => 27, 'from' => 'Alice', 'to' => 'Bob'), 'Alice invites Bob as one of the 26 people invited to her party.'], - ]; - } - - public function testFormat_cannotInstantiateFormatter() - { - $locale = 'en_US'; - // uses {count} instead of #, which should fail - $string = " - {gender, select, - female { - {count, plural, offset:1 - =0 {{from} does not give a party.} - =1 {{from} invites {to} to her party.} - =2 {{from} invites {to} and one other person to her party.} - other {{from} invites {to} as one of the {count} people invited to her party.} - } - } - male { - {count, plural, offset:1 - =0 {{from} does not give a party.} - =1 {{from} invites {to} to his party.} - =2 {{from} invites {to} and one other person to his party.} - other {{from} invites {to} as one of the {count} other people invited to his party.} - } - } - other { - {count, plural, offset:1 - =0 {{from} does not give a party.} - =1 {{from} invites {to} to their party.} - =2 {{from} invites {to} and one other person to their party.} - other {{from} invites {to} as one of the {count} other people invited to their party.} - } - } - }"; - $formatter = $this->newFormatter(); - $this->setExpectedException('Aura\Intl\Exception\CannotFormat'); - $actual = $formatter->format($locale, $string, array('gender' => 'female', 'count' => 5, 'from' => 'Alice', 'to' => 'Bob')); - } - - // @todo MAKE IT SO THAT WE CHECK FOR TOKENS IN THE ARRAY - public function testFormat_cannotFormat() - { - $locale = 'en_US'; - $string = 'Hello {foo}'; - $tokens_values = ['bar' => 'baz']; // no 'foo' token - $formatter = $this->newFormatter(); - - $expect = 'Hello {foo}'; - $actual = $formatter->format($locale, $string, $tokens_values); - $this->assertSame($expect, $actual); - } - - /** - * @dataProvider provide_testIssue6 - */ - public function testIssue6($tokens_values, $expect) - { - $locale = 'en_US'; - $string = '{gender, select, female{{name} is {gender} and she report bugs!} male{{name} is {gender} and he report bugs!} other{{name} report bugs!}}'; - $formatter = $this->newFormatter(); - $actual = $formatter->format($locale, $string, $tokens_values); - $this->assertSame($expect, $actual); - } - - public function testEmptyStringThrowsException() - { - $locale = 'en_US'; - $string = ''; - $formatter = $this->newFormatter(); - if (! defined('HHVM_VERSION')) { - $this->setExpectedException('Aura\Intl\Exception\CannotInstantiateFormatter'); - } - $actual = $formatter->format($locale, $string, []); - if (defined('HHVM_VERSION')) { - // HHVM will instantiate Formatter even if empty string is passed. - $expect = ''; - $this->assertSame($expect, $actual); - } - } - - public function provide_testIssue6() - { - return [ - [array('gender' => 'female', 'name' => 'Alice'), 'Alice is female and she report bugs!'], - [array('gender' => 'male', 'name' => 'Alexander' ), 'Alexander is male and he report bugs!'], - [array('gender' => '', 'name' => 'Unknown'), 'Unknown report bugs!'], - ]; - } -} diff --git a/vendor/aura/intl/tests/MockFormatter.php b/vendor/aura/intl/tests/MockFormatter.php deleted file mode 100644 index 8905b1d..0000000 --- a/vendor/aura/intl/tests/MockFormatter.php +++ /dev/null @@ -1,10 +0,0 @@ -packages = new PackageLocator([ - 'Vendor.Foo' => [ - 'en_US' => function () { - return new \Aura\Intl\Package; - }, - ], - ]); - } - - public function testGet() - { - // get once to create it the first time - $first = $this->packages->get('Vendor.Foo', 'en_US'); - $this->assertInstanceOf('Aura\Intl\Package', $first); - - // get again to make sure it's the same object - $again = $this->packages->get('Vendor.Foo', 'en_US'); - $this->assertSame($first, $again); - - // try for an unregistered package - $this->setExpectedException('Aura\Intl\Exception'); - $this->packages->get('Vendor.Bar', 'en_US'); - } -} diff --git a/vendor/aura/intl/tests/PackageTest.php b/vendor/aura/intl/tests/PackageTest.php deleted file mode 100644 index 9ca034c..0000000 --- a/vendor/aura/intl/tests/PackageTest.php +++ /dev/null @@ -1,42 +0,0 @@ -package = $factory->newInstance([ - 'fallback' => 'Vendor.Fallback', - 'formatter' => 'intl', - 'messages' => [ - 'ERR_NO_SUCH_OPTION' => "The option {option} is not recognized.", - ], - ]); - } - - public function testGet() - { - $expect = 'Vendor.Fallback'; - $actual = $this->package->getFallback(); - $this->assertSame($expect, $actual); - - $expect = 'intl'; - $actual = $this->package->getFormatter(); - $this->assertSame($expect, $actual); - - $expect = [ - 'ERR_NO_SUCH_OPTION' => "The option {option} is not recognized.", - ]; - $actual = $this->package->getMessages(); - $this->assertSame($expect, $actual); - - } -} diff --git a/vendor/aura/intl/tests/TranslatorLocatorFactoryTest.php b/vendor/aura/intl/tests/TranslatorLocatorFactoryTest.php deleted file mode 100644 index 5d7f04c..0000000 --- a/vendor/aura/intl/tests/TranslatorLocatorFactoryTest.php +++ /dev/null @@ -1,11 +0,0 @@ -assertInstanceOf('Aura\Intl\TranslatorLocator', $factory->newInstance()); - } -} diff --git a/vendor/aura/intl/tests/TranslatorLocatorTest.php b/vendor/aura/intl/tests/TranslatorLocatorTest.php deleted file mode 100644 index 7c6ed13..0000000 --- a/vendor/aura/intl/tests/TranslatorLocatorTest.php +++ /dev/null @@ -1,113 +0,0 @@ - "The option {option} is not recognized.", - ] - ); - }; - - $registry['Vendor.Package']['pt_BR'] = function () { - return new \Aura\Intl\Package( - 'mock', - null, - [ - 'ERR_NO_SUCH_OPTION' => "O {option} opção não é reconhecido.", - ] - ); - }; - - $this->packages = new PackageLocator($registry); - - $this->formatters = new FormatterLocator([ - 'mock' => function () { - return new MockFormatter; - }, - ]); - - $this->factory = new TranslatorFactory; - - $this->translators = new TranslatorLocator( - $this->packages, - $this->formatters, - $this->factory, - 'en_US' - ); - } - - public function testSetAndGetLocale() - { - $expect = 'pt_BR'; - $this->translators->setLocale($expect); - $actual = $this->translators->getLocale(); - $this->assertSame($expect, $actual); - } - - public function testGetFactory() - { - $actual = $this->translators->getFactory(); - $this->assertSame($this->factory, $actual); - } - - public function testGet() - { - $actual = $this->translators->get('Vendor.Package'); - $this->assertInstanceOf('Aura\Intl\Translator', $actual); - } - - public function testGetPackages() - { - $actual = $this->translators->getPackages(); - $this->assertSame($this->packages, $actual); - } - - public function testGetFormatterLocator() - { - $actual = $this->translators->getFormatters(); - $this->assertSame($this->formatters, $actual); - } - - public function testIssue9() - { - $this->packages->set('Vendor.Package', 'en_UK', function () { - $package = new Package('mock'); - $package->setMessages([ - 'FOO' => 'The text for "foo."', - 'BAR' => 'The text for "bar."', - ]); - return $package; - }); - - $translator = $this->translators->get('Vendor.Package', 'en_UK'); - $expect = 'The text for "foo."'; - $this->assertSame($translator->translate('FOO'), $expect); - } - - public function testIssue9Failure() - { - $package = new Package; - $package->setMessages([ - 'FOO' => 'The text for "foo."', - 'BAR' => 'The text for "bar."', - ]); - // $this->packages->set('Vendor.Package', 'en_UK', $package); - // $this->setExpectedException('Exception'); - // $translator = $this->translators->get('Vendor.Package', 'en_UK'); - } -} diff --git a/vendor/aura/intl/tests/TranslatorTest.php b/vendor/aura/intl/tests/TranslatorTest.php deleted file mode 100644 index e7e8c58..0000000 --- a/vendor/aura/intl/tests/TranslatorTest.php +++ /dev/null @@ -1,101 +0,0 @@ - 'Foo text', - 'TEXT_BAR' => 'Bar text', - ]; - - protected $formatter; - - protected function newTranslator(TranslatorInterface $fallback = null) - { - return $this->factory->newInstance( - 'en_US', - $this->package, - $this->formatter, - $fallback - ); - } - - protected function setUp() - { - $this->factory = new TranslatorFactory; - $this->formatter = new MockFormatter; - $this->package = new Package; - $this->package->setMessages($this->messages); - $this->translator = $this->newTranslator(); - } - - public function testTranslate() - { - // key exists - $expect = 'Foo text'; - $actual = $this->translator->translate('TEXT_FOO'); - $this->assertSame($expect, $actual); - - // key exists, with tokens passed - $expect = 'Foo text'; - $actual = $this->translator->translate('TEXT_FOO', ['foo' => 'bar']); - $this->assertSame($expect, $actual); - - // key does not exist - $expect = 'TEXT_NONE'; - $actual = $this->translator->translate('TEXT_NONE'); - $this->assertSame($expect, $actual); - } - - public function testTranslate_fallback() - { - $package = new Package; - $package->setMessages([ - 'TEXT_NONE' => 'Fallback text', - ]); - // create fallback translator - $fallback = new Translator( - 'en_US', - $package, - $this->formatter - ); - - // create primary translator with fallback - $translator = $this->newTranslator($fallback); - - // key does not exist in primary, but exists in fallback - $expect = 'Fallback text'; - $actual = $translator->translate('TEXT_NONE'); - $this->assertSame($expect, $actual); - } - - public function testTranslateMissingKey() - { - // using getMockBuilder so we can use with phpunit 4.8 or 5+ without warnings - $formatter = $this->getMockBuilder(get_class($this->formatter)) - ->disableOriginalConstructor() - ->disableOriginalClone() - ->disableArgumentCloning() - ->getMock(); - // create fallback translator - $translator = new Translator('en_US', new Package, $formatter); - - $formatter->expects($this->once()) - ->method('format') - ->with('en_US', 'TEXT', ['var' => 'SOME']) - ->will($this->returnValue('FORMATTED')); - - // key does not exist, with tokens passed - $expect = 'FORMATTED'; - $actual = $translator->translate('TEXT', ['var' => 'SOME']); - $this->assertEquals($expect, $actual); - } -} diff --git a/vendor/autoload.php b/vendor/autoload.php deleted file mode 100644 index 553d486..0000000 --- a/vendor/autoload.php +++ /dev/null @@ -1,7 +0,0 @@ - /dev/null; cd "../composer/composer/bin" && pwd) - -if [ -d /proc/cygdrive ] && [[ $(which php) == $(readlink -n /proc/cygdrive)/* ]]; then - # We are in Cgywin using Windows php, so the path must be translated - dir=$(cygpath -m "$dir"); -fi - -"${dir}/composer" "$@" diff --git a/vendor/bin/composer.bat b/vendor/bin/composer.bat deleted file mode 100644 index 2edaa5c..0000000 --- a/vendor/bin/composer.bat +++ /dev/null @@ -1,4 +0,0 @@ -@ECHO OFF -setlocal DISABLEDELAYEDEXPANSION -SET BIN_TARGET=%~dp0/../composer/composer/bin/composer -php "%BIN_TARGET%" %* diff --git a/vendor/bin/jsonlint b/vendor/bin/jsonlint deleted file mode 100644 index dba27a8..0000000 --- a/vendor/bin/jsonlint +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env sh - -dir=$(cd "${0%[/\\]*}" > /dev/null; cd "../seld/jsonlint/bin" && pwd) - -if [ -d /proc/cygdrive ] && [[ $(which php) == $(readlink -n /proc/cygdrive)/* ]]; then - # We are in Cgywin using Windows php, so the path must be translated - dir=$(cygpath -m "$dir"); -fi - -"${dir}/jsonlint" "$@" diff --git a/vendor/bin/jsonlint.bat b/vendor/bin/jsonlint.bat deleted file mode 100644 index 118ee00..0000000 --- a/vendor/bin/jsonlint.bat +++ /dev/null @@ -1,4 +0,0 @@ -@ECHO OFF -setlocal DISABLEDELAYEDEXPANSION -SET BIN_TARGET=%~dp0/../seld/jsonlint/bin/jsonlint -php "%BIN_TARGET%" %* diff --git a/vendor/bin/phinx b/vendor/bin/phinx deleted file mode 100644 index b8931f0..0000000 --- a/vendor/bin/phinx +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env sh - -dir=$(cd "${0%[/\\]*}" > /dev/null; cd "../robmorgan/phinx/bin" && pwd) - -if [ -d /proc/cygdrive ] && [[ $(which php) == $(readlink -n /proc/cygdrive)/* ]]; then - # We are in Cgywin using Windows php, so the path must be translated - dir=$(cygpath -m "$dir"); -fi - -"${dir}/phinx" "$@" diff --git a/vendor/bin/phinx.bat b/vendor/bin/phinx.bat deleted file mode 100644 index c7162d6..0000000 --- a/vendor/bin/phinx.bat +++ /dev/null @@ -1,4 +0,0 @@ -@ECHO OFF -setlocal DISABLEDELAYEDEXPANSION -SET BIN_TARGET=%~dp0/../robmorgan/phinx/bin/phinx -php "%BIN_TARGET%" %* diff --git a/vendor/bin/php-parse b/vendor/bin/php-parse deleted file mode 100644 index c4bd3e7..0000000 --- a/vendor/bin/php-parse +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env sh - -dir=$(cd "${0%[/\\]*}" > /dev/null; cd "../nikic/php-parser/bin" && pwd) - -if [ -d /proc/cygdrive ] && [[ $(which php) == $(readlink -n /proc/cygdrive)/* ]]; then - # We are in Cgywin using Windows php, so the path must be translated - dir=$(cygpath -m "$dir"); -fi - -"${dir}/php-parse" "$@" diff --git a/vendor/bin/php-parse.bat b/vendor/bin/php-parse.bat deleted file mode 100644 index 80f3c6d..0000000 --- a/vendor/bin/php-parse.bat +++ /dev/null @@ -1,4 +0,0 @@ -@ECHO OFF -setlocal DISABLEDELAYEDEXPANSION -SET BIN_TARGET=%~dp0/../nikic/php-parser/bin/php-parse -php "%BIN_TARGET%" %* diff --git a/vendor/bin/phpcbf b/vendor/bin/phpcbf deleted file mode 100644 index 37b16d7..0000000 --- a/vendor/bin/phpcbf +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env sh - -dir=$(cd "${0%[/\\]*}" > /dev/null; cd "../squizlabs/php_codesniffer/bin" && pwd) - -if [ -d /proc/cygdrive ] && [[ $(which php) == $(readlink -n /proc/cygdrive)/* ]]; then - # We are in Cgywin using Windows php, so the path must be translated - dir=$(cygpath -m "$dir"); -fi - -"${dir}/phpcbf" "$@" diff --git a/vendor/bin/phpcbf.bat b/vendor/bin/phpcbf.bat deleted file mode 100644 index 53f44f0..0000000 --- a/vendor/bin/phpcbf.bat +++ /dev/null @@ -1,4 +0,0 @@ -@ECHO OFF -setlocal DISABLEDELAYEDEXPANSION -SET BIN_TARGET=%~dp0/../squizlabs/php_codesniffer/bin/phpcbf -php "%BIN_TARGET%" %* diff --git a/vendor/bin/phpcs b/vendor/bin/phpcs deleted file mode 100644 index 7fbc9c8..0000000 --- a/vendor/bin/phpcs +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env sh - -dir=$(cd "${0%[/\\]*}" > /dev/null; cd "../squizlabs/php_codesniffer/bin" && pwd) - -if [ -d /proc/cygdrive ] && [[ $(which php) == $(readlink -n /proc/cygdrive)/* ]]; then - # We are in Cgywin using Windows php, so the path must be translated - dir=$(cygpath -m "$dir"); -fi - -"${dir}/phpcs" "$@" diff --git a/vendor/bin/phpcs.bat b/vendor/bin/phpcs.bat deleted file mode 100644 index e59fcb3..0000000 --- a/vendor/bin/phpcs.bat +++ /dev/null @@ -1,4 +0,0 @@ -@ECHO OFF -setlocal DISABLEDELAYEDEXPANSION -SET BIN_TARGET=%~dp0/../squizlabs/php_codesniffer/bin/phpcs -php "%BIN_TARGET%" %* diff --git a/vendor/bin/psysh b/vendor/bin/psysh deleted file mode 100644 index cd0fa52..0000000 --- a/vendor/bin/psysh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env sh - -dir=$(cd "${0%[/\\]*}" > /dev/null; cd "../psy/psysh/bin" && pwd) - -if [ -d /proc/cygdrive ] && [[ $(which php) == $(readlink -n /proc/cygdrive)/* ]]; then - # We are in Cgywin using Windows php, so the path must be translated - dir=$(cygpath -m "$dir"); -fi - -"${dir}/psysh" "$@" diff --git a/vendor/bin/psysh.bat b/vendor/bin/psysh.bat deleted file mode 100644 index 292e9f1..0000000 --- a/vendor/bin/psysh.bat +++ /dev/null @@ -1,4 +0,0 @@ -@ECHO OFF -setlocal DISABLEDELAYEDEXPANSION -SET BIN_TARGET=%~dp0/../psy/psysh/bin/psysh -php "%BIN_TARGET%" %* diff --git a/vendor/bin/validate-json b/vendor/bin/validate-json deleted file mode 100644 index 80efbff..0000000 --- a/vendor/bin/validate-json +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env sh - -dir=$(cd "${0%[/\\]*}" > /dev/null; cd "../justinrainbow/json-schema/bin" && pwd) - -if [ -d /proc/cygdrive ] && [[ $(which php) == $(readlink -n /proc/cygdrive)/* ]]; then - # We are in Cgywin using Windows php, so the path must be translated - dir=$(cygpath -m "$dir"); -fi - -"${dir}/validate-json" "$@" diff --git a/vendor/bin/validate-json.bat b/vendor/bin/validate-json.bat deleted file mode 100644 index 92328d8..0000000 --- a/vendor/bin/validate-json.bat +++ /dev/null @@ -1,4 +0,0 @@ -@ECHO OFF -setlocal DISABLEDELAYEDEXPANSION -SET BIN_TARGET=%~dp0/../justinrainbow/json-schema/bin/validate-json -php "%BIN_TARGET%" %* diff --git a/vendor/bin/var-dump-server b/vendor/bin/var-dump-server deleted file mode 100644 index e41c85b..0000000 --- a/vendor/bin/var-dump-server +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env sh - -dir=$(cd "${0%[/\\]*}" > /dev/null; cd "../symfony/var-dumper/Resources/bin" && pwd) - -if [ -d /proc/cygdrive ] && [[ $(which php) == $(readlink -n /proc/cygdrive)/* ]]; then - # We are in Cgywin using Windows php, so the path must be translated - dir=$(cygpath -m "$dir"); -fi - -"${dir}/var-dump-server" "$@" diff --git a/vendor/bin/var-dump-server.bat b/vendor/bin/var-dump-server.bat deleted file mode 100644 index 1cd1c0c..0000000 --- a/vendor/bin/var-dump-server.bat +++ /dev/null @@ -1,4 +0,0 @@ -@ECHO OFF -setlocal DISABLEDELAYEDEXPANSION -SET BIN_TARGET=%~dp0/../symfony/var-dumper/Resources/bin/var-dump-server -php "%BIN_TARGET%" %* diff --git a/vendor/cakephp-plugins.php b/vendor/cakephp-plugins.php deleted file mode 100644 index d80def0..0000000 --- a/vendor/cakephp-plugins.php +++ /dev/null @@ -1,10 +0,0 @@ - [ - 'Bake' => $baseDir . '/vendor/cakephp/bake/', - 'DebugKit' => $baseDir . '/vendor/cakephp/debug_kit/', - 'Migrations' => $baseDir . '/vendor/cakephp/migrations/', - 'WyriHaximus/TwigView' => $baseDir . '/vendor/wyrihaximus/twig-view/' - ] -]; \ No newline at end of file diff --git a/vendor/cakephp/bake/Dockerfile b/vendor/cakephp/bake/Dockerfile deleted file mode 100644 index 2966139..0000000 --- a/vendor/cakephp/bake/Dockerfile +++ /dev/null @@ -1,24 +0,0 @@ -# Basic docker based environment -# Necessary to trick dokku into building the documentation -# using dockerfile instead of herokuish -FROM ubuntu:17.04 - -# Add basic tools -RUN apt-get update && \ - apt-get install -y build-essential \ - software-properties-common \ - curl \ - git \ - libxml2 \ - libffi-dev \ - libssl-dev - -RUN LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php && \ - apt-get update && \ - apt-get install -y php7.2-cli php7.2-mbstring php7.2-xml php7.2-zip php7.2-intl php7.2-opcache php7.2-sqlite - -WORKDIR /code - -VOLUME ["/code"] - -CMD [ '/bin/bash' ] diff --git a/vendor/cakephp/bake/LICENSE.txt b/vendor/cakephp/bake/LICENSE.txt deleted file mode 100644 index 0a0a98c..0000000 --- a/vendor/cakephp/bake/LICENSE.txt +++ /dev/null @@ -1,28 +0,0 @@ -The MIT License - -CakePHP(tm) : The Rapid Development PHP Framework (http://cakephp.org) -Copyright (c) 2005-present, Cake Software Foundation, Inc. - -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. - -Cake Software Foundation, Inc. -1785 E. Sahara Avenue, -Suite 490-204 -Las Vegas, Nevada 89104, -United States of America. diff --git a/vendor/cakephp/bake/README.md b/vendor/cakephp/bake/README.md deleted file mode 100644 index 621d2a8..0000000 --- a/vendor/cakephp/bake/README.md +++ /dev/null @@ -1,38 +0,0 @@ -# Bake plugin for CakePHP - -[![Build Status](https://img.shields.io/travis/cakephp/bake/master.svg?style=flat-square)](https://travis-ci.org/cakephp/bake) -[![Coverage Status](https://img.shields.io/codecov/c/github/cakephp/bake.svg?style=flat-square)](https://codecov.io/github/cakephp/bake) -[![License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.txt) - -This project provides the code generation functionality for CakePHP. Through a -suite of CLI tools, you can quickly and easily generate code for your application. - -## Installation - -You can install this plugin into your CakePHP application using [composer](http://getcomposer.org). - -The recommended way to install composer packages is: - -``` -composer require --dev cakephp/bake -``` - -## Documentation - -You can find the documentation for bake [on its own cookbook](https://book.cakephp.org/bake/1.x/en/index.html). - -## Testing - -After installing dependencies with composer you can run tests with `phpunit`: - -```bash -vendor/bin/phpunit -``` - -If your changes require changing the templates that bake uses, you can save time updating tests, by -enabling bake's 'overwrite fixture feature'. This will let you re-generate the expected output files -without having to manually edit each one: - -```bash -UPDATE_TEST_COMPARISON_FILES=1 vendor/bin/phpunit -``` diff --git a/vendor/cakephp/bake/composer.json b/vendor/cakephp/bake/composer.json deleted file mode 100644 index 677841f..0000000 --- a/vendor/cakephp/bake/composer.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "name": "cakephp/bake", - "description": "Bake plugin for CakePHP 3", - "type": "cakephp-plugin", - "keywords": ["cakephp", "bake"], - "homepage": "https://github.com/cakephp/bake", - "license": "MIT", - "authors": [ - { - "name": "CakePHP Community", - "homepage": "https://github.com/cakephp/bake/graphs/contributors" - } - ], - "support": { - "issues": "https://github.com/cakephp/bake/issues", - "forum": "https://stackoverflow.com/tags/cakephp", - "irc": "irc://irc.freenode.org/cakephp", - "source": "https://github.com/cakephp/bake" - }, - "require": { - "php": ">=5.6.0", - "cakephp/cakephp": "^3.8.0", - "cakephp/plugin-installer": "^1.0", - "wyrihaximus/twig-view": "^4.3.7" - }, - "require-dev": { - "cakephp/cakephp-codesniffer": "^3.0", - "phpunit/phpunit": "^5.7.14|^6.0" - }, - "autoload": { - "psr-4": { - "Bake\\": "src/" - } - }, - "autoload-dev": { - "psr-4": { - "BakeTest\\": "tests/test_app/Plugin/BakeTest/src/", - "Pastry\\PastryTest\\": "tests/test_app/Plugin/PastryTest/src/", - "Bake\\Test\\": "tests/", - "Bake\\Test\\App\\": "tests/test_app/App/", - "Cake\\Test\\": "./vendor/cakephp/cakephp/tests/" - } - }, - "scripts": { - "check": [ - "@test", - "@cs-check" - ], - "cs-check": "phpcs --parallel=16 -p src/ tests/", - "cs-fix": "phpcbf --parallel=16 -p src/ tests/", - "phpstan": "phpstan analyse src/", - "phpstan-setup": "cp composer.json composer.backup && composer require --dev phpstan/phpstan-shim:^0.11 && mv composer.backup composer.json", - "test": "phpunit", - "test-coverage": "phpunit --coverage-clover=clover.xml" - } -} diff --git a/vendor/cakephp/bake/docs.Dockerfile b/vendor/cakephp/bake/docs.Dockerfile deleted file mode 100644 index adb6e94..0000000 --- a/vendor/cakephp/bake/docs.Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -# Generate the HTML output. -FROM markstory/cakephp-docs-builder as builder - -# Copy entire repo in with .git so we can build all versions in one image. -COPY docs /data/src - -RUN cd /data/docs-builder \ - && make website LANGS="en es fr ja pt ru" SOURCE=/data/src DEST=/data/website/ - -# Build a small nginx container with just the static site in it. -FROM nginx:1.15-alpine - -COPY --from=builder /data/website /data/website -COPY --from=builder /data/docs-builder/nginx.conf /etc/nginx/conf.d/default.conf - -# Copy docs into place. -RUN cp -R /data/website/html/* /usr/share/nginx/html \ - && rm -rf /data/website diff --git a/vendor/cakephp/bake/docs/config/__init__.py b/vendor/cakephp/bake/docs/config/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/vendor/cakephp/bake/docs/config/all.py b/vendor/cakephp/bake/docs/config/all.py deleted file mode 100644 index b74fcbe..0000000 --- a/vendor/cakephp/bake/docs/config/all.py +++ /dev/null @@ -1,49 +0,0 @@ -# Global configuration information used across all the -# translations of documentation. -# -# Import the base theme configuration -from cakephpsphinx.config.all import * - -# The version info for the project you're documenting, acts as replacement for -# |version| and |release|, also used in various other places throughout the -# built documents. -# - -# The full version, including alpha/beta/rc tags. -release = '1.x' - -# The search index version. -search_version = 'bake-1' - -# The marketing display name for the book. -version_name = '' - -# Project name shown in the black header bar -project = 'CakePHP Bake' - -# Other versions that display in the version picker menu. -version_list = [ - {'name': '1.x', 'number': '/bake/1.x', 'title': '1.x', 'current': True}, - # {'name': '2.x', 'number': '/bake/2.x', 'title': '2.x'}, -] - -# Languages available. -languages = ['en', 'es', 'fr', 'ja', 'pt', 'ru'] - -# The GitHub branch name for this version of the docs -# for edit links to point at. -branch = 'master' - -# Current version being built -version = '1.x' - -# Language in use for this directory. -language = 'en' - -show_root_link = True - -repository = 'cakephp/bake' - -source_path = 'docs/' - -hide_page_contents = ('search', '404', 'contents') diff --git a/vendor/cakephp/bake/docs/en/conf.py b/vendor/cakephp/bake/docs/en/conf.py deleted file mode 100644 index f638bda..0000000 --- a/vendor/cakephp/bake/docs/en/conf.py +++ /dev/null @@ -1,9 +0,0 @@ -import sys, os - -# Append the top level directory of the docs, so we can import from the config dir. -sys.path.insert(0, os.path.abspath('..')) - -# Pull in all the configuration options defined in the global config file.. -from config.all import * - -language = 'en' diff --git a/vendor/cakephp/bake/docs/en/contents.rst b/vendor/cakephp/bake/docs/en/contents.rst deleted file mode 100644 index 08c3e95..0000000 --- a/vendor/cakephp/bake/docs/en/contents.rst +++ /dev/null @@ -1,7 +0,0 @@ -.. toctree:: - :maxdepth: 2 - :caption: CakePHP Bake - - /index - /usage - /development diff --git a/vendor/cakephp/bake/docs/en/development.rst b/vendor/cakephp/bake/docs/en/development.rst deleted file mode 100644 index 68eebdb..0000000 --- a/vendor/cakephp/bake/docs/en/development.rst +++ /dev/null @@ -1,304 +0,0 @@ -Extending Bake -############## - -Bake features an extensible architecture that allows your application or plugins -to modify or add-to the base functionality. Bake makes use of a dedicated -view class which uses the `Twig `_ template engine. - -Bake Events -=========== - -As a view class, ``BakeView`` emits the same events as any other view class, -plus one extra initialize event. However, whereas standard view classes use the -event prefix "View.", ``BakeView`` uses the event prefix "Bake.". - -The initialize event can be used to make changes which apply to all baked -output, for example to add another helper to the bake view class this event can -be used:: - - on('Bake.initialize', function (Event $event) { - $view = $event->getSubject(); - - // In my bake templates, allow the use of the MySpecial helper - $view->loadHelper('MySpecial', ['some' => 'config']); - - // And add an $author variable so it's always available - $view->set('author', 'Andy'); - - }); - -If you want to modify bake from within another plugin, putting your plugin's -bake events in the plugin ``config/bootstrap.php`` file is a good idea. - -Bake events can be handy for making small changes to existing templates. -For example, to change the variable names used when baking controller/template -files one can use a function listening for ``Bake.beforeRender`` to modify the -variables used in the bake templates:: - - on('Bake.beforeRender', function (Event $event) { - $view = $event->getSubject(); - - // Use $rows for the main data variable in indexes - if ($view->get('pluralName')) { - $view->set('pluralName', 'rows'); - } - if ($view->get('pluralVar')) { - $view->set('pluralVar', 'rows'); - } - - // Use $theOne for the main data variable in view/edit - if ($view->get('singularName')) { - $view->set('singularName', 'theOne'); - } - if ($view->get('singularVar')) { - $view->set('singularVar', 'theOne'); - } - - }); - -You may also scope the ``Bake.beforeRender`` and ``Bake.afterRender`` events to -a specific generated file. For instance, if you want to add specific actions to -your UsersController when generating from a **Controller/controller.twig** file, -you can use the following event:: - - on( - 'Bake.beforeRender.Controller.controller', - function (Event $event) { - $view = $event->getSubject(); - if ($view->viewVars['name'] == 'Users') { - // add the login and logout actions to the Users controller - $view->set('actions', [ - 'login', - 'logout', - 'index', - 'view', - 'add', - 'edit', - 'delete' - ]); - } - } - ); - -By scoping event listeners to specific bake templates, you can simplify your -bake related event logic and provide callbacks that are easier to test. - -Bake Template Syntax -==================== - -Bake template files use the `Twig `__ template syntax. - -One way to see/understand how bake templates works, especially when attempting -to modify bake template files, is to bake a class and compare the template used -with the pre-processed template file which is left in the application's -**tmp/bake** folder. - -So, for example, when baking a shell like so: - -.. code-block:: bash - - bin/cake bake shell Foo - -The template used (**vendor/cakephp/bake/src/Template/Bake/Shell/shell.twig**) -looks like this:: - - `` A Bake template php close tag - * ``<%=`` A Bake template php short-echo tag - * ``<%-`` A Bake template php open tag, stripping any leading whitespace - before the tag - * ``-%>`` A Bake template php close tag, stripping trailing whitespace after - the tag - -.. _creating-a-bake-theme: - -Creating a Bake Theme -===================== - -If you wish to modify the output produced by the "bake" command, you can -create your own bake 'theme' which allows you to replace some or all of the -templates that bake uses. The best way to do this is: - -#. Bake a new plugin. The name of the plugin is the bake 'theme' name -#. Create a new directory **plugins/[name]/src/Template/Bake/Template/**. -#. Copy any templates you want to override from - **vendor/cakephp/bake/src/Template/Bake/Template** to matching files in your - plugin. -#. When running bake use the ``--theme`` option to specify the bake-theme you - want to use. To avoid having to specify this option in each call, you can also - set your custom theme to be used as default theme:: - - Test->classSuffixes[$this->name()])) { - $this->Test->classSuffixes[$this->name()] = 'Foo'; - } - - $name = ucfirst($this->name()); - if (!isset($this->Test->classTypes[$name])) { - $this->Test->classTypes[$name] = 'Foo'; - } - - return parent::bakeTest($className); - } - -* The **class suffix** will be appened to the name provided in your ``bake`` - call. In the previous example, it would create a ``ExampleFooTest.php`` file. -* The **class type** will be the sub-namespace used that will lead to your - file (relative to the app or the plugin you are baking into). In the previous - example, it would create your test with the namespace ``App\Test\TestCase\Foo`` - . - -.. meta:: - :title lang=en: Extending Bake - :keywords lang=en: command line interface,development,bake view, bake template syntax,twig,erb tags,percent tags - diff --git a/vendor/cakephp/bake/docs/en/index.rst b/vendor/cakephp/bake/docs/en/index.rst deleted file mode 100644 index 1020e90..0000000 --- a/vendor/cakephp/bake/docs/en/index.rst +++ /dev/null @@ -1,28 +0,0 @@ -Bake Console -############ - -CakePHP's bake console is another effort to get you up and running in CakePHP -– fast. The bake console can create any of CakePHP's basic ingredients: models, -behaviors, views, helpers, controllers, components, test cases, fixtures and plugins. -And we aren't just talking skeleton classes: Bake can create a fully functional -application in just a few minutes. In fact, Bake is a natural step to take once -an application has been scaffolded. - -Installation -============ - -Before trying to use or extend bake, make sure it is installed in your -application. Bake is provided as a plugin that you can install with Composer:: - - composer require --dev cakephp/bake:~1.0 - -The above will install bake as a development dependency. This means that it will -not be installed when you do production deployments. - -When using the Twig templates make sure you are loading the -``WyriHaximus/TwigView`` plugin with its bootstrap. You can also omit it -completely which then makes Bake plugin load this plugin on demand. - -.. meta:: - :title lang=en: Bake Console - :keywords lang=en: command line interface,development,bake view, bake template syntax,erb tags,asp tags,percent tags diff --git a/vendor/cakephp/bake/docs/en/usage.rst b/vendor/cakephp/bake/docs/en/usage.rst deleted file mode 100644 index 956efe0..0000000 --- a/vendor/cakephp/bake/docs/en/usage.rst +++ /dev/null @@ -1,133 +0,0 @@ -Code Generation with Bake -######################### - -The cake console is run using the PHP CLI (command line interface). -If you have problems running the script, ensure that: - -#. You have the PHP CLI installed and that it has the proper modules enabled - (eg: MySQL, intl). -#. Users also might have issues if the database host is 'localhost' and should - try '127.0.0.1' instead, as localhost can cause issues with PHP CLI. -#. Depending on how your computer is configured, you may have to set execute - rights on the cake bash script to call it using ``bin/cake bake``. - -Before running bake you should make sure you have at least one database -connection configured. - -When run with no arguments ``bin/cake bake`` will output a list of available -tasks. - -For windows system try with ``bin\cake bake``. - -You should see something like:: - - $ bin/cake bake - - Welcome to CakePHP v3.4.6 Console - --------------------------------------------------------------- - App : src - Path: /var/www/cakephp.dev/src/ - PHP : 5.6.20 - --------------------------------------------------------------- - The following commands can be used to generate skeleton code for your application. - - Available bake commands: - - - all - - behavior - - cell - - component - - controller - - fixture - - form - - helper - - mailer - - migration - - migration_diff - - migration_snapshot - - model - - plugin - - seed - - shell - - shell_helper - - task - - template - - test - - By using `cake bake [name]` you can invoke a specific bake task. - -You can get more information on what each task does, and what options are -available using the ``--help`` option:: - - $ bin/cake bake --help - - Welcome to CakePHP v3.4.6 Console - --------------------------------------------------------------- - App : src - Path: /var/www/cakephp.dev/src/ - PHP : 5.6.20 - --------------------------------------------------------------- - The Bake script generates controllers, models and template files for - your application. If run with no command line arguments, Bake guides the - user through the class creation process. You can customize the - generation process by telling Bake where different parts of your - application are using command line arguments. - - Usage: - cake bake.bake [subcommand] [options] - - Subcommands: - - all Bake a complete MVC skeleton. - behavior Bake a behavior class file. - cell Bake a cell class file. - component Bake a component class file. - controller Bake a controller skeleton. - fixture Generate fixtures for use with the test suite. You - can use `bake fixture all` to bake all fixtures. - form Bake a form class file. - helper Bake a helper class file. - mailer Bake a mailer class file. - migration Bake migration class. - migration_diff Bake migration class. - migration_snapshot Bake migration snapshot class. - model Bake table and entity classes. - plugin Create the directory structure, AppController class - and testing setup for a new plugin. Can create - plugins in any of your bootstrapped plugin paths. - seed Bake seed class. - shell Bake a shell class file. - shell_helper Bake a shell_helper class file. - task Bake a task class file. - template Bake views for a controller, using built-in or - custom templates. - test Bake test case skeletons for classes. - - To see help on a subcommand use `cake bake.bake [subcommand] --help` - - Options: - - --connection, -c Database connection to use in conjunction with `bake - all`. (default: default) - --everything Bake a complete MVC skeleton, using all the available - tables. Usage: "bake all --everything" - --force, -f Force overwriting existing files without prompting. - --help, -h Display this help. - --plugin, -p Plugin to bake into. - --prefix Prefix to bake controllers and templates into. - --quiet, -q Enable quiet output. - --tablePrefix Table prefix to be used in models. - --theme, -t The theme to use when baking code. (choices: - Bake|Migrations) - --verbose, -v Enable verbose output. - -Bake Themes -=========== - -The theme option is common to all bake commands, and allows changing the bake -template files used when baking. To create your own templates, see the -:ref:`bake theme creation documentation `. - -.. meta:: - :title lang=en: Code Generation with Bake - :keywords lang=en: command line interface,functional application,database,database configuration,bash script,basic ingredients,project,model,path path,code generation,scaffolding,windows users,configuration file,few minutes,config,iew,shell,models,running,mysql diff --git a/vendor/cakephp/bake/docs/es/conf.py b/vendor/cakephp/bake/docs/es/conf.py deleted file mode 100644 index 4691ece..0000000 --- a/vendor/cakephp/bake/docs/es/conf.py +++ /dev/null @@ -1,9 +0,0 @@ -import sys, os - -# Append the top level directory of the docs, so we can import from the config dir. -sys.path.insert(0, os.path.abspath('..')) - -# Pull in all the configuration options defined in the global config file.. -from config.all import * - -language = 'es' diff --git a/vendor/cakephp/bake/docs/es/contents.rst b/vendor/cakephp/bake/docs/es/contents.rst deleted file mode 100644 index 08c3e95..0000000 --- a/vendor/cakephp/bake/docs/es/contents.rst +++ /dev/null @@ -1,7 +0,0 @@ -.. toctree:: - :maxdepth: 2 - :caption: CakePHP Bake - - /index - /usage - /development diff --git a/vendor/cakephp/bake/docs/es/development.rst b/vendor/cakephp/bake/docs/es/development.rst deleted file mode 100644 index 7f717d0..0000000 --- a/vendor/cakephp/bake/docs/es/development.rst +++ /dev/null @@ -1,17 +0,0 @@ -Extending Bake -############## - -.. note:: - La documentación no es compatible actualmente con el idioma español en esta página. - - Por favor, siéntase libre de enviarnos un pull request en - `Github `_ o utilizar el botón **Improve this Doc** para proponer directamente los cambios. - - Usted puede hacer referencia a la versión en Inglés en el menú de selección superior - para obtener información sobre el tema de esta página. - -.. _creating-a-bake-theme: - -.. meta:: - :title lang=es: Extending Bake - :keywords lang=es: command line interface,development,bake view, bake template syntax,erb tags,asp tags,percent tags diff --git a/vendor/cakephp/bake/docs/es/index.rst b/vendor/cakephp/bake/docs/es/index.rst deleted file mode 100644 index 80f1fa6..0000000 --- a/vendor/cakephp/bake/docs/es/index.rst +++ /dev/null @@ -1,31 +0,0 @@ -Consola bake -############ - -La consola bake de CakePHP es otro esfuerzo para preparar y ejecutar CakePHP rápidamente. - -La consola bake puede crear cualquiera de los ingredientes básicos de CakePHP: -modelos, behaviours, vistas, helpers, controladores, componentes, casos de -prueba, fixtures y plugins. - -Y no hablamos sólo de esqueletos de clases: Bake puede crear una aplicación -totalmente funcional en solo un par de minutos. - -De hecho, Bake es un paso natural a dar una vez ha sido creado el esqueleto de -la aplicación. - -Instalación -=========== - -Antes de intentar utilizar o extender bake asegúrate de que está instalado en tu -aplicación. - -Bake está incluido como un plugin que puedes instalar con Composer:: - - composer require --dev cakephp/bake:~1.0 - -La instrucción anterior instalará bake como una dependencia de desarrollo. Esto -significa que no será instalado cuando hagas despliegues en producción. - -.. meta:: - :title lang=es: Consola Bake - :keywords lang=es: interfaz de línea de comando,desarrollo,bake vista, bake sintaxis plantilla,erb tags,asp tags,percent tags diff --git a/vendor/cakephp/bake/docs/es/usage.rst b/vendor/cakephp/bake/docs/es/usage.rst deleted file mode 100644 index dad6ffd..0000000 --- a/vendor/cakephp/bake/docs/es/usage.rst +++ /dev/null @@ -1,115 +0,0 @@ -Crear código con Bake -##################### - -La consola de CAKE se ejecuta usando PHP CLI (command line interface). -Si tiene problemas para ejecutar el script, asegurese de: - -#. Tener instalado el PHP CLI y que estén los módulos correspondientes - habilitados (ej: MySQL y intl). -#. Si el host de base de datos es 'localhost', intente realizar la conexión con - el ip '127.0.0.1'. En algunos casos PHP CLI tiene problemas al referenciar - por nombre de host (localhost). -#. Dependiendo de como esté configurado su equipo, la ejecución del comando - CAKE BAKE (cake bash script) puede requerir permisos de ejecución al - lanzar ``bin/cake bake``. - -Antes de comenzar la ejecución, asegúrese de disponer al menos de una conexión -a una base de datos configurada. - -Para comenzar con la ejecución del comando debe abrir la consola de windows -y ejecutar "Cake Bake" - -#. Ir a Inicio (Start) > Ejecutar (Run) -#. Escribir "cmd" y presionar 'Enter' -#. Navegar hasta llegar a la carpeta de instalación de cake -#. Acceder a la carpeta 'bin' -#. Escribir 'Cake bake' lo cual deberá devolver un listado con todas las - tareas/actividades disponibles. - -El resultado debería ser algo similar a lo siguiente:: - - $ bin/cake bake - - Welcome to CakePHP v3.1.6 Console - --------------------------------------------------------------- - App : src - Path: /var/www/cakephp.dev/src/ - PHP: 5.5.8 - --------------------------------------------------------------- - The following commands can be used to generate skeleton code for your application. - - Available bake commands: - - - all - - behavior - - cell - - component - - controller - - fixture - - form - - helper - - mailer - - migration - - migration_snapshot - - model - - plugin - - shell - - shell-helper - - template - - test - - By using 'cake bake [name]' you can invoke a specific bake task. - -Puede obtener más información sobre lo que realiza cada una de las actividades -y sus opciones usando el parametro '--help' option:: - - $ bin/cake bake controller --help - - Welcome to CakePHP v3.1.6 Console - --------------------------------------------------------------- - App : src - Path: /var/www/cakephp.dev/src/ - --------------------------------------------------------------- - Bake a controller skeleton. - - Usage: - cake bake controller [subcommand] [options] [] - - Subcommands: - - all Bake all controllers with CRUD methods. - - To see help on a subcommand use `cake bake controller [subcommand] --help` - - Options: - - --help, -h Display this help. - --verbose, -v Enable verbose output. - --quiet, -q Enable quiet output. - --plugin, -p Plugin to bake into. - --force, -f Force overwriting existing files without prompting. - --connection, -c The datasource connection to get data from. - (default: default) - --theme, -t The theme to use when baking code. - --components The comma separated list of components to use. - --helpers The comma separated list of helpers to use. - --prefix The namespace/routing prefix to use. - --no-test Do not generate a test skeleton. - --no-actions Do not generate basic CRUD action methods. - - Arguments: - - name Name of the controller to bake. Can use Plugin.name to bake - controllers into plugins. (optional) - -Temas Bake / Templates -====================== - -La opción ``theme`` es genérica para todos los comandos bake y permite cambiar los -templates de bake utilizados para generar los archivos finales. Para crear sus -propios templates, ver :ref:`bake theme creation documentation -`. - -.. meta:: - :title lang=es: Crear código con Bake - :keywords lang=es: interfaz de línea de comando, aplicación funcional, base de datos, configuración de base de datos, bash script, ingredientes básicos, proyecto, modelo, path, crear código, generación de código, scaffolding, usuarios windows, archivo de configuración, pocos minutos, configurar, iew, shell, modelos, running, mysql diff --git a/vendor/cakephp/bake/docs/fr/conf.py b/vendor/cakephp/bake/docs/fr/conf.py deleted file mode 100644 index b02032e..0000000 --- a/vendor/cakephp/bake/docs/fr/conf.py +++ /dev/null @@ -1,9 +0,0 @@ -import sys, os - -# Append the top level directory of the docs, so we can import from the config dir. -sys.path.insert(0, os.path.abspath('..')) - -# Pull in all the configuration options defined in the global config file.. -from config.all import * - -language = 'fr' diff --git a/vendor/cakephp/bake/docs/fr/contents.rst b/vendor/cakephp/bake/docs/fr/contents.rst deleted file mode 100644 index 08c3e95..0000000 --- a/vendor/cakephp/bake/docs/fr/contents.rst +++ /dev/null @@ -1,7 +0,0 @@ -.. toctree:: - :maxdepth: 2 - :caption: CakePHP Bake - - /index - /usage - /development diff --git a/vendor/cakephp/bake/docs/fr/development.rst b/vendor/cakephp/bake/docs/fr/development.rst deleted file mode 100644 index 61de705..0000000 --- a/vendor/cakephp/bake/docs/fr/development.rst +++ /dev/null @@ -1,351 +0,0 @@ -Etendre Bake -############ - -Bake dispose d'une architecture extensible qui permet à votre application ou -à vos plugins de modifier ou ajouter la fonctionnalité de base. Bake utilise une -classe de vue dédiée qui n'utilise pas la syntaxe PHP standard. - -Events de Bake -============== - -Comme une classe de vue, ``BakeView`` envoie les mêmes events que toute autre -classe de vue, ainsi qu'un event initialize supplémentaire. Cependant, -alors que les classes de vue standard utilisent le préfixe d'event -"View.", ``BakeView`` utilise le préfixe d'event "Bake.". - -L'event initialize peut être utilisé pour faire des changements qui -s'appliquent à toutes les sorties fabriquées avec bake, par exemple pour ajouter -un autre helper à la classe de vue bake, cet event peut être utilisé:: - - on('Bake.initialize', function (Event $event) { - $view = $event->getSubject(); - - // Dans mes templates de bake, permet l'utilisation du helper MySpecial - $view->loadHelper('MySpecial', ['some' => 'config']); - - // Et ajoute une variable $author pour qu'elle soit toujours disponible - $view->set('author', 'Andy'); - - }); - -Si vous souhaitez modifier bake à partir d'un autre plugin, mettre les events -de bake de votre plugin dans le fichier ``config/bootstrap.php`` du plugin est -une bonne idée. - -Les events de bake peuvent être pratiques pour faire de petits changements dans -les templates existants. Par exemple, pour changer les noms de variables -utilisés lors de la création avec bake de fichiers de controller/template, on -pourra utiliser une fonction qui écoute ``Bake.beforeRender`` pour modifier les -variables utilisées dans les templates de bake:: - - on('Bake.beforeRender', function (Event $event) { - $view = $event->getSubject(); - - // Utilise $rows pour les principales variables de données dans les indexes - if ($view->get('pluralName')) { - $view->set('pluralName', 'rows'); - } - if ($view->get('pluralVar')) { - $view->set('pluralVar', 'rows'); - } - - // Utilise $theOne pour les principales variable de données dans les view/edit - if ($view->get('singularName')) { - $view->set('singularName', 'theOne'); - } - if ($view->get('singularVar')) { - $view->set('singularVar', 'theOne'); - } - - }); - -Vous pouvez aussi scoper les events ``Bake.beforeRender`` et -``Bake.afterRender`` dans un fichier généré spécifique. Par exemple, si vous -souhaitez ajouter des actions spécifiques à votre UsersController quand vous le -générez à partir d'un fichier **Controller/controller.ctp**, vous pouvez -utiliser l'event suivant:: - - on( - 'Bake.beforeRender.Controller.controller', - function (Event $event) { - $view = $event->subject; - if ($view->viewVars['name'] == 'Users') { - // ajouter les actions login et logout au controller Users - $view->viewVars['actions'] = [ - 'login', - 'logout', - 'index', - 'view', - 'add', - 'edit', - 'delete' - ]; - } - } - ); - -En scopant les écouteurs d'event vers des templates de bake spécifiques, vous -pouvez simplifier votre logique d'event liée à bake et fournir des callbacks -qui sont plus faciles à tester. - -Syntaxe de Template de Bake -=========================== - -Les fichiers de template de Bake utilisent les balises erb-style (``<% %>``) -pour indiquer la logique des templates, et traitent le reste, y compris les -balises php, comme du texte. - -.. note:: - - Les fichiers de template de Bake n'utilisent pas, et sont insensibles aux - ``asp_tags`` de la configuration de php ini. - -``BakeView`` intègre les balises suivantes: - - * ``<%`` Une balise php ouverte de template de Bake - * ``%>`` Une balise php fermante de template de Bake - * ``<%=`` Une balise php de short-echo de template de Bake - * ``<%-`` Une balise php ouverte de template de Bake, enlevant tout espace - en tête avant la balise - * ``-%>`` Une balise php fermante de template de Bake, enlevant les espaces - à a fin après la balise - -Une façon de voir/comprendre la façon dont les templates de Bake fonctionne, -spécialement quand on essaie de modifier les fichiers de template de bake, est -de créer avec bake une classe et de comparer le template utilisé avec le -template déjà présent dans le dossier **tmp/bake** de votre application. - -Ainsi, par exemple, pour créer avec bake un shell comme ceci: - -.. code-block:: bash - - bin/cake bake shell Foo - -Le template utilisé -(**vendor/cakephp/cakephp/src/Template/Bake/Shell/shell.ctp**) -ressemble à ceci:: - - \Shell; - - use Cake\Console\Shell; - - /** - * <%= $name %> shell command. - */ - class <%= $name %>Shell extends Shell - { - - /** - * main() method. - * - * @return bool|int Success or error code. - */ - public function main() - { - } - - } - -Le fichier template déjà présent (pre-processed) -(**tmp/bake/Bake-Shell-shell-ctp.php**), qui est le fichier réellement -rendu, ressemble à ceci:: - - \Shell; - - use Cake\Console\Shell; - - /** - * shell command. - */ - class Shell extends Shell - { - - /** - * main() method. - * - * @return bool|int Success or error code. - */ - public function main() - { - } - - } - -Et la classe résultante construite avec bake (**src/Shell/FooShell.php**) -ressemble à ceci:: - - \Foo; - - /** - * <%= $name %> foo - */ - class <%= $name %>Foo - { - // Add code. - } - -Vous devriez maintenant voir votre nouvelle tâche dans l'affichage de -``bin/cake bake``. Vous pouvez lancer votre nouvelle tâche en exécutant -``bin/cake bake foo Example``. -Cela va générer une nouvelle classe ``ExampleFoo`` dans -**src/Foo/ExampleFoo.php** que votre application va -pouvoir utiliser. - -Si vous souhaitez que votre appel à ``bake`` crée également un fichier de test -pour la classe ``ExampleFoo``, vous devrez surcharger la méthode ``bakeTest()`` -dans la classe ``FooTask`` pour y définir le suffixe et le namespace de la -classe de votre nom de commande personnalisée:: - - public function bakeTest($className) - { - if (!isset($this->Test->classSuffixes[$this->name()])) { - $this->Test->classSuffixes[$this->name()] = 'Foo'; - } - - $name = ucfirst($this->name()); - if (!isset($this->Test->classTypes[$name])) { - $this->Test->classTypes[$name] = 'Foo'; - } - - return parent::bakeTest($className); - } - -* Le **suffixe de classe** sera ajouté après le nom passé à ``bake``. Dans le - cadre de l'exemple ci-dessus, cela créerait un fichier ``ExampleFooTest.php``. -* Le **type de classe** sera le sous-namespace utilisé pour atteindre votre - fichier (relatif à l'application ou au plugin dans lequel vous faites le - ``bake``). Dans le cadre de l'exemple ci-dessus, cela créerait le test avec le - namespace ``App\Test\TestCase\Foo``. - -.. meta:: - :title lang=fr: Etendre Bake - :keywords lang=fr: interface ligne de commande,development,bake view, bake template syntax,erb tags,asp tags,percent tags diff --git a/vendor/cakephp/bake/docs/fr/index.rst b/vendor/cakephp/bake/docs/fr/index.rst deleted file mode 100644 index c086cac..0000000 --- a/vendor/cakephp/bake/docs/fr/index.rst +++ /dev/null @@ -1,26 +0,0 @@ -Console Bake -############ - -La console Bake de CakePHP est un autre outil permettant de réaliser son -application rapidement. La console Bake peut créer chacun des ingrédients -basiques de CakePHP : models, behaviors, views, helpers, controllers, -components, cas de tests, fixtures et plugins. Et nous ne parlons pas -seulement des squelettes de classes : Bake peut créer une application -fonctionnelle complète en seulement quelques minutes. En réalité, Bake est une -étape naturelle à suivre une fois qu'une application a été prototypée. - -Installation -============ - -Avant d'essayer d'utiliser ou d'étendre bake, assurez-vous qu'il est installé -dans votre application. Bake est disponible en tant que plugin que vous pouvez -installer avec Composer:: - - composer require --dev cakephp/bake:~1.0 - -Ceci va installer bake en tant que dépendance de développement. Cela signifie -qu'il ne sera pas installé lors d'un déploiement en production. - -.. meta:: - :title lang=fr: Console Bake - :keywords lang=fr: interface ligne de commande,development,bake view, bake template syntaxe,erb tags,asp tags,percent tags diff --git a/vendor/cakephp/bake/docs/fr/usage.rst b/vendor/cakephp/bake/docs/fr/usage.rst deleted file mode 100644 index 56e891a..0000000 --- a/vendor/cakephp/bake/docs/fr/usage.rst +++ /dev/null @@ -1,108 +0,0 @@ -Génération de Code avec Bake -############################ - -Suivant la configuration de votre installation, vous devrez peut être donner -les droits d'exécution au script bash cake ou l'appeler avec la commande -``./bin/cake bake``. -La console cake est exécutée en utilisant le CLI PHP -(Interface de Ligne de Commande). Si vous avez des problèmes en exécutant ce -script, vérifiez que : - -#. le CLI PHP est installé et qu'il a les bons modules activés (ex: MySQL, intl). -#. Certains utilisateurs peuvent aussi rencontrer des problèmes si la base de - données host est 'localhost' et devront essayer '127.0.0.1' à la place. -#. Selon la configuration de votre ordinateur, vous devrez peut-être permettre - l'exécution du script bash pour permettre de lancer ``bin/cake bake``. - -Avant de lancer bake, vous devrez vous assurer qu'au moins une connection à une -base de données est configurée. - -Si vous exécutez la commande sans argument, ``bin/cake bake`` affichera la liste -des tâches disponibles. Vous devriez voir quelque chose comme ceci:: - - $ bin/cake bake - - Welcome to CakePHP v3.x.x Console - --------------------------------------------------------------- - App : src - Path: /var/www/cakephp.dev/src/ - --------------------------------------------------------------- - Les commandes suivantes avec lesquelles vous pouvez générer un squelette de - code pour votre application. - - Les commandes disponibles de bake: - - - all - - behavior - - cell - - component - - controller - - fixture - - form - - helper - - mailer - - migration - - migration_snapshot - - model - - plugin - - shell - - shell-helper - - template - - test - - En utilisant `cake bake [name]` vous pouvez faire appel à une tâche - spécifique de bake. - -Vous pouvez obtenir plus d'informations sur ce que chaque tâche fait et les -options disponibles en utilisant l'option ``--help``:: - - $ bin/cake bake controller --help - - Welcome to CakePHP v3.x.x Console - --------------------------------------------------------------- - App : src - Path: /var/www/cakephp.dev/src/ - --------------------------------------------------------------- - Bake a controller skeleton. - - Usage: - cake bake controller [subcommand] [options] [] - - Subcommands: - - all Bake all controllers with CRUD methods. - - To see help on a subcommand use `cake bake controller [subcommand] --help` - - Options: - - --help, -h Display this help. - --verbose, -v Enable verbose output. - --quiet, -q Enable quiet output. - --plugin, -p Plugin to bake into. - --force, -f Force overwriting existing files without prompting. - --connection, -c The datasource connection to get data from. - (default: default) - --theme, -t The theme to use when baking code. - --components The comma separated list of components to use. - --helpers The comma separated list of helpers to use. - --prefix The namespace/routing prefix to use. - --no-test Do not generate a test skeleton. - --no-actions Do not generate basic CRUD action methods. - - Arguments: - - name Name of the controller to bake. Can use Plugin.name to bake - controllers into plugins. (optional) - -Themes de Bake -============== - -L'option theme est commune à toutes les commandes de bake, et permet de changer -les fichiers de template utilisés lors de la création avec bake. Pour créer vos -propres templates, référez-vous :ref:`à la documentation sur la création de -theme bake `. - -.. meta:: - :title lang=fr: Génération de Code avec Bake - :keywords lang=fr: interface ligne de commande,application fonctionnelle,base de données,configuration base de données,bash script,ingredients basiques,project,model,path path,génération de code,scaffolding,windows users,configuration file,few minutes,config,iew,shell,models,running,mysql diff --git a/vendor/cakephp/bake/docs/ja/conf.py b/vendor/cakephp/bake/docs/ja/conf.py deleted file mode 100644 index 5871da6..0000000 --- a/vendor/cakephp/bake/docs/ja/conf.py +++ /dev/null @@ -1,9 +0,0 @@ -import sys, os - -# Append the top level directory of the docs, so we can import from the config dir. -sys.path.insert(0, os.path.abspath('..')) - -# Pull in all the configuration options defined in the global config file.. -from config.all import * - -language = 'ja' diff --git a/vendor/cakephp/bake/docs/ja/contents.rst b/vendor/cakephp/bake/docs/ja/contents.rst deleted file mode 100644 index 08c3e95..0000000 --- a/vendor/cakephp/bake/docs/ja/contents.rst +++ /dev/null @@ -1,7 +0,0 @@ -.. toctree:: - :maxdepth: 2 - :caption: CakePHP Bake - - /index - /usage - /development diff --git a/vendor/cakephp/bake/docs/ja/development.rst b/vendor/cakephp/bake/docs/ja/development.rst deleted file mode 100644 index 75ffc54..0000000 --- a/vendor/cakephp/bake/docs/ja/development.rst +++ /dev/null @@ -1,301 +0,0 @@ -Bake の拡張 -########### - -Bake は、アプリケーションやプラグインが基本機能に対して変更または追加を可能にする -拡張可能なアーキテクチャーを備えています。Bake は、 `Twig `_ -テンプレートエンジンを使用したビュークラスを利用します。 - -Bake イベント -============= - -``BakeView`` は、ビュークラスとして、他のビュークラスと同様のイベントに加え、 -1つの特別な初期化 (initialize) イベントを発します。しかし、一方で標準ビュークラスは、 -イベントのプレフィックス "View." を使用しますが、 ``BakeView`` は、 -イベントのプレフィックス "Bake." を使用しています。 - -初期化イベントは、すべての bake の出力に対して変更を加えるために使用できます。 -例えば、bake ビュークラスに他のヘルパーを追加するためにこのイベントは使用されます。 :: - - on('Bake.initialize', function (Event $event) { - $view = $event->getSubject(); - - // bake テンプレートの中で MySpecial ヘルパーの使用を可能にします - $view->loadHelper('MySpecial', ['some' => 'config']); - - // そして、$author 変数を利用可能にするために追加 - $view->set('author', 'Andy'); - - }); - -別のプラグインの中から bake を変更したい場合は、プラグインの ``config/bootstrap.php`` -ファイルでプラグインの Bake イベントを置くことは良いアイデアです。 - -Bake イベントは、既存のテンプレートに小さな変更を行うための便利なことができます。 -例えば、コントローラーやテンプレートファイルを bake する際に使用される変数名を -変更するために、bake テンプレートで使用される変数を変更するために -``Bake.beforeRender`` で呼び出される関数を使用することができます。 :: - - on('Bake.beforeRender', function (Event $event) { - $view = $event->getSubject(); - - // indexes の中のメインデータ変数に $rows を使用 - if ($view->get('pluralName')) { - $view->set('pluralName', 'rows'); - } - if ($view->get('pluralVar')) { - $view->set('pluralVar', 'rows'); - } - - // view と edit の中のメインデータ変数に $theOne を使用 - if ($view->get('singularName')) { - $view->set('singularName', 'theOne'); - } - if ($view->get('singularVar')) { - $view->set('singularVar', 'theOne'); - } - - }); - -特定の生成されたファイルへの ``Bake.beforeRender`` と ``Bake.afterRender`` -イベントを指定することもあるでしょう。例えば、 -**Controller/controller.twig** ファイルから生成する際、 UsersController -に特定のアクションを追加したい場合、以下のイベントを使用することができます。 :: - - on( - 'Bake.beforeRender.Controller.controller', - function (Event $event) { - $view = $event->getSubject(); - if ($view->viewVars['name'] == 'Users') { - // Users コントローラーに login と logout を追加 - $view->viewVars['actions'] = [ - 'login', - 'logout', - 'index', - 'view', - 'add', - 'edit', - 'delete' - ]; - } - } - ); - -特定の bake テンプレートのためのイベントリスナーを指定することによって、 -bake 関連のイベント・ロジックを簡素化し、テストするのが容易であるコールバックを -提供することができます。 - -Bake テンプレート構文 -===================== - -Bake テンプレートファイルは、 `Twig `__ -テンプレート構文を使用します。 - -bake テンプレートがどのように動作するかを確認/理解する一つの方法は、 -bake テンプレートファイルを変更しようとする場合は特に、クラスを bake して、 -アプリケーションの **tmp/bake** フォルダー内に残っている前処理されたテンプレートファイルを -使ったテンプレートと比較することです。 - -だから、例えば、以下のようにシェルを bake した場合: - -.. code-block:: bash - - bin/cake bake shell Foo - -(**vendor/cakephp/bake/src/Template/Bake/Shell/shell.twig**) を使用した -テンプレートは、以下のようになります。 :: - - `` Bake テンプレートの PHP 終了タグ - * ``<%=`` Bake テンプレートの PHP ショートエコータグ - * ``<%-`` Bake テンプレートの PHP 開始タグ、タグの前に、先頭の空白を除去 - * ``-%>`` Bake テンプレートの PHP 終了タグ、タグの後に末尾の空白を除去 - -.. _creating-a-bake-theme: - -Bake テーマの作成 -================= - -"bake" コマンドによって生成された出力を変更したい場合、bake が使用するテンプレートの -一部または全部を置き換えることができる、独自の bake の「テーマ」を作成することができます。 -これを行うための最善の方法は、次のとおりです。 - -#. 新しいプラグインを bake します。プラグインの名前は bake の「テーマ」名になります。 -#. 新しいディレクトリー **plugins/[name]/src/Template/Bake/Template/** を作成します。 -#. **vendor/cakephp/bake/src/Template/Bake/Template** から上書きしたい - テンプレートをあなたのプラグインの中の適切なファイルにコピーしてください。 -#. bake を実行するときに、必要であれば、 bake のテーマを指定するための ``--theme`` - オプションを使用してください。各呼び出しでこのオプションを指定しなくても済むように、 - カスタムテーマをデフォルトテーマとして使用するように設定することもできます。 :: - - Test->classSuffixes[$this->name()])) { - $this->Test->classSuffixes[$this->name()] = 'Foo'; - } - - $name = ucfirst($this->name()); - if (!isset($this->Test->classTypes[$name])) { - $this->Test->classTypes[$name] = 'Foo'; - } - - return parent::bakeTest($className); - } - -* **class suffix** は ``bake`` 呼び出しで与えられた名前に追加します。前の例では、 - ``ExampleFooTest.php`` ファイルを作成します。 -* **class type** は、(あなたが bake するアプリやプラグインに関連する) - あなたのファイルを導くために使用されるサブ名前空間です。 - 前の例では、名前空間 ``App\Test\TestCase\Foo`` でテストを作成します。 - -.. meta:: - :title lang=ja: Bake の拡張 - :keywords lang=ja: command line interface,development,bake view, bake template syntax,twig,erb tags,percent tags diff --git a/vendor/cakephp/bake/docs/ja/index.rst b/vendor/cakephp/bake/docs/ja/index.rst deleted file mode 100644 index a37f45b..0000000 --- a/vendor/cakephp/bake/docs/ja/index.rst +++ /dev/null @@ -1,28 +0,0 @@ -Bake コンソール -################ - -CakePHP の bake コンソールは、迅速に CakePHP を動作させるまでを支援します。 -bake コンソールは、CakePHP の基本的な素材(モデル、ビヘイビアー、ビュー、ヘルパー、 -コントローラー、コンポーネント、テストケース、フィクスチャー、プラグイン)を作成できます。 -その為のスケルトンクラスについては、ここでは省略しますが、 -bake は数分で完全に機能するアプリケーションを作成できます。 -要するに、bake は足場の組まれたアプリケーションをいっぺんに手に入れるためにうってつけの方法です。 - -インストール手順 -================= - -bake を使用したり拡張する前に、アプリケーションに bake をインストールしておいてください。 -bake は Composer を使ってインストールするプラグインとして提供されています。 :: - - composer require --dev cakephp/bake:~1.0 - -上記のコマンドは、bake を開発環境で使用するパッケージとしてインストールします。 -この入れ方の場合、本番環境としてデプロイする際には、 bake はインストールされません。 - -Twig テンプレートを使用する場合、 ``WyriHaximus/TwigView`` プラグインをブートストラップとともに -読み込んでいることを確認してください。それを完全に省略して、 -Bake プラグインにこのプラグインを読み込ませることもできます。 - -.. meta:: - :title lang=ja: Bakeコンソール - :keywords lang=ja: コマンドライン,CLI,development,bake view, bake template syntax,erb tags,asp tags,percent tags diff --git a/vendor/cakephp/bake/docs/ja/usage.rst b/vendor/cakephp/bake/docs/ja/usage.rst deleted file mode 100644 index d9470e6..0000000 --- a/vendor/cakephp/bake/docs/ja/usage.rst +++ /dev/null @@ -1,102 +0,0 @@ -Bake でコード生成 -################## - -cake コンソールは、 PHP CLI (command line interface) で実行します。 -もしスクリプトの実行に問題があるなら、以下を満たしてください。 - -#. PHP CLI がインストールされているか適切なモジュールが有効か確認してください (例:MySQL, intl)。 -#. データベースのホストが 'localhost' で問題があるなら、代わりに '127.0.0.1' を使って下さい。 - PHP CLI でこの問題がおこる可能性があります。 -#. 使っているコンピューターの設定に応じて、 ``bin/cake bake`` で使用する cake bash スクリプトの - 実行権限を設定する必要があります。 - -bake を実行する前にデータベースとの接続を確認しましょう。 - -``bin/cake bake`` を引数無しで実行すると可能なタスクを表示できます。 - -Windows システムの場合、 ``bin\cake bake`` を試してみてください。 - -それは以下のように表示されます。 :: - - $ bin/cake bake - - Welcome to CakePHP v3.1.6 Console - --------------------------------------------------------------- - App : src - Path: /var/www/cakephp.dev/src/ - PHP: 5.5.8 - --------------------------------------------------------------- - The following commands can be used to generate skeleton code for your application. - - Available bake commands: - - - all - - behavior - - cell - - component - - controller - - fixture - - form - - helper - - mailer - - migration - - migration_snapshot - - model - - plugin - - shell - - shell-helper - - template - - test - - By using `cake bake [name]` you can invoke a specific bake task. - -より詳しい各コマンドの情報を得るには、 ``--help`` オプションをつけ実行してください。 :: - - $ bin/cake bake controller --help - - Welcome to CakePHP v3.1.6 Console - --------------------------------------------------------------- - App : src - Path: /var/www/cakephp.dev/src/ - --------------------------------------------------------------- - Bake a controller skeleton. - - Usage: - cake bake controller [subcommand] [options] [] - - Subcommands: - - all Bake all controllers with CRUD methods. - - To see help on a subcommand use `cake bake controller [subcommand] --help` - - Options: - - --help, -h Display this help. - --verbose, -v Enable verbose output. - --quiet, -q Enable quiet output. - --plugin, -p Plugin to bake into. - --force, -f Force overwriting existing files without prompting. - --connection, -c The datasource connection to get data from. - (default: default) - --theme, -t The theme to use when baking code. - --components The comma separated list of components to use. - --helpers The comma separated list of helpers to use. - --prefix The namespace/routing prefix to use. - --no-test Do not generate a test skeleton. - --no-actions Do not generate basic CRUD action methods. - - Arguments: - - name Name of the controller to bake. Can use Plugin.name to bake - controllers into plugins. (optional) - -Bake テーマオプション -===================== - -テーマオプションは全 bake コマンドで一般的です。また、bake テンプレートファイルを変更することができます。 -テーマを作るには、 :ref:`Bake テーマ作成ドキュメント ` をご覧ください。 - -.. meta:: - :title lang=ja: Code Generation with Bake - :keywords lang=ja: command line interface,functional application,database,database configuration,bash script,basic ingredients,project,model,path path,code generation,scaffolding,windows users,configuration file,few minutes,config,iew,shell,models,running,mysql diff --git a/vendor/cakephp/bake/docs/pt/conf.py b/vendor/cakephp/bake/docs/pt/conf.py deleted file mode 100644 index 9e22cb0..0000000 --- a/vendor/cakephp/bake/docs/pt/conf.py +++ /dev/null @@ -1,9 +0,0 @@ -import sys, os - -# Append the top level directory of the docs, so we can import from the config dir. -sys.path.insert(0, os.path.abspath('..')) - -# Pull in all the configuration options defined in the global config file.. -from config.all import * - -language = 'pt' diff --git a/vendor/cakephp/bake/docs/pt/contents.rst b/vendor/cakephp/bake/docs/pt/contents.rst deleted file mode 100644 index 08c3e95..0000000 --- a/vendor/cakephp/bake/docs/pt/contents.rst +++ /dev/null @@ -1,7 +0,0 @@ -.. toctree:: - :maxdepth: 2 - :caption: CakePHP Bake - - /index - /usage - /development diff --git a/vendor/cakephp/bake/docs/pt/development.rst b/vendor/cakephp/bake/docs/pt/development.rst deleted file mode 100644 index eeab55e..0000000 --- a/vendor/cakephp/bake/docs/pt/development.rst +++ /dev/null @@ -1,280 +0,0 @@ -Extendendo o Bake -################# - -Bake fornece uma extenssiva arquitetura que permite a sua aplicação ou plugin ser modificado ou adicionar funcionalidades as bases. Bake faz uso de uma classe view dedicada que usa o `Twig `_ engine de templates. - -Eventos do Bake -=============== - -Como uma class view , ``BakeView`` emite o mesmo evento como qualquer outra classe view, -mais uma extra que inicializa eventos. No entanto, onde classe view padrão usa o prefixo "View.", ``BakeView`` usa o prefixo "Bake.". - -O inicializador de eventos pode ser usado para fazer mudanças quando aplicadoa toda a saida do bake -, por exemplo ao adicionar outro helper ao bake view class este evebti oide ser usado:: - - on('Bake.initialize', function (Event $event) { - $view = $event->getSubject(); - - // No meu bake de templates, permite uso de MuSpecial helper - $view->loadHelper('MySpecial', ['some' => 'config']); - - // E adicionar uma variável $author então este estará sempre disponível - $view->set('author', 'Andy'); - - }); - -Se você quer modificar o seu bake apartir de outro pugin, coloque o bake do seu plugin dentro do arquivo do seu próprio plugin ``config/bootstrap.php`` será uma boa ideia. - -Os eventos do Bake podem ser úteis para fazer pequenas alterações nos modelos existentes. -Por exemplo, para alterar os nomes das variáveis usados quando o controlador / modelo de baking -arquivos podem usar uma função ouvindo ``Bake.beforeRender`` para modificar as variaveis usadas no bake templates:: - - on('Bake.beforeRender', function (Event $event) { - $view = $event->getSubject(); - - // Use $ rows para a variável de dados principal em índices - if ($view->get('pluralName')) { - $view->set('pluralName', 'rows'); - } - if ($view->get('pluralVar')) { - $view->set('pluralVar', 'rows'); - } - - // Use $ theOne para a variável de dados principal em exibição / edição - if ($view->get('singularName')) { - $view->set('singularName', 'theOne'); - } - if ($view->get('singularVar')) { - $view->set('singularVar', 'theOne'); - } - - }); - -Você também pode abranger o ``Bake.beforeRender`` e ``Bake.afterRender`` eventos para um arquivo gerado específico. Por exemplo, se você quiser adicionar ações específicas para seu UsersController ao gerar a partir de um arquivo **Controller/controller.twig**, -você pode usar o seguinte evento:: - - on( - 'Bake.beforeRender.Controller.controller', - function (Event $event) { - $view = $event->getSubject(); - if ($view->viewVars['name'] == 'Users') { - // adicionar ações de login e logout ao Users controller - $view->viewVars['actions'] = [ - 'login', - 'logout', - 'index', - 'view', - 'add', - 'edit', - 'delete' - ]; - } - } - ); - -Ao adicionar eventos que escutam o seu bake de templates, você pode simplesmente relacionar a sua logica de eventos com o bake e fornecer callbacks que são facilmente testáveis. - -Sintaxe de Templates do Bake -============================ - -Bake arquivos de template usa a sintaxe `Twig `__ de templates . - -Uma forma de ver/entender como o bake de templates funciona, especialmente quando tentamos modificar os arquivos de templates, é executar o bake de uma classe que compara o template usado com o template pré processado deixado anteriormente pela aplicação - -**tmp/bake** folder. - -Então, por exemplo, quando baking a shell é como? - -.. code-block:: bash - - bin/cake bake shell Foo - -O template usado (**vendor/cakephp/bake/src/Template/Bake/Shell/shell.twig**) -parece com algo assim:: - - `` Um template bake php fecha a tag - * ``<%=`` Um template bake php short-echo tag - * ``<%-`` Um template bake php abre a tag, revirando qualquer espaço em branco antes da tag - * ``-%>`` Um template bake php fecha a tag, revirando qualqualquer espaço em branco após a tag - -.. _creating-a-bake-theme: - -Criando um Tema Bake -===================== - -Se você deseja modificar a saída produzida com o comando bake, você pode criar o seu próprio tema para o bake, aos quais permitirá a você subsituir algum ou todos os tempaltes que o bake usa. o mmelhor jeito de fazer isto é: - -#. Bake um novo plugin. O nome do plugin é o bake 'nome do tema' -#. Crie uma nova pasta em **plugins/[name]/src/Template/Bake/Template/**. -#. Copie qualquer template que você queira para sobrescrer de - **vendor/cakephp/bake/src/Template/Bake/Template** que feche com os arquivos no seu plugin. -#. Quando executando o bake use a opção ``--theme`` para especificar qual o tema que o bake deve usar - . Para evitar problemas com esta opção, em cada chamada, você tambem pode definir o seu template customizado para ser usado como o template padrão:: - - Test->classSuffixes[$this->name()])) { - $this->Test->classSuffixes[$this->name()] = 'Foo'; - } - - $name = ucfirst($this->name()); - if (!isset($this->Test->classTypes[$name])) { - $this->Test->classTypes[$name] = 'Foo'; - } - - return parent::bakeTest($className); - } - -* A **class suffix** vai se indexado ao mesmo nome providenciado por você na sua chamada de ``bake`` - . No exemplo anterior, isto criaria o arquivo ``ExampleFooTest.php`` . -* O **class type** vai ser o sub namespace usado para o seu arquivo (relativo ao aplicativo ou plugin que vocês está baking). No exemplo anterior, isto poderia criar o seu teste com o namespace ``App\Test\TestCase\Foo`` - -.. meta:: - :title lang=en: Extending Bake - :keywords lang=en: command line interface,development,bake view, bake template syntax,twig,erb tags,percent tags - diff --git a/vendor/cakephp/bake/docs/pt/index.rst b/vendor/cakephp/bake/docs/pt/index.rst deleted file mode 100644 index f4ebdf0..0000000 --- a/vendor/cakephp/bake/docs/pt/index.rst +++ /dev/null @@ -1,25 +0,0 @@ -Bake Console -############ - -O bake console do CakePHP é outro empenho para você ter o CakePHP configurado -e funcionando rápido. O bake console pode criar qualquer ingrediente básico do -CakePHP: models, behaviors, views, helpers, components, test cases, fixtures e -plugins. E nós não estamos apenas falando de classes esqueleto: O Bake pode -criar uma aplicação totalmente funcional em questão de minutos. De fato, o Bake -é um passo natural a se dar uma vez que a aplicação tem seu alicerce construído. - -Instalação -========== - -Antes de tentar usar ou extender o bake, tenha certeza que ele está instalado em -sua aplicação. O bake é distribuído como um plugin que você pode instalar com o -Composer:: - - composer require --dev cakephp/bake:~1.0 - -Isto irá instalar o bake como uma dependência de desenvolvimento, sendo assim, -não instalado quando em um ambiente de produção. - -.. meta:: - :title lang=pt: Bake Console - :keywords lang=pt: cli,linha de comando,command line,dev,desenvolvimento,bake view, bake syntax,erb tags,asp tags,percent tags diff --git a/vendor/cakephp/bake/docs/pt/usage.rst b/vendor/cakephp/bake/docs/pt/usage.rst deleted file mode 100644 index 79d0323..0000000 --- a/vendor/cakephp/bake/docs/pt/usage.rst +++ /dev/null @@ -1,130 +0,0 @@ -Geração de código com bake -########################## - -O console do cake é executado usando a CLI do PHP (interface da linha de comando). -Se você tiver problemas para executar o script, assegure-se de que: - -#. Você instalou a CLI do PHP e possui os módulos apropriados habilitados (por - exemplo: MySQL, intl). -#. Os usuários também podem ter problemas se o host do banco de dados for - 'localhost' e deve tentar '127.0.0.1', em vez disso, como localhost pode - causar problemas com CLI PHP. -#. Dependendo de como o seu computador está configurado, você pode ter que - definir direitos de execução no script cake bash para chamá-lo usando - ``bin/cake bake``. - -Antes de executar o Bake você deve certificar-se de ter pelo menos um banco de dados -conexão configurada. - -Quando executado sem argumentos ``bin/cake bake`` irá exibir uma lista de -tarefas. Você deve ver algo como:: - - $ bin/cake bake - - Welcome to CakePHP v3.4.6 Console - --------------------------------------------------------------- - App : src - Path: /var/www/cakephp.dev/src/ - PHP : 5.6.20 - --------------------------------------------------------------- - The following commands can be used to generate skeleton code for your application. - - Available bake commands: - - - all - - behavior - - cell - - component - - controller - - fixture - - form - - helper - - mailer - - migration - - migration_diff - - migration_snapshot - - model - - plugin - - seed - - shell - - shell_helper - - task - - template - - test - - By using `cake bake [name]` you can invoke a specific bake task. - -Você pode obter mais informações sobre o que cada tarefa faz e quais são as opções -disponível usando o ``--help`` option:: - - $ bin/cake bake --help - - Welcome to CakePHP v3.4.6 Console - --------------------------------------------------------------- - App : src - Path: /var/www/cakephp.dev/src/ - PHP : 5.6.20 - --------------------------------------------------------------- - The Bake script generates controllers, models and template files for - your application. If run with no command line arguments, Bake guides the - user through the class creation process. You can customize the - generation process by telling Bake where different parts of your - application are using command line arguments. - - Usage: - cake bake.bake [subcommand] [options] - - Subcommands: - - all Bake a complete MVC skeleton. - behavior Bake a behavior class file. - cell Bake a cell class file. - component Bake a component class file. - controller Bake a controller skeleton. - fixture Generate fixtures for use with the test suite. You - can use `bake fixture all` to bake all fixtures. - form Bake a form class file. - helper Bake a helper class file. - mailer Bake a mailer class file. - migration Bake migration class. - migration_diff Bake migration class. - migration_snapshot Bake migration snapshot class. - model Bake table and entity classes. - plugin Create the directory structure, AppController class - and testing setup for a new plugin. Can create - plugins in any of your bootstrapped plugin paths. - seed Bake seed class. - shell Bake a shell class file. - shell_helper Bake a shell_helper class file. - task Bake a task class file. - template Bake views for a controller, using built-in or - custom templates. - test Bake test case skeletons for classes. - - To see help on a subcommand use `cake bake.bake [subcommand] --help` - - Options: - - --connection, -c Database connection to use in conjunction with `bake - all`. (default: default) - --everything Bake a complete MVC skeleton, using all the available - tables. Usage: "bake all --everything" - --force, -f Force overwriting existing files without prompting. - --help, -h Display this help. - --plugin, -p Plugin to bake into. - --prefix Prefix to bake controllers and templates into. - --quiet, -q Enable quiet output. - --tablePrefix Table prefix to be used in models. - --theme, -t The theme to use when baking code. (choices: - Bake|Migrations) - --verbose, -v Enable verbose output. - -Temas para o Bake -================= - -A opção de tema é comum a todos os comandos do bake, e permite mudar os arquivos de modelo usados no bake. Para criar seus próprios modelos, veja a -:ref:`documentação de criação de themes para o bake `. - -.. meta:: - :title lang=pt: Geração de código com bake - :keywords lang=pt: command line interface,functional application,database,database configuration,bash script,basic ingredients,project,model,path path,code generation,scaffolding,windows users,configuration file,few minutes,config,iew,shell,models,running,mysql diff --git a/vendor/cakephp/bake/docs/ru/conf.py b/vendor/cakephp/bake/docs/ru/conf.py deleted file mode 100644 index f8a170e..0000000 --- a/vendor/cakephp/bake/docs/ru/conf.py +++ /dev/null @@ -1,9 +0,0 @@ -import sys, os - -# Append the top level directory of the docs, so we can import from the config dir. -sys.path.insert(0, os.path.abspath('..')) - -# Pull in all the configuration options defined in the global config file.. -from config.all import * - -language = 'ru' diff --git a/vendor/cakephp/bake/docs/ru/contents.rst b/vendor/cakephp/bake/docs/ru/contents.rst deleted file mode 100644 index 08c3e95..0000000 --- a/vendor/cakephp/bake/docs/ru/contents.rst +++ /dev/null @@ -1,7 +0,0 @@ -.. toctree:: - :maxdepth: 2 - :caption: CakePHP Bake - - /index - /usage - /development diff --git a/vendor/cakephp/bake/docs/ru/development.rst b/vendor/cakephp/bake/docs/ru/development.rst deleted file mode 100644 index 5b7de8e..0000000 --- a/vendor/cakephp/bake/docs/ru/development.rst +++ /dev/null @@ -1,293 +0,0 @@ -Расширение возможностей Bake -############################ - -Bake имеет расширяемую архитектуру, которая позволяет вашему приложению или плагинам -измененять или добавления его базовую функциональность. Bake использует специальный -класс, который использует механизм шаблонизатора `Twig `_. - -События Bake -============ - -В качестве класса представления ``BakeView`` генерирует те же события, что и любой другой класс представления, -плюс одно дополнительное событие инициализации. Однако, в то время как классы стандартного представления используют -префикс события "View.", ``BakeView`` использует префикс события "Bake.". - -Событие initialize можно использовать для внесения изменений, которые применяются ко всем 'испеченным' -выводам, например, чтобы добавить другого помощника в класс вида bake, это событие может -использовать следующее:: - - on('Bake.initialize', function (Event $event) { - $view = $event->getSubject(); - - // В моих шаблонах bake, разрешить использование MySpecial helper - $view->loadHelper('MySpecial', ['some' => 'config']); - - // И добавьте переменную $author, чтобы она всегда была доступна - $view->set('author', 'Andy'); - - }); - -Если вы хотите изменить выпечку из другого плагина, хорошей идеей будет - поместить -события своего плагина в файл ``config/bootstrap.php``. - -События Bake могут быть полезны для внесения небольших изменений в существующие шаблоны. -Например, чтобы изменить имена переменных, используемых для выпечки файлов контроллеров/шаблонов, -можно использовать прослушивающую функцию ``Bake.beforeRender``:: - - on('Bake.beforeRender', function (Event $event) { - $view = $event->getSubject(); - - // Использовать $rows для основной переменной данных для индекса (index) - if ($view->get('pluralName')) { - $view->set('pluralName', 'rows'); - } - if ($view->get('pluralVar')) { - $view->set('pluralVar', 'rows'); - } - - // Используйте $theOne для основной переменной данных для просмотра/редактирования (view/edit) - if ($view->get('singularName')) { - $view->set('singularName', 'theOne'); - } - if ($view->get('singularVar')) { - $view->set('singularVar', 'theOne'); - } - - }); - -Вы также можете использовать события ``Bake.beforeRender`` и ``Bake.afterRender`` для -генерирования специфичного файла. Например, если вы хотите добавить определенные действия для -вашего UserController при генерации из файла **Controller/controller.twig**, -вы можете использовать следующее событие:: - - on( - 'Bake.beforeRender.Controller.controller', - function (Event $event) { - $view = $event->getSubject(); - if ($view->viewVars['name'] == 'Users') { - // добавим действия входа и выхода из системы в контроллер пользователей - $view->viewVars['actions'] = [ - 'login', - 'logout', - 'index', - 'view', - 'add', - 'edit', - 'delete' - ]; - } - } - ); - -При просмотре прослушивателей событий для конкретных шаблонов выпечки вы можете упростить -выпечку связанной логики событий и обеспечить обратные вызовы, которые легче тестировать. - -Синтаксис шаблона выпечки -========================= - -Файлы шаблонов Bake используют синтаксис шаблонизатора `Twig `__. - -Один из способов увидеть/понять, как работают шаблоны выпечки, особенно при попытке -изменить файлы шаблонов выпечки, это - испечь класс и сравнить используемый шаблон -с предварительно обработанным файлом шаблона, который остаётся в приложении в папке -**tmp/bake**. - -Так, например, при выпечке такой оболочки: - -.. code-block:: bash - - bin/cake bake shell Foo - -Используемый шаблон (**vendor/cakephp/bake/src/Template/Bake/Shell/shell.twig**) -будет выглядеть так:: - - `` Bake шаблон закрывающего тега php - * ``<%=`` Bake шаблон php короткого php тега echo - * ``<%-`` Bake шаблон php открытия тега, удаляющего любые введённые пробелы перед тегом - * ``-%>`` Bake шаблон php закрытия тега, любые введённые пробелы после тега - -.. _creating-a-bake-theme: - -Создание темы Bake -================== - -Если вы хотите изменить результат, полученный командой "bake", вы можете -создать свою собственную тему('theme') для "bake", которая позволит вам заменить некоторые или все -шаблоны, которые испекает bake. Лучше всего сделать это так: - -#. Выпечь новый плагин. Имя плагина - это название темы 'bake' -#. Создать новую диреткорию **plugins/[name]/src/Template/Bake/Template/**. -#. Скопируйте любые шаблоны, которые вы хотите переопределить - **vendor/cakephp/bake/src/Template/Bake/Template** для сопоставления файлов с вашим плагином. -#. При запуске выпечки используйте параметр ``--theme``, чтобы указать тему выпечки которую вы - хотите использовать. Чтобы избежать необходимости указывать этот параметр в каждом вызове, вы также можете - настроить свою тему в качестве темы по умолчанию:: - - Test->classSuffixes[$this->name()])) { - $this->Test->classSuffixes[$this->name()] = 'Foo'; - } - - $name = ucfirst($this->name()); - if (!isset($this->Test->classTypes[$name])) { - $this->Test->classTypes[$name] = 'Foo'; - } - - return parent::bakeTest($className); - } - -* **Суффикс класса** будет добавлен к имени, указанному в вашем вызове ``bake``. - В предыдущем примере он создал бы файл ``ExampleFooTest.php``. - -* **Тип файла** будет использовать пространство под-пространство имён(sub-namespace), которое приведёт к файлу (относительно приложения или подключаемого модуля). В предыдущем примере, он создаст ваш тест с пространством имен ``App\Test\TestCase\Foo``. - -.. meta:: - :title lang=ru: Расширение возможностей Bake - :keywords lang=ru: интерфейс командной строки, разработка, выпечка, синтаксис шаблона выпечки, твинг, метки erb, процентные теги diff --git a/vendor/cakephp/bake/docs/ru/index.rst b/vendor/cakephp/bake/docs/ru/index.rst deleted file mode 100644 index 0b9c1bc..0000000 --- a/vendor/cakephp/bake/docs/ru/index.rst +++ /dev/null @@ -1,24 +0,0 @@ -Консоль Bake -############ - -Bake консоль CakePHP - это еще один инструмент для быстрой разработки на фреймворке CakePHP. -Консоль Bake может создать любой из базовых компонентов или все сразу: models, -behaviors, views, helpers, controllers, components, test cases, fixtures и plugins. -Речь идет не только о каркасе приложения: Bake консоль создает полностью функционирующее приложение всего за пару минут. - -Bake это естественный шаг для статической генерации кода. - -Установка -========= - -Перед тем, как использовать Bake, убедитесь, что он установлен в вашем приложении. -Bake это отдельный плагин и вы можете установить его с помощью Composer:: - - composer require --dev cakephp/bake:~1.0 - -Команда выше установит Bake в зависимости от разработки. -Это значит, что Bake не будет установлен, когда вы делаете деплой на продакшн сервер. - -.. meta:: - :title lang=ru: Консоль Bake - :keywords lang=ru: интерфейс командной строки,разработка,bake view, bake template syntax,erb tags,asp tags,percent tags diff --git a/vendor/cakephp/bake/docs/ru/usage.rst b/vendor/cakephp/bake/docs/ru/usage.rst deleted file mode 100644 index 8cfd72b..0000000 --- a/vendor/cakephp/bake/docs/ru/usage.rst +++ /dev/null @@ -1,131 +0,0 @@ -Генерация кода с помощью Bake -############################# - -Консоль cake запускается с использованием PHP CLI (интерфейса командной строки). -Если у вас возникли проблемы с запуском скрипта, убедитесь, что: - -#. У вас установлен PHP CLI и что у него есть соответствующие включённые модули - (например: MySQL, intl). -#. У пользователей также могут быть проблемы, если хост базы данных является - 'localhost' вмеcто этого можно попробовать '127.0.0.1', поскольку localhost - может вызвать проблемы с PHP CLI. -#. В зависимости от того, как настроен ваш компьютер, вам может потребоваться - установить права выполнения на скрипт bash, чтобы вызвать его, используя - ``bin/cake bake``. - -Перед запуском bake вы должны убедиться, что у вас есть хотя бы одна база данных и -соединение настроено. - -При запуске без аргументов ``bin/cake bake`` выводит список доступных -заданий. Вы должны увидеть что-то вроде:: - - $ bin/cake bake - - Welcome to CakePHP v3.4.6 Console - --------------------------------------------------------------- - App : src - Path: /var/www/cakephp.dev/src/ - PHP : 5.6.20 - --------------------------------------------------------------- - The following commands can be used to generate skeleton code for your application. - - Available bake commands: - - - all - - behavior - - cell - - component - - controller - - fixture - - form - - helper - - mailer - - migration - - migration_diff - - migration_snapshot - - model - - plugin - - seed - - shell - - shell_helper - - task - - template - - test - - By using `cake bake [name]` you can invoke a specific bake task. - -Вы можете получить больше дополнительной информации о том, что делает каждая задача, и какие параметры -доступны, если используете ключ ``--help``:: - - $ bin/cake bake --help - - Welcome to CakePHP v3.4.6 Console - --------------------------------------------------------------- - App : src - Path: /var/www/cakephp.dev/src/ - PHP : 5.6.20 - --------------------------------------------------------------- - The Bake script generates controllers, models and template files for - your application. If run with no command line arguments, Bake guides the - user through the class creation process. You can customize the - generation process by telling Bake where different parts of your - application are using command line arguments. - - Usage: - cake bake.bake [subcommand] [options] - - Subcommands: - - all Bake a complete MVC skeleton. - behavior Bake a behavior class file. - cell Bake a cell class file. - component Bake a component class file. - controller Bake a controller skeleton. - fixture Generate fixtures for use with the test suite. You - can use `bake fixture all` to bake all fixtures. - form Bake a form class file. - helper Bake a helper class file. - mailer Bake a mailer class file. - migration Bake migration class. - migration_diff Bake migration class. - migration_snapshot Bake migration snapshot class. - model Bake table and entity classes. - plugin Create the directory structure, AppController class - and testing setup for a new plugin. Can create - plugins in any of your bootstrapped plugin paths. - seed Bake seed class. - shell Bake a shell class file. - shell_helper Bake a shell_helper class file. - task Bake a task class file. - template Bake views for a controller, using built-in or - custom templates. - test Bake test case skeletons for classes. - - To see help on a subcommand use `cake bake.bake [subcommand] --help` - - Options: - - --connection, -c Database connection to use in conjunction with `bake - all`. (default: default) - --everything Bake a complete MVC skeleton, using all the available - tables. Usage: "bake all --everything" - --force, -f Force overwriting existing files without prompting. - --help, -h Display this help. - --plugin, -p Plugin to bake into. - --prefix Prefix to bake controllers and templates into. - --quiet, -q Enable quiet output. - --tablePrefix Table prefix to be used in models. - --theme, -t The theme to use when baking code. (choices: - Bake|Migrations) - --verbose, -v Enable verbose output. - -Темы Bake -========= - -Параметр темы является общим для всех команд bake, так же bake позволяет изменять -файлы шаблонов, используемые при 'выпечке'. Чтобы создать свои собственные шаблоны см. -:ref:`документация по созданию темы`. - -.. meta:: - :title lang=ru: Генерация кода с помощью Bake - :keywords lang=en: command line interface,functional application,database,database configuration,bash script,basic ingredients,project,model,path path,code generation,scaffolding,windows users,configuration file,few minutes,config,iew,shell,models,running,mysql diff --git a/vendor/cakephp/bake/phpcs.xml.dist b/vendor/cakephp/bake/phpcs.xml.dist deleted file mode 100644 index 9e40ece..0000000 --- a/vendor/cakephp/bake/phpcs.xml.dist +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - 0 - - diff --git a/vendor/cakephp/bake/phpstan.neon b/vendor/cakephp/bake/phpstan.neon deleted file mode 100644 index 68b9999..0000000 --- a/vendor/cakephp/bake/phpstan.neon +++ /dev/null @@ -1,7 +0,0 @@ -parameters: - level: 5 - autoload_files: - - tests/bootstrap.php - ignoreErrors: - - '#Call to an undefined method Cake\\Database\\Type::getDateTimeClassName\(\)#' - - '#Parameter \#1 \$size of method .+CollectionInterface::take\(\) expects int, array given.#' diff --git a/vendor/cakephp/bake/src/Plugin.php b/vendor/cakephp/bake/src/Plugin.php deleted file mode 100644 index 2a25b6c..0000000 --- a/vendor/cakephp/bake/src/Plugin.php +++ /dev/null @@ -1,52 +0,0 @@ -addPlugin('WyriHaximus/TwigView'); - } -} diff --git a/vendor/cakephp/bake/src/Shell/BakeShell.php b/vendor/cakephp/bake/src/Shell/BakeShell.php deleted file mode 100644 index 5e666d9..0000000 --- a/vendor/cakephp/bake/src/Shell/BakeShell.php +++ /dev/null @@ -1,332 +0,0 @@ -connection to the active task if a connection param is set. - * - * @return void - */ - public function startup() - { - parent::startup(); - Configure::write('debug', true); - Cache::disable(); - // Loading WyriHaximus/TwigView Plugin through the Plugin::load() for backward compatibility. - if (!Plugin::isLoaded('WyriHaximus/TwigView')) { - Plugin::load('WyriHaximus/TwigView', ['bootstrap' => true]); - } - - $task = $this->_camelize($this->command); - - if (isset($this->{$task}) && !in_array($task, ['Project'])) { - if (isset($this->params['connection'])) { - $this->{$task}->connection = $this->params['connection']; - } - if (isset($this->params['tablePrefix'])) { - $this->{$task}->tablePrefix = $this->params['tablePrefix']; - } - } - if (isset($this->params['connection'])) { - $this->connection = $this->params['connection']; - } - - if ($this->params['quiet']) { - $this->interactive = false; - if (isset($this->{$task}) && !in_array($task, ['Project'])) { - $this->{$task}->interactive = false; - } - } - } - - /** - * Override main() to handle action - * - * @return bool - */ - public function main() - { - if ($this->args && $this->args[0] === 'view') { - $this->out('The view command has been renamed.'); - $this->out('To create template files, please use the template command:', 2); - $args = $this->args; - array_shift($args); - $args = implode($args, ' '); - $this->out(sprintf(' `bin/cake bake template %s`', $args), 2); - - return false; - } - - $connections = ConnectionManager::configured(); - if (empty($connections)) { - $this->out('Your database configuration was not found.'); - $this->out('Add your database connection information to config/app.php.'); - - return false; - } - $this->out('The following commands can be used to generate skeleton code for your application.', 2); - $this->out('Available bake commands:', 2); - $this->out('- all'); - $names = []; - foreach ($this->tasks as $task) { - list(, $name) = pluginSplit($task); - $names[] = Inflector::underscore($name); - } - sort($names); - foreach ($names as $name) { - $this->out('- ' . $name); - } - $this->out(''); - $this->out('By using `cake bake [name]` you can invoke a specific bake task.'); - - return false; - } - - /** - * Locate the tasks bake will use. - * - * Scans the following paths for tasks that are subclasses of - * Cake\Shell\Task\BakeTask: - * - * - Cake/Shell/Task/ - * - Shell/Task for each loaded plugin - * - App/Shell/Task/ - * - * @return bool - */ - public function loadTasks() - { - $tasks = []; - - foreach (Plugin::loaded() as $plugin) { - $tasks = $this->_findTasks( - $tasks, - Plugin::classPath($plugin), - str_replace('/', '\\', $plugin), - $plugin - ); - } - $tasks = $this->_findTasks($tasks, APP, Configure::read('App.namespace')); - - $this->tasks = array_values($tasks); - - return parent::loadTasks(); - } - - /** - * Append matching tasks in $path to the $tasks array. - * - * @param array $tasks The task list to modify and return. - * @param string $path The base path to look in. - * @param string $namespace The base namespace. - * @param string|null $prefix The prefix to append. - * @return array Updated tasks. - */ - protected function _findTasks($tasks, $path, $namespace, $prefix = null) - { - $path .= 'Shell/Task'; - if (!is_dir($path)) { - return $tasks; - } - $candidates = $this->_findClassFiles($path, $namespace); - $classes = $this->_findTaskClasses($candidates); - foreach ($classes as $class) { - list(, $name) = namespaceSplit($class); - $name = substr($name, 0, -4); - $fullName = ($prefix ? $prefix . '.' : '') . $name; - $tasks[$name] = $fullName; - } - - return $tasks; - } - - /** - * Find task classes in a given path. - * - * @param string $path The path to scan. - * @param string $namespace Namespace. - * @return array An array of files that may contain bake tasks. - */ - protected function _findClassFiles($path, $namespace) - { - $iterator = new \DirectoryIterator($path); - $candidates = []; - foreach ($iterator as $item) { - if ($item->isDot() || $item->isDir()) { - continue; - } - $name = $item->getBasename('.php'); - $candidates[] = $namespace . '\Shell\Task\\' . $name; - } - - return $candidates; - } - - /** - * Find bake tasks in a given set of files. - * - * @param array $files The array of files. - * @return array An array of matching classes. - */ - protected function _findTaskClasses($files) - { - $classes = []; - foreach ($files as $className) { - if (!class_exists($className)) { - continue; - } - $reflect = new \ReflectionClass($className); - if (!$reflect->isInstantiable()) { - continue; - } - if (!$reflect->isSubclassOf('Bake\Shell\Task\BakeTask')) { - continue; - } - $classes[] = $className; - } - - return $classes; - } - - /** - * Quickly bake the MVC - * - * @param string|null $name Name. - * @return bool - */ - public function all($name = null) - { - if ( - $this->param('connection') && $this->param('everything') && - $this->param('connection') !== 'default' - ) { - $this->warn('Can only bake everything on default connection'); - - return false; - } - $this->out('Bake All'); - $this->hr(); - - if (!empty($this->params['connection'])) { - $this->connection = $this->params['connection']; - } - - if (empty($name) && !$this->param('everything')) { - $this->Model->connection = $this->connection; - $this->out('Possible model names based on your database:'); - foreach ($this->Model->listUnskipped() as $table) { - $this->out('- ' . $table); - } - $this->out('Run `cake bake all [name]` to generate skeleton files.'); - - return false; - } - - $allTables = collection([$name]); - $filteredTables = $allTables; - - if ($this->param('everything')) { - $this->Model->connection = $this->connection; - $filteredTables = collection($this->Model->listUnskipped()); - } - - foreach (['Model', 'Controller', 'Template'] as $task) { - $filteredTables->each(function ($tableName) use ($task) { - $tableName = $this->_camelize($tableName); - $this->{$task}->connection = $this->connection; - $this->{$task}->interactive = $this->interactive; - $this->{$task}->main($tableName); - }); - } - - $this->out('Bake All complete.', 1, Shell::QUIET); - - return true; - } - - /** - * Gets the option parser instance and configures it. - * - * @return \Cake\Console\ConsoleOptionParser - */ - public function getOptionParser() - { - $parser = parent::getOptionParser(); - - $parser->setDescription( - 'The Bake script generates controllers, models and template files for your application.' . - ' If run with no command line arguments, Bake guides the user through the class creation process.' . - ' You can customize the generation process by telling Bake where different parts of your application' . - ' are using command line arguments.' - )->addSubcommand('all', [ - 'help' => 'Bake a complete MVC skeleton.', - ])->addOption('everything', [ - 'help' => 'Bake a complete MVC skeleton, using all the available tables. ' . - 'Usage: "bake all --everything"', - 'default' => false, - 'boolean' => true, - ])->addOption('prefix', [ - 'help' => 'Prefix to bake controllers and templates into.', - ])->addOption('tablePrefix', [ - 'help' => 'Table prefix to be used in models.', - 'default' => null, - ]); - - $parser = $this->_setCommonOptions($parser); - - foreach ($this->_taskMap as $task => $config) { - $taskParser = $this->{$task}->getOptionParser(); - $this->{$task}->interactive = $this->interactive; - $parser->addSubcommand(Inflector::underscore($task), [ - 'help' => $taskParser->getDescription(), - 'parser' => $taskParser, - ]); - } - - return $parser; - } -} diff --git a/vendor/cakephp/bake/src/Shell/Task/BakeTask.php b/vendor/cakephp/bake/src/Shell/Task/BakeTask.php deleted file mode 100644 index 83c7e24..0000000 --- a/vendor/cakephp/bake/src/Shell/Task/BakeTask.php +++ /dev/null @@ -1,231 +0,0 @@ -connection) && !empty($this->params['connection'])) { - $this->connection = $this->params['connection']; - } - } - - /** - * Get the prefix name. - * - * Handles camelcasing each namespace in the prefix path. - * - * @return string The inflected prefix path. - */ - protected function _getPrefix() - { - $prefix = $this->param('prefix'); - if (!$prefix) { - return ''; - } - $parts = explode('/', $prefix); - - return implode('/', array_map([$this, '_camelize'], $parts)); - } - - /** - * Gets the path for output. Checks the plugin property - * and returns the correct path. - * - * @return string Path to output. - */ - public function getPath() - { - $path = APP . $this->pathFragment; - if (isset($this->plugin)) { - $path = $this->_pluginPath($this->plugin) . 'src/' . $this->pathFragment; - } - $prefix = $this->_getPrefix(); - if ($prefix) { - $path .= $prefix . DS; - } - - return str_replace('/', DS, $path); - } - - /** - * Base execute method parses some parameters and sets some properties on the bake tasks. - * call when overriding execute() - * - * @return bool|int|null|void - */ - public function main() - { - if (isset($this->params['plugin'])) { - $parts = explode('/', $this->params['plugin']); - $this->plugin = implode('/', array_map([$this, '_camelize'], $parts)); - if (strpos($this->plugin, '\\')) { - $this->abort('Invalid plugin namespace separator, please use / instead of \ for plugins.'); - - return; - } - } - if (isset($this->params['connection'])) { - $this->connection = $this->params['connection']; - } - } - - /** - * Executes an external shell command and pipes its output to the stdout - * - * @param string $command the command to execute - * @return void - * @throws \RuntimeException if any errors occurred during the execution - */ - public function callProcess($command) - { - $descriptorSpec = [ - 0 => ['pipe', 'r'], - 1 => ['pipe', 'w'], - 2 => ['pipe', 'w'], - ]; - $this->_io->verbose('Running ' . $command); - $process = proc_open( - $command, - $descriptorSpec, - $pipes - ); - if (!is_resource($process)) { - $this->abort('Could not start subprocess.'); - - return; - } - fclose($pipes[0]); - - $output = stream_get_contents($pipes[1]); - fclose($pipes[1]); - - $error = stream_get_contents($pipes[2]); - fclose($pipes[2]); - $exit = proc_close($process); - - if ($exit !== 0) { - throw new \RuntimeException($error); - } - - $this->out($output); - } - - /** - * Handles splitting up the plugin prefix and classname. - * - * Sets the plugin parameter and plugin property. - * - * @param string $name The name to possibly split. - * @return string The name without the plugin prefix. - */ - protected function _getName($name) - { - if (strpos($name, '.')) { - list($plugin, $name) = pluginSplit($name); - $this->plugin = $this->params['plugin'] = $plugin; - } - - return $name; - } - - /** - * Delete empty file in a given path - * - * @param string $path Path to folder which contains 'empty' file. - * @return void - */ - protected function _deleteEmptyFile($path) - { - $File = new File($path); - if ($File->exists()) { - $File->delete(); - $this->out(sprintf('Deleted `%s`', $path), 1, Shell::QUIET); - } - } - - /** - * Get the option parser for this task. - * - * This base class method sets up some commonly used options. - * - * @return \Cake\Console\ConsoleOptionParser - */ - public function getOptionParser() - { - return $this->_setCommonOptions(parent::getOptionParser()); - } -} diff --git a/vendor/cakephp/bake/src/Shell/Task/BakeTemplateTask.php b/vendor/cakephp/bake/src/Shell/Task/BakeTemplateTask.php deleted file mode 100644 index a510fa0..0000000 --- a/vendor/cakephp/bake/src/Shell/Task/BakeTemplateTask.php +++ /dev/null @@ -1,98 +0,0 @@ -View) { - return $this->View; - } - - $theme = isset($this->params['theme']) ? $this->params['theme'] : ''; - - $viewOptions = [ - 'helpers' => [ - 'Bake.Bake', - 'Bake.DocBlock', - ], - 'theme' => $theme, - ]; - - $view = new BakeView(new Request(), new Response(), null, $viewOptions); - $event = new Event('Bake.initialize', $view); - EventManager::instance()->dispatch($event); - /** @var \Bake\View\BakeView $view */ - $view = $event->getSubject(); - $this->View = $view; - - return $this->View; - } - - /** - * Runs the template - * - * @param string $template bake template to render - * @param array|null $vars Additional vars to set to template scope. - * @return string contents of generated code template - */ - public function generate($template, $vars = null) - { - if ($vars !== null) { - $this->set($vars); - } - - $this->getView()->set($this->viewVars); - - try { - return $this->View->render($template); - } catch (MissingTemplateException $e) { - $this->_io->verbose(sprintf('No bake template found for "%s"', $template)); - - return ''; - } - } -} diff --git a/vendor/cakephp/bake/src/Shell/Task/BehaviorTask.php b/vendor/cakephp/bake/src/Shell/Task/BehaviorTask.php deleted file mode 100644 index 2657e68..0000000 --- a/vendor/cakephp/bake/src/Shell/Task/BehaviorTask.php +++ /dev/null @@ -1,55 +0,0 @@ -_getPrefix(); - if ($prefix) { - $prefix = '\\' . str_replace('/', '\\', $prefix); - } - - $namespace = Configure::read('App.namespace'); - if ($this->plugin) { - $namespace = $this->_pluginNamespace($this->plugin); - } - - return compact('namespace', 'prefix'); - } - - /** - * Bake the Cell class and template file. - * - * @param string $name The name of the cell to make. - * @return string - */ - public function bake($name) - { - $this->bakeTemplate($name); - - return parent::bake($name); - } - - /** - * Bake an empty file for a cell. - * - * @param string $name The name of the cell a template is needed for. - * @return void - */ - public function bakeTemplate($name) - { - $restore = $this->pathFragment; - - $this->pathFragment = 'Template/Cell/'; - $path = $this->getPath(); - $path .= implode(DS, [$name, 'display.ctp']); - - $this->pathFragment = $restore; - - $this->createFile($path, ''); - } - - /** - * Gets the option parser instance and configures it. - * - * @return \Cake\Console\ConsoleOptionParser - */ - public function getOptionParser() - { - $parser = parent::getOptionParser(); - $parser - ->addOption('prefix', [ - 'help' => 'The namespace prefix to use.', - ]); - - return $parser; - } -} diff --git a/vendor/cakephp/bake/src/Shell/Task/CommandTask.php b/vendor/cakephp/bake/src/Shell/Task/CommandTask.php deleted file mode 100644 index ffc9c36..0000000 --- a/vendor/cakephp/bake/src/Shell/Task/CommandTask.php +++ /dev/null @@ -1,55 +0,0 @@ -_getName($name); - - if (empty($name)) { - $this->out('Possible controllers based on your current database:'); - foreach ($this->listAll() as $table) { - $this->out('- ' . $this->_camelize($table)); - } - - return true; - } - - $controller = $this->_camelize($name); - $this->bake($controller); - } - - /** - * Bake All the controllers at once. Will only bake controllers for models that exist. - * - * @return void - */ - public function all() - { - $tables = $this->listAll(); - foreach ($tables as $table) { - TableRegistry::getTableLocator()->clear(); - $this->main($table); - } - } - - /** - * Assembles and writes a Controller file - * - * @param string $controllerName Controller name already pluralized and correctly cased. - * @return string Baked controller - */ - public function bake($controllerName) - { - $this->out("\n" . sprintf('Baking controller class for %s...', $controllerName), 1, Shell::QUIET); - - $actions = []; - if (!$this->param('no-actions') && !$this->param('actions')) { - $actions = ['index', 'view', 'add', 'edit', 'delete']; - } - if ($this->param('actions')) { - $actions = array_map('trim', explode(',', $this->param('actions'))); - $actions = array_filter($actions); - } - - $helpers = $this->getHelpers(); - $components = $this->getComponents(); - - $prefix = $this->_getPrefix(); - if ($prefix) { - $prefix = '\\' . str_replace('/', '\\', $prefix); - } - - $namespace = Configure::read('App.namespace'); - if ($this->plugin) { - $namespace = $this->_pluginNamespace($this->plugin); - } - - $currentModelName = $controllerName; - $plugin = $this->plugin; - if ($plugin) { - $plugin .= '.'; - } - - if (TableRegistry::getTableLocator()->exists($plugin . $currentModelName)) { - $modelObj = TableRegistry::getTableLocator()->get($plugin . $currentModelName); - } else { - $modelObj = TableRegistry::getTableLocator()->get($plugin . $currentModelName, [ - 'connectionName' => $this->connection, - ]); - } - - $pluralName = $this->_variableName($currentModelName); - $singularName = $this->_singularName($currentModelName); - $singularHumanName = $this->_singularHumanName($controllerName); - $pluralHumanName = $this->_variableName($controllerName); - - $defaultModel = sprintf('%s\Model\Table\%sTable', $namespace, $controllerName); - if (!class_exists($defaultModel)) { - $defaultModel = null; - } - $entityClassName = $this->_entityName($modelObj->getAlias()); - - $data = compact( - 'actions', - 'components', - 'currentModelName', - 'defaultModel', - 'entityClassName', - 'helpers', - 'modelObj', - 'namespace', - 'plugin', - 'pluralHumanName', - 'pluralName', - 'prefix', - 'singularHumanName', - 'singularName' - ); - $data['name'] = $controllerName; - - $out = $this->bakeController($controllerName, $data); - $this->bakeTest($controllerName); - - return $out; - } - - /** - * Generate the controller code - * - * @param string $controllerName The name of the controller. - * @param array $data The data to turn into code. - * @return string The generated controller file. - */ - public function bakeController($controllerName, array $data) - { - $data += [ - 'name' => null, - 'namespace' => null, - 'prefix' => null, - 'actions' => null, - 'helpers' => null, - 'components' => null, - 'plugin' => null, - 'pluginPath' => null, - ]; - - $this->BakeTemplate->set($data); - - $contents = $this->BakeTemplate->generate('Controller/controller'); - - $path = $this->getPath(); - $filename = $path . $controllerName . 'Controller.php'; - $this->createFile($filename, $contents); - - return $contents; - } - - /** - * Assembles and writes a unit test file - * - * @param string $className Controller class name - * @return string|false Baked test - */ - public function bakeTest($className) - { - if (!empty($this->params['no-test'])) { - return false; - } - $this->Test->plugin = $this->plugin; - $this->Test->connection = $this->connection; - $this->Test->interactive = $this->interactive; - - return $this->Test->bake('Controller', $className); - } - - /** - * Get the list of components for the controller. - * - * @return array - */ - public function getComponents() - { - $components = []; - if (!empty($this->params['components'])) { - $components = explode(',', $this->params['components']); - $components = array_values(array_filter(array_map('trim', $components))); - } - - return $components; - } - - /** - * Get the list of helpers for the controller. - * - * @return array - */ - public function getHelpers() - { - $helpers = []; - if (!empty($this->params['helpers'])) { - $helpers = explode(',', $this->params['helpers']); - $helpers = array_values(array_filter(array_map('trim', $helpers))); - } - - return $helpers; - } - - /** - * Outputs and gets the list of possible controllers from database - * - * @return array Set of controllers - */ - public function listAll() - { - $this->Model->connection = $this->connection; - - return $this->Model->listUnskipped(); - } - - /** - * Gets the option parser instance and configures it. - * - * @return \Cake\Console\ConsoleOptionParser - */ - public function getOptionParser() - { - $parser = parent::getOptionParser(); - $parser->setDescription( - 'Bake a controller skeleton.' - )->addArgument('name', [ - 'help' => 'Name of the controller to bake (without the `Controller` suffix). ' . - 'You can use Plugin.name to bake controllers into plugins.', - ])->addOption('components', [ - 'help' => 'The comma separated list of components to use.', - ])->addOption('helpers', [ - 'help' => 'The comma separated list of helpers to use.', - ])->addOption('prefix', [ - 'help' => 'The namespace/routing prefix to use.', - ])->addOption('actions', [ - 'help' => 'The comma separated list of actions to generate. ' . - 'You can include custom methods provided by your template set here.', - ])->addOption('no-test', [ - 'boolean' => true, - 'help' => 'Do not generate a test skeleton.', - ])->addOption('no-actions', [ - 'boolean' => true, - 'help' => 'Do not generate basic CRUD action methods.', - ])->addSubcommand('all', [ - 'help' => 'Bake all controllers with CRUD methods.', - ]); - - return $parser; - } -} diff --git a/vendor/cakephp/bake/src/Shell/Task/FixtureTask.php b/vendor/cakephp/bake/src/Shell/Task/FixtureTask.php deleted file mode 100644 index 5b54e6d..0000000 --- a/vendor/cakephp/bake/src/Shell/Task/FixtureTask.php +++ /dev/null @@ -1,466 +0,0 @@ -plugin)) { - $path = $this->_pluginPath($this->plugin) . 'tests/' . $dir; - } - - return str_replace('/', DS, $path); - } - - /** - * Gets the option parser instance and configures it. - * - * @return \Cake\Console\ConsoleOptionParser - */ - public function getOptionParser() - { - $parser = parent::getOptionParser(); - - $parser = $parser->setDescription( - 'Generate fixtures for use with the test suite. You can use `bake fixture all` to bake all fixtures.' - )->addArgument('name', [ - 'help' => 'Name of the fixture to bake (without the `Fixture` suffix). ' . - 'You can use Plugin.name to bake plugin fixtures.', - ])->addOption('table', [ - 'help' => 'The table name if it does not follow conventions.', - ])->addOption('count', [ - 'help' => 'When using generated data, the number of records to include in the fixture(s).', - 'short' => 'n', - 'default' => 1, - ])->addOption('schema', [ - 'help' => 'Create a fixture that imports schema, instead of dumping a schema snapshot into the fixture.', - 'short' => 's', - 'boolean' => true, - ])->addOption('records', [ - 'help' => 'Generate a fixture with records from the non-test database.' . - ' Used with --count and --conditions to limit which records are added to the fixture.', - 'short' => 'r', - 'boolean' => true, - ])->addOption('conditions', [ - 'help' => 'The SQL snippet to use when importing records.', - 'default' => '1=1', - ])->addSubcommand('all', [ - 'help' => 'Bake all fixture files for tables in the chosen connection.', - ]); - - return $parser; - } - - /** - * Execution method always used for tasks - * Handles dispatching to interactive, named, or all processes. - * - * @param string|null $name The name of the fixture to bake. - * @return null|bool - */ - public function main($name = null) - { - parent::main(); - $name = $this->_getName($name); - - if (empty($name)) { - $this->out('Choose a fixture to bake from the following:'); - foreach ($this->Model->listUnskipped() as $table) { - $this->out('- ' . $this->_camelize($table)); - } - - return true; - } - - $table = null; - if (isset($this->params['table'])) { - $table = $this->params['table']; - } - $model = $this->_camelize($name); - $this->bake($model, $table); - } - - /** - * Bake All the Fixtures at once. Will only bake fixtures for models that exist. - * - * @return void - */ - public function all() - { - $tables = $this->Model->listUnskipped(); - - foreach ($tables as $table) { - $this->main($table); - } - } - - /** - * Assembles and writes a Fixture file - * - * @param string $model Name of model to bake. - * @param string|null $useTable Name of table to use. - * @return string Baked fixture content - * @throws \RuntimeException - */ - public function bake($model, $useTable = null) - { - $table = $schema = $records = $import = $modelImport = null; - - if (!$useTable) { - $useTable = Inflector::tableize($model); - } elseif ($useTable !== Inflector::tableize($model)) { - $table = $useTable; - } - - $importBits = []; - if (!empty($this->params['schema'])) { - $modelImport = true; - $importBits[] = "'table' => '{$useTable}'"; - } - if (!empty($importBits) && $this->connection !== 'default') { - $importBits[] = "'connection' => '{$this->connection}'"; - } - if (!empty($importBits)) { - $import = sprintf("[%s]", implode(', ', $importBits)); - } - - try { - $data = $this->readSchema($model, $useTable); - } catch (Exception $e) { - TableRegistry::getTableLocator()->remove($model); - $useTable = Inflector::underscore($model); - $table = $useTable; - $data = $this->readSchema($model, $useTable); - } - - if ($modelImport === null) { - $schema = $this->_generateSchema($data); - } - - if (empty($this->params['records'])) { - $recordCount = 1; - if (isset($this->params['count'])) { - $recordCount = $this->params['count']; - } - $records = $this->_makeRecordString($this->_generateRecords($data, $recordCount)); - } - if (!empty($this->params['records'])) { - $records = $this->_makeRecordString($this->_getRecordsFromTable($model, $useTable)); - } - - return $this->generateFixtureFile($model, compact('records', 'table', 'schema', 'import')); - } - - /** - * Get schema metadata for the current table mapping. - * - * @param string $name The model alias to use - * @param string $table The table name to get schema metadata for. - * @return \Cake\Database\Schema\TableSchema - */ - public function readSchema($name, $table) - { - $connection = ConnectionManager::get($this->connection); - - if (TableRegistry::getTableLocator()->exists($name)) { - $model = TableRegistry::getTableLocator()->get($name); - } else { - $model = TableRegistry::getTableLocator()->get($name, [ - 'table' => $table, - 'connection' => $connection, - ]); - } - - return $model->getSchema(); - } - - /** - * Generate the fixture file, and write to disk - * - * @param string $model name of the model being generated - * @param array $otherVars Contents of the fixture file. - * @return string Content saved into fixture file. - */ - public function generateFixtureFile($model, array $otherVars) - { - $defaults = [ - 'name' => $model, - 'table' => null, - 'schema' => null, - 'records' => null, - 'import' => null, - 'fields' => null, - 'namespace' => Configure::read('App.namespace'), - ]; - if ($this->plugin) { - $defaults['namespace'] = $this->_pluginNamespace($this->plugin); - } - $vars = $otherVars + $defaults; - - $path = $this->getPath(); - $filename = $vars['name'] . 'Fixture.php'; - - $this->BakeTemplate->set('model', $model); - $this->BakeTemplate->set($vars); - $content = $this->BakeTemplate->generate('tests/fixture'); - - $this->out("\n" . sprintf('Baking test fixture for %s...', $model), 1, Shell::QUIET); - $this->createFile($path . $filename, $content); - $emptyFile = $path . 'empty'; - $this->_deleteEmptyFile($emptyFile); - - return $content; - } - - /** - * Generates a string representation of a schema. - * - * @param \Cake\Database\Schema\TableSchema $table Table schema - * @return string fields definitions - */ - protected function _generateSchema(TableSchema $table) - { - $cols = $indexes = $constraints = []; - foreach ($table->columns() as $field) { - $fieldData = $table->getColumn($field); - $properties = implode(', ', $this->_values($fieldData)); - $cols[] = " '$field' => [$properties],"; - } - foreach ($table->indexes() as $index) { - $fieldData = $table->getIndex($index); - $properties = implode(', ', $this->_values($fieldData)); - $indexes[] = " '$index' => [$properties],"; - } - foreach ($table->constraints() as $index) { - $fieldData = $table->getConstraint($index); - $properties = implode(', ', $this->_values($fieldData)); - $constraints[] = " '$index' => [$properties],"; - } - $options = $this->_values($table->getOptions()); - - $content = implode("\n", $cols) . "\n"; - if (!empty($indexes)) { - $content .= " '_indexes' => [\n" . implode("\n", $indexes) . "\n ],\n"; - } - if (!empty($constraints)) { - $content .= " '_constraints' => [\n" . implode("\n", $constraints) . "\n ],\n"; - } - if (!empty($options)) { - foreach ($options as &$option) { - $option = ' ' . $option; - } - $content .= " '_options' => [\n" . implode(",\n", $options) . "\n ],\n"; - } - - return "[\n$content ]"; - } - - /** - * Formats Schema columns from Model Object - * - * @param array $values options keys(type, null, default, key, length, extra) - * @return array Formatted values - */ - protected function _values($values) - { - $vals = []; - if (!is_array($values)) { - return $vals; - } - foreach ($values as $key => $val) { - if (is_array($val)) { - $vals[] = "'{$key}' => [" . implode(", ", $this->_values($val)) . "]"; - } else { - $val = var_export($val, true); - if ($val === 'NULL') { - $val = 'null'; - } - if (!is_numeric($key)) { - $vals[] = "'{$key}' => {$val}"; - } else { - $vals[] = "{$val}"; - } - } - } - - return $vals; - } - - /** - * Generate String representation of Records - * - * @param \Cake\Database\Schema\TableSchema $table Table schema array - * @param int $recordCount The number of records to generate. - * @return array Array of records to use in the fixture. - */ - protected function _generateRecords(TableSchema $table, $recordCount = 1) - { - $records = []; - for ($i = 0; $i < $recordCount; $i++) { - $record = []; - foreach ($table->columns() as $field) { - $fieldInfo = $table->getColumn($field); - $insert = ''; - switch ($fieldInfo['type']) { - case 'decimal': - $insert = $i + 1.5; - break; - case 'biginteger': - case 'integer': - case 'float': - case 'smallinteger': - case 'tinyinteger': - $insert = $i + 1; - break; - case 'string': - case 'binary': - $isPrimary = in_array($field, $table->primaryKey()); - if ($isPrimary) { - $insert = Text::uuid(); - } else { - $insert = "Lorem ipsum dolor sit amet"; - if (!empty($fieldInfo['length'])) { - $insert = substr($insert, 0, (int)$fieldInfo['length'] > 2 ? (int)$fieldInfo['length'] - 2 : (int)$fieldInfo['length']); - } - } - break; - case 'timestamp': - $insert = time(); - break; - case 'datetime': - $insert = date('Y-m-d H:i:s'); - break; - case 'date': - $insert = date('Y-m-d'); - break; - case 'time': - $insert = date('H:i:s'); - break; - case 'boolean': - $insert = 1; - break; - case 'text': - $insert = "Lorem ipsum dolor sit amet, aliquet feugiat."; - $insert .= " Convallis morbi fringilla gravida,"; - $insert .= " phasellus feugiat dapibus velit nunc, pulvinar eget sollicitudin"; - $insert .= " venenatis cum nullam, vivamus ut a sed, mollitia lectus. Nulla"; - $insert .= " vestibulum massa neque ut et, id hendrerit sit,"; - $insert .= " feugiat in taciti enim proin nibh, tempor dignissim, rhoncus"; - $insert .= " duis vestibulum nunc mattis convallis."; - break; - case 'uuid': - $insert = Text::uuid(); - break; - } - $record[$field] = $insert; - } - $records[] = $record; - } - - return $records; - } - - /** - * Convert a $records array into a string. - * - * @param array $records Array of records to be converted to string - * @return string A string value of the $records array. - */ - protected function _makeRecordString($records) - { - $out = "[\n"; - foreach ($records as $record) { - $values = []; - foreach ($record as $field => $value) { - if ($value instanceof DateTimeInterface) { - $value = $value->format('Y-m-d H:i:s'); - } - $val = var_export($value, true); - if ($val === 'NULL') { - $val = 'null'; - } - $values[] = " '$field' => $val"; - } - $out .= " [\n"; - $out .= implode(",\n", $values); - $out .= ",\n ],\n"; - } - $out .= " ]"; - - return $out; - } - - /** - * Interact with the user to get a custom SQL condition and use that to extract data - * to build a fixture. - * - * @param string $modelName name of the model to take records from. - * @param string|null $useTable Name of table to use. - * @return array Array of records. - */ - protected function _getRecordsFromTable($modelName, $useTable = null) - { - $recordCount = (isset($this->params['count']) ? $this->params['count'] : 10); - $conditions = (isset($this->params['conditions']) ? $this->params['conditions'] : '1=1'); - if (TableRegistry::getTableLocator()->exists($modelName)) { - $model = TableRegistry::getTableLocator()->get($modelName); - } else { - $model = TableRegistry::getTableLocator()->get($modelName, [ - 'table' => $useTable, - 'connection' => ConnectionManager::get($this->connection), - ]); - } - $records = $model->find('all') - ->where($conditions) - ->limit($recordCount) - ->enableHydration(false); - - return $records->toArray(); - } -} diff --git a/vendor/cakephp/bake/src/Shell/Task/FormTask.php b/vendor/cakephp/bake/src/Shell/Task/FormTask.php deleted file mode 100644 index d9cd3bc..0000000 --- a/vendor/cakephp/bake/src/Shell/Task/FormTask.php +++ /dev/null @@ -1,55 +0,0 @@ -bakeLayouts($name); - - return parent::bake($name); - } - - /** - * Bake empty layout files for html/text emails. - * - * @param string $name The name of the mailer layouts are needed for. - * @return void - */ - public function bakeLayouts($name) - { - $restore = $this->pathFragment; - $layoutsPath = implode(DS, ['Template', 'Layout', 'Email']); - - foreach (['html', 'text'] as $type) { - $this->pathFragment = implode(DS, [$layoutsPath, $type, Inflector::underscore($name) . '.ctp']); - $path = $this->getPath(); - $this->createFile($path, ''); - } - - $this->pathFragment = $restore; - } -} diff --git a/vendor/cakephp/bake/src/Shell/Task/MiddlewareTask.php b/vendor/cakephp/bake/src/Shell/Task/MiddlewareTask.php deleted file mode 100644 index 3d6a301..0000000 --- a/vendor/cakephp/bake/src/Shell/Task/MiddlewareTask.php +++ /dev/null @@ -1,55 +0,0 @@ -_getName($name); - - if (empty($name)) { - $this->out('Choose a model to bake from the following:'); - foreach ($this->listUnskipped() as $table) { - $this->out('- ' . $this->_camelize($table)); - } - - return; - } - - $this->bake($this->_camelize($name)); - } - - /** - * Generate code for the given model name. - * - * @param string $name The model name to generate. - * @return void - */ - public function bake($name) - { - $table = $this->getTable($name); - $tableObject = $this->getTableObject($name, $table); - $data = $this->getTableContext($tableObject, $table, $name); - $this->bakeTable($tableObject, $data); - $this->bakeEntity($tableObject, $data); - $this->bakeFixture($tableObject->getAlias(), $tableObject->getTable()); - $this->bakeTest($tableObject->getAlias()); - } - - /** - * Get table context for baking a given table. - * - * @param \Cake\ORM\Table $tableObject The model name to generate. - * @param string $table The table name for the model being baked. - * @param string $name The model name to generate. - * @return array - */ - public function getTableContext($tableObject, $table, $name) - { - $associations = $this->getAssociations($tableObject); - $this->applyAssociations($tableObject, $associations); - $associationInfo = $this->getAssociationInfo($tableObject); - - $primaryKey = $this->getPrimaryKey($tableObject); - $displayField = $this->getDisplayField($tableObject); - $propertySchema = $this->getEntityPropertySchema($tableObject); - $fields = $this->getFields($tableObject); - $validation = $this->getValidation($tableObject, $associations); - $rulesChecker = $this->getRules($tableObject, $associations); - $behaviors = $this->getBehaviors($tableObject); - $connection = $this->connection; - $hidden = $this->getHiddenFields($tableObject); - - return compact( - 'associations', - 'associationInfo', - 'primaryKey', - 'displayField', - 'table', - 'propertySchema', - 'fields', - 'validation', - 'rulesChecker', - 'behaviors', - 'connection', - 'hidden' - ); - } - - /** - * Bake all models at once. - * - * @return void - */ - public function all() - { - $tables = $this->listUnskipped(); - foreach ($tables as $table) { - TableRegistry::getTableLocator()->clear(); - $this->main($table); - } - } - - /** - * Get a model object for a class name. - * - * @param string $className Name of class you want model to be. - * @param string $table Table name - * @return \Cake\ORM\Table Table instance - */ - public function getTableObject($className, $table) - { - $plugin = $this->param('plugin'); - if (!empty($plugin)) { - $className = $plugin . '.' . $className; - } - - if (TableRegistry::getTableLocator()->exists($className)) { - return TableRegistry::getTableLocator()->get($className); - } - - return TableRegistry::getTableLocator()->get($className, [ - 'name' => $className, - 'table' => $this->tablePrefix . $table, - 'connection' => ConnectionManager::get($this->connection), - ]); - } - - /** - * Get the array of associations to generate. - * - * @param \Cake\ORM\Table $table The table to get associations for. - * @return array - */ - public function getAssociations(Table $table) - { - if (!empty($this->params['no-associations'])) { - return []; - } - $this->out('One moment while associations are detected.'); - - $this->listAll(); - - $associations = [ - 'belongsTo' => [], - 'hasMany' => [], - 'belongsToMany' => [], - ]; - - $primary = $table->getPrimaryKey(); - $associations = $this->findBelongsTo($table, $associations); - - if (is_array($primary) && count($primary) > 1) { - $this->err( - 'Bake cannot generate associations for composite primary keys at this time.' - ); - - return $associations; - } - - $associations = $this->findHasMany($table, $associations); - $associations = $this->findBelongsToMany($table, $associations); - - return $associations; - } - - /** - * Sync the in memory table object. - * - * Composer's class cache prevents us from loading the - * newly generated class. Applying associations if we have a - * generic table object means fields will be detected correctly. - * - * @param \Cake\ORM\Table $model The table to apply associations to. - * @param array $associations The associations to append. - * @return void - */ - public function applyAssociations($model, $associations) - { - if (get_class($model) !== 'Cake\ORM\Table') { - return; - } - foreach ($associations as $type => $assocs) { - foreach ($assocs as $assoc) { - $alias = $assoc['alias']; - unset($assoc['alias']); - $model->{$type}($alias, $assoc); - } - } - } - - /** - * Collects meta information for associations. - * - * The information returned is in the format of map, where the key is the - * association alias: - * - * ``` - * [ - * 'associationAlias' => [ - * 'targetFqn' => '...' - * ], - * // ... - * ] - * ``` - * - * @param \Cake\ORM\Table $table The table from which to collect association information. - * @return array A map of association information. - */ - public function getAssociationInfo(Table $table) - { - $info = []; - - $appNamespace = Configure::read('App.namespace'); - - foreach ($table->associations() as $association) { - /* @var $association \Cake\ORM\Association */ - - $tableClass = get_class($association->getTarget()); - if ($tableClass === 'Cake\ORM\Table') { - $namespace = $appNamespace; - - $className = $association->getClassName(); - if (strlen($className)) { - list($plugin, $className) = pluginSplit($className); - if ($plugin !== null) { - $namespace = $plugin; - } - } else { - $className = $association->getTarget()->getAlias(); - } - - $namespace = str_replace('/', '\\', trim($namespace, '\\')); - $tableClass = $namespace . '\Model\Table\\' . $className . 'Table'; - } - - $info[$association->getName()] = [ - 'targetFqn' => '\\' . $tableClass, - ]; - } - - return $info; - } - - /** - * Find belongsTo relations and add them to the associations list. - * - * @param \Cake\ORM\Table $model Database\Table instance of table being generated. - * @param array $associations Array of in progress associations - * @return array Associations with belongsTo added in. - */ - public function findBelongsTo($model, array $associations) - { - $schema = $model->getSchema(); - foreach ($schema->columns() as $fieldName) { - if (!preg_match('/^.+_id$/', $fieldName) || ([$fieldName] === $schema->primaryKey())) { - continue; - } - - if ($fieldName === 'parent_id') { - $className = ($this->plugin) ? $this->plugin . '.' . $model->getAlias() : $model->getAlias(); - $assoc = [ - 'alias' => 'Parent' . $model->getAlias(), - 'className' => $className, - 'foreignKey' => $fieldName, - ]; - } else { - $tmpModelName = $this->_modelNameFromKey($fieldName); - if (!in_array(Inflector::tableize($tmpModelName), $this->_tables)) { - $found = $this->findTableReferencedBy($schema, $fieldName); - if ($found) { - $tmpModelName = Inflector::camelize($found); - } - } - $assoc = [ - 'alias' => $tmpModelName, - 'foreignKey' => $fieldName, - ]; - if ($schema->getColumn($fieldName)['null'] === false) { - $assoc['joinType'] = 'INNER'; - } - } - - if ($this->plugin && empty($assoc['className'])) { - $assoc['className'] = $this->plugin . '.' . $assoc['alias']; - } - $associations['belongsTo'][] = $assoc; - } - - return $associations; - } - - /** - * find the table, if any, actually referenced by the passed key field. - * Search tables in db for keyField; if found search key constraints - * for the table to which it refers. - * - * @param \Cake\Database\Schema\TableSchema $schema The table schema to find a constraint for. - * @param string $keyField The field to check for a constraint. - * @return string|null Either the referenced table or null if the field has no constraints. - */ - public function findTableReferencedBy($schema, $keyField) - { - if (!$schema->getColumn($keyField)) { - return null; - } - - foreach ($schema->constraints() as $constraint) { - $constraintInfo = $schema->getConstraint($constraint); - if (!in_array($keyField, $constraintInfo['columns'])) { - continue; - } - - if (!isset($constraintInfo['references'])) { - continue; - } - $length = mb_strlen($this->tablePrefix); - if ($length > 0 && mb_substr($constraintInfo['references'][0], 0, $length) === $this->tablePrefix) { - return mb_substr($constraintInfo['references'][0], $length); - } - - return $constraintInfo['references'][0]; - } - - return null; - } - - /** - * Find the hasMany relations and add them to associations list - * - * @param \Cake\ORM\Table $model Model instance being generated - * @param array $associations Array of in progress associations - * @return array Associations with hasMany added in. - */ - public function findHasMany($model, array $associations) - { - $schema = $model->getSchema(); - $primaryKey = $schema->primaryKey(); - $tableName = $schema->name(); - $foreignKey = $this->_modelKey($tableName); - - $tables = $this->listAll(); - foreach ($tables as $otherTableName) { - $otherModel = $this->getTableObject($this->_camelize($otherTableName), $otherTableName); - $otherSchema = $otherModel->getSchema(); - - $pregTableName = preg_quote($tableName, '/'); - $pregPattern = "/^{$pregTableName}_|_{$pregTableName}$/"; - if (preg_match($pregPattern, $otherTableName) === 1) { - $possibleHABTMTargetTable = preg_replace($pregPattern, '', $otherTableName); - if (in_array($possibleHABTMTargetTable, $tables)) { - continue; - } - } - - foreach ($otherSchema->columns() as $fieldName) { - $assoc = false; - if (!in_array($fieldName, $primaryKey) && $fieldName === $foreignKey) { - $assoc = [ - 'alias' => $otherModel->getAlias(), - 'foreignKey' => $fieldName, - ]; - } elseif ($otherTableName === $tableName && $fieldName === 'parent_id') { - $className = ($this->plugin) ? $this->plugin . '.' . $model->getAlias() : $model->getAlias(); - $assoc = [ - 'alias' => 'Child' . $model->getAlias(), - 'className' => $className, - 'foreignKey' => $fieldName, - ]; - } - if ($assoc && $this->plugin && empty($assoc['className'])) { - $assoc['className'] = $this->plugin . '.' . $assoc['alias']; - } - if ($assoc) { - $associations['hasMany'][] = $assoc; - } - } - } - - return $associations; - } - - /** - * Find the BelongsToMany relations and add them to associations list - * - * @param \Cake\ORM\Table $model Model instance being generated - * @param array $associations Array of in-progress associations - * @return array Associations with belongsToMany added in. - */ - public function findBelongsToMany($model, array $associations) - { - $schema = $model->getSchema(); - $tableName = $schema->name(); - $foreignKey = $this->_modelKey($tableName); - - $tables = $this->listAll(); - foreach ($tables as $otherTableName) { - $assocTable = null; - $offset = strpos($otherTableName, $tableName . '_'); - $otherOffset = strpos($otherTableName, '_' . $tableName); - - if ($offset !== false) { - $assocTable = substr($otherTableName, strlen($tableName . '_')); - } elseif ($otherOffset !== false) { - $assocTable = substr($otherTableName, 0, $otherOffset); - } - if ($assocTable && in_array($assocTable, $tables)) { - $habtmName = $this->_camelize($assocTable); - $assoc = [ - 'alias' => $habtmName, - 'foreignKey' => $foreignKey, - 'targetForeignKey' => $this->_modelKey($habtmName), - 'joinTable' => $otherTableName, - ]; - if ($this->plugin) { - $assoc['className'] = $this->plugin . '.' . $assoc['alias']; - } - $associations['belongsToMany'][] = $assoc; - } - } - - return $associations; - } - - /** - * Get the display field from the model or parameters - * - * @param \Cake\ORM\Table $model The model to introspect. - * @return string - */ - public function getDisplayField($model) - { - if (!empty($this->params['display-field'])) { - return $this->params['display-field']; - } - - return $model->getDisplayField(); - } - - /** - * Get the primary key field from the model or parameters - * - * @param \Cake\ORM\Table $model The model to introspect. - * @return array The columns in the primary key - */ - public function getPrimaryKey($model) - { - if (!empty($this->params['primary-key'])) { - $fields = explode(',', $this->params['primary-key']); - - return array_values(array_filter(array_map('trim', $fields))); - } - - return (array)$model->getPrimaryKey(); - } - - /** - * Returns an entity property "schema". - * - * The schema is an associative array, using the property names - * as keys, and information about the property as the value. - * - * The value part consists of at least two keys: - * - * - `kind`: The kind of property, either `column`, which indicates - * that the property stems from a database column, or `association`, - * which identifies a property that is generated for an associated - * table. - * - `type`: The type of the property value. For the `column` kind - * this is the database type associated with the column, and for the - * `association` type it's the FQN of the entity class for the - * associated table. - * - * For `association` properties an additional key will be available - * - * - `association`: Holds an instance of the corresponding association - * class. - * - * @param \Cake\ORM\Table $model The model to introspect. - * @return array The property schema - */ - public function getEntityPropertySchema(Table $model) - { - $properties = []; - - $schema = $model->getSchema(); - foreach ($schema->columns() as $column) { - $columnSchema = $schema->getColumn($column); - - $properties[$column] = [ - 'kind' => 'column', - 'type' => $columnSchema['type'], - 'null' => $columnSchema['null'], - ]; - } - - foreach ($model->associations() as $association) { - $entityClass = '\\' . ltrim($association->getTarget()->getEntityClass(), '\\'); - - if ($entityClass === '\Cake\ORM\Entity') { - $namespace = Configure::read('App.namespace'); - - list($plugin, ) = pluginSplit($association->getTarget()->getRegistryAlias()); - if ($plugin !== null) { - $namespace = $plugin; - } - $namespace = str_replace('/', '\\', trim($namespace, '\\')); - - $entityClass = $this->_entityName($association->getTarget()->getAlias()); - $entityClass = '\\' . $namespace . '\Model\Entity\\' . $entityClass; - } - - $properties[$association->getProperty()] = [ - 'kind' => 'association', - 'association' => $association, - 'type' => $entityClass, - ]; - } - - return $properties; - } - - /** - * Evaluates the fields and no-fields options, and - * returns if, and which fields should be made accessible. - * - * If no fields are specified and the `no-fields` parameter is - * not set, then all non-primary key fields + association - * fields will be set as accessible. - * - * @param \Cake\ORM\Table $table The table instance to get fields for. - * @return array|bool|null Either an array of fields, `false` in - * case the no-fields option is used, or `null` if none of the - * field options is used. - */ - public function getFields($table) - { - if (!empty($this->params['no-fields'])) { - return false; - } - if (!empty($this->params['fields'])) { - $fields = explode(',', $this->params['fields']); - - return array_values(array_filter(array_map('trim', $fields))); - } - $schema = $table->getSchema(); - $fields = $schema->columns(); - foreach ($table->associations() as $assoc) { - $fields[] = $assoc->getProperty(); - } - $primaryKey = $schema->primaryKey(); - - return array_values(array_diff($fields, $primaryKey)); - } - - /** - * Get the hidden fields from a model. - * - * Uses the hidden and no-hidden options. - * - * @param \Cake\ORM\Table $model The model to introspect. - * @return array The columns to make accessible - */ - public function getHiddenFields($model) - { - if (!empty($this->params['no-hidden'])) { - return []; - } - if (!empty($this->params['hidden'])) { - $fields = explode(',', $this->params['hidden']); - - return array_values(array_filter(array_map('trim', $fields))); - } - $schema = $model->getSchema(); - $columns = $schema->columns(); - $whitelist = ['token', 'password', 'passwd']; - - return array_values(array_intersect($columns, $whitelist)); - } - - /** - * Generate default validation rules. - * - * @param \Cake\ORM\Table $model The model to introspect. - * @param array $associations The associations list. - * @return array|false The validation rules. - */ - public function getValidation($model, $associations = []) - { - if (!empty($this->params['no-validation'])) { - return []; - } - $schema = $model->getSchema(); - $fields = $schema->columns(); - if (empty($fields)) { - return false; - } - - $validate = []; - $primaryKey = $schema->primaryKey(); - $foreignKeys = []; - if (isset($associations['belongsTo'])) { - foreach ($associations['belongsTo'] as $assoc) { - $foreignKeys[] = $assoc['foreignKey']; - } - } - foreach ($fields as $fieldName) { - if (in_array($fieldName, $foreignKeys)) { - continue; - } - $field = $schema->getColumn($fieldName); - $validation = $this->fieldValidation($schema, $fieldName, $field, $primaryKey); - if (!empty($validation)) { - $validate[$fieldName] = $validation; - } - } - - return $validate; - } - - /** - * Does individual field validation handling. - * - * @param \Cake\Database\Schema\TableSchema $schema The table schema for the current field. - * @param string $fieldName Name of field to be validated. - * @param array $metaData metadata for field - * @param array $primaryKey The primary key field - * @return array Array of validation for the field. - */ - public function fieldValidation($schema, $fieldName, array $metaData, $primaryKey) - { - $ignoreFields = ['lft', 'rght', 'created', 'modified', 'updated']; - if (in_array($fieldName, $ignoreFields)) { - return []; - } - - $rules = []; - if ($fieldName === 'email') { - $rules['email'] = []; - } elseif ($metaData['type'] === 'uuid') { - $rules['uuid'] = []; - } elseif ($metaData['type'] === 'integer') { - if ($metaData['unsigned']) { - $rules['nonNegativeInteger'] = []; - } else { - $rules['integer'] = []; - } - } elseif ($metaData['type'] === 'float') { - $rules['numeric'] = []; - if ($metaData['unsigned']) { - $rules['greaterThanOrEqual'] = [ - 0, - ]; - } - } elseif ($metaData['type'] === 'decimal') { - $rules['decimal'] = []; - if ($metaData['unsigned']) { - $rules['greaterThanOrEqual'] = [ - 0, - ]; - } - } elseif ($metaData['type'] === 'boolean') { - $rules['boolean'] = []; - } elseif ($metaData['type'] === 'date') { - $rules['date'] = []; - } elseif ($metaData['type'] === 'time') { - $rules['time'] = []; - } elseif ($metaData['type'] === 'datetime') { - $rules['dateTime'] = []; - } elseif ($metaData['type'] === 'timestamp') { - $rules['dateTime'] = []; - } elseif ($metaData['type'] === 'inet') { - $rules['ip'] = []; - } elseif ($metaData['type'] === 'string' || $metaData['type'] === 'text') { - $rules['scalar'] = []; - if ($metaData['length'] > 0) { - $rules['maxLength'] = [$metaData['length']]; - } - } - - $validation = []; - foreach ($rules as $rule => $args) { - $validation[$rule] = [ - 'rule' => $rule, - 'args' => $args, - ]; - } - - if (in_array($fieldName, $primaryKey)) { - $validation['allowEmpty'] = [ - 'rule' => $this->getEmptyMethod($fieldName, $metaData), - 'args' => ['null', "'create'"], - ]; - } elseif ($metaData['null'] === true) { - $validation['allowEmpty'] = [ - 'rule' => $this->getEmptyMethod($fieldName, $metaData), - 'args' => [], - ]; - } else { - if ($metaData['default'] === null || $metaData['default'] === false) { - $validation['requirePresence'] = [ - 'rule' => 'requirePresence', - 'args' => ["'create'"], - ]; - } - $validation['notEmpty'] = [ - 'rule' => $this->getEmptyMethod($fieldName, $metaData, 'not'), - 'args' => [], - ]; - } - - foreach ($schema->constraints() as $constraint) { - $constraint = $schema->getConstraint($constraint); - if (!in_array($fieldName, $constraint['columns']) || count($constraint['columns']) > 1) { - continue; - } - - $notDatetime = !in_array($metaData['type'], ['datetime', 'timestamp', 'date', 'time']); - if ($constraint['type'] === TableSchema::CONSTRAINT_UNIQUE && $notDatetime) { - $validation['unique'] = ['rule' => 'validateUnique', 'provider' => 'table']; - } - } - - return $validation; - } - - /** - * Get the specific allow empty method for field based on metadata. - * - * @param string $fieldName Field name. - * @param array $metaData Field meta data. - * @param string $prefix Method name prefix. - * @return string - */ - protected function getEmptyMethod($fieldName, array $metaData, $prefix = 'allow') - { - switch ($metaData['type']) { - case 'date': - return $prefix . 'EmptyDate'; - - case 'time': - return $prefix . 'EmptyTime'; - - case 'datetime': - case 'timestamp': - return $prefix . 'EmptyDateTime'; - } - - if (preg_match('/file|image/', $fieldName)) { - return $prefix . 'EmptyFile'; - } - - return $prefix . 'EmptyString'; - } - - /** - * Generate default rules checker. - * - * @param \Cake\ORM\Table $model The model to introspect. - * @param array $associations The associations for the model. - * @return array The rules to be applied. - */ - public function getRules($model, array $associations) - { - if (!empty($this->params['no-rules'])) { - return []; - } - $schema = $model->getSchema(); - $fields = $schema->columns(); - if (empty($fields)) { - return []; - } - - $rules = []; - foreach ($fields as $fieldName) { - if (in_array($fieldName, ['username', 'email', 'login'])) { - $rules[$fieldName] = ['name' => 'isUnique']; - } - } - foreach ($schema->constraints() as $name) { - $constraint = $schema->getConstraint($name); - if ($constraint['type'] !== TableSchema::CONSTRAINT_UNIQUE) { - continue; - } - if (count($constraint['columns']) > 1) { - continue; - } - $rules[$constraint['columns'][0]] = ['name' => 'isUnique']; - } - - if (empty($associations['belongsTo'])) { - return $rules; - } - - foreach ($associations['belongsTo'] as $assoc) { - $rules[$assoc['foreignKey']] = ['name' => 'existsIn', 'extra' => $assoc['alias']]; - } - - return $rules; - } - - /** - * Get behaviors - * - * @param \Cake\ORM\Table $model The model to generate behaviors for. - * @return array Behaviors - */ - public function getBehaviors($model) - { - $behaviors = []; - $schema = $model->getSchema(); - $fields = $schema->columns(); - if (empty($fields)) { - return []; - } - if (in_array('created', $fields) || in_array('modified', $fields)) { - $behaviors['Timestamp'] = []; - } - - if ( - in_array('lft', $fields) && $schema->getColumnType('lft') === 'integer' && - in_array('rght', $fields) && $schema->getColumnType('rght') === 'integer' && - in_array('parent_id', $fields) - ) { - $behaviors['Tree'] = []; - } - - $counterCache = $this->getCounterCache($model); - if (!empty($counterCache)) { - $behaviors['CounterCache'] = $counterCache; - } - - return $behaviors; - } - - /** - * Get CounterCaches - * - * @param \Cake\ORM\Table $model The table to get counter cache fields for. - * @return array CounterCache configurations - */ - public function getCounterCache($model) - { - $belongsTo = $this->findBelongsTo($model, ['belongsTo' => []]); - $counterCache = []; - foreach ($belongsTo['belongsTo'] as $otherTable) { - $otherAlias = $otherTable['alias']; - $otherModel = $this->getTableObject($this->_camelize($otherAlias), Inflector::underscore($otherAlias)); - - try { - $otherSchema = $otherModel->getSchema(); - } catch (\Cake\Database\Exception $e) { - continue; - } - - $otherFields = $otherSchema->columns(); - $alias = $model->getAlias(); - $field = Inflector::singularize(Inflector::underscore($alias)) . '_count'; - if (in_array($field, $otherFields, true)) { - $counterCache[] = "'{$otherAlias}' => ['{$field}']"; - } - } - - return $counterCache; - } - - /** - * Bake an entity class. - * - * @param \Cake\ORM\Table $model Model name or object - * @param array $data An array to use to generate the Table - * @return string|null - */ - public function bakeEntity($model, array $data = []) - { - if (!empty($this->params['no-entity'])) { - return null; - } - $name = $this->_entityName($model->getAlias()); - - $namespace = Configure::read('App.namespace'); - $pluginPath = ''; - if ($this->plugin) { - $namespace = $this->_pluginNamespace($this->plugin); - $pluginPath = $this->plugin . '.'; - } - - $data += [ - 'name' => $name, - 'namespace' => $namespace, - 'plugin' => $this->plugin, - 'pluginPath' => $pluginPath, - 'primaryKey' => [], - ]; - - $this->BakeTemplate->set($data); - $out = $this->BakeTemplate->generate('Model/entity'); - - $path = $this->getPath(); - $filename = $path . 'Entity' . DS . $name . '.php'; - $this->out("\n" . sprintf('Baking entity class for %s...', $name), 1, Shell::QUIET); - $this->createFile($filename, $out); - $emptyFile = $path . 'Entity' . DS . 'empty'; - $this->_deleteEmptyFile($emptyFile); - - return $out; - } - - /** - * Bake a table class. - * - * @param \Cake\ORM\Table $model Model name or object - * @param array $data An array to use to generate the Table - * @return string|null - */ - public function bakeTable($model, array $data = []) - { - if (!empty($this->params['no-table'])) { - return null; - } - - $namespace = Configure::read('App.namespace'); - $pluginPath = ''; - if ($this->plugin) { - $namespace = $this->_pluginNamespace($this->plugin); - } - - $name = $model->getAlias(); - $entity = $this->_entityName($model->getAlias()); - $data += [ - 'plugin' => $this->plugin, - 'pluginPath' => $pluginPath, - 'namespace' => $namespace, - 'name' => $name, - 'entity' => $entity, - 'associations' => [], - 'primaryKey' => 'id', - 'displayField' => null, - 'table' => null, - 'validation' => [], - 'rulesChecker' => [], - 'behaviors' => [], - 'connection' => $this->connection, - ]; - - $this->BakeTemplate->set($data); - $out = $this->BakeTemplate->generate('Model/table'); - - $path = $this->getPath(); - $filename = $path . 'Table' . DS . $name . 'Table.php'; - $this->out("\n" . sprintf('Baking table class for %s...', $name), 1, Shell::QUIET); - $this->createFile($filename, $out); - - // Work around composer caching that classes/files do not exist. - // Check for the file as it might not exist in tests. - if (file_exists($filename)) { - require_once $filename; - } - TableRegistry::getTableLocator()->clear(); - - $emptyFile = $path . 'Table' . DS . 'empty'; - $this->_deleteEmptyFile($emptyFile); - - return $out; - } - - /** - * Outputs the a list of possible models or controllers from database - * - * @return array - */ - public function listAll() - { - if (!empty($this->_tables)) { - return $this->_tables; - } - - $this->_modelNames = []; - $this->_tables = $this->_getAllTables(); - foreach ($this->_tables as $table) { - $this->_modelNames[] = $this->_camelize($table); - } - - return $this->_tables; - } - - /** - * Outputs the a list of unskipped models or controllers from database - * - * @return array - */ - public function listUnskipped() - { - $this->listAll(); - - return array_diff($this->_tables, $this->skipTables); - } - - /** - * Models never have routing prefixes applied. - * - * @return string - */ - protected function _getPrefix() - { - return ''; - } - - /** - * Get an Array of all the tables in the supplied connection - * will halt the script if no tables are found. - * - * @return array Array of tables in the database. - * @throws \InvalidArgumentException When connection class - * does not have a schemaCollection method. - */ - protected function _getAllTables() - { - $db = ConnectionManager::get($this->connection); - if (!method_exists($db, 'schemaCollection')) { - $this->abort( - 'Connections need to implement schemaCollection() to be used with bake.' - ); - } - $schema = $db->getSchemaCollection(); - $tables = $schema->listTables(); - if (empty($tables)) { - $this->abort('Your database does not have any tables.'); - } - sort($tables); - - return $tables; - } - - /** - * Get the table name for the model being baked. - * - * Uses the `table` option if it is set. - * - * @param string $name Table name - * @return string - */ - public function getTable($name) - { - if (isset($this->params['table'])) { - return $this->params['table']; - } - - return Inflector::underscore($name); - } - - /** - * Gets the option parser instance and configures it. - * - * @return \Cake\Console\ConsoleOptionParser - */ - public function getOptionParser() - { - $parser = parent::getOptionParser(); - - $parser->setDescription( - 'Bake table and entity classes.' - )->addArgument('name', [ - 'help' => 'Name of the model to bake (without the Table suffix). ' . - 'You can use Plugin.name to bake plugin models.', - ])->addSubcommand('all', [ - 'help' => 'Bake all model files with associations and validation.', - ])->addOption('table', [ - 'help' => 'The table name to use if you have non-conventional table names.', - ])->addOption('no-entity', [ - 'boolean' => true, - 'help' => 'Disable generating an entity class.', - ])->addOption('no-table', [ - 'boolean' => true, - 'help' => 'Disable generating a table class.', - ])->addOption('no-validation', [ - 'boolean' => true, - 'help' => 'Disable generating validation rules.', - ])->addOption('no-rules', [ - 'boolean' => true, - 'help' => 'Disable generating a rules checker.', - ])->addOption('no-associations', [ - 'boolean' => true, - 'help' => 'Disable generating associations.', - ])->addOption('no-fields', [ - 'boolean' => true, - 'help' => 'Disable generating accessible fields in the entity.', - ])->addOption('fields', [ - 'help' => 'A comma separated list of fields to make accessible.', - ])->addOption('no-hidden', [ - 'boolean' => true, - 'help' => 'Disable generating hidden fields in the entity.', - ])->addOption('hidden', [ - 'help' => 'A comma separated list of fields to hide.', - ])->addOption('primary-key', [ - 'help' => 'The primary key if you would like to manually set one.' . - ' Can be a comma separated list if you are using a composite primary key.', - ])->addOption('display-field', [ - 'help' => 'The displayField if you would like to choose one.', - ])->addOption('no-test', [ - 'boolean' => true, - 'help' => 'Do not generate a test case skeleton.', - ])->addOption('no-fixture', [ - 'boolean' => true, - 'help' => 'Do not generate a test fixture skeleton.', - ])->setEpilog( - 'Omitting all arguments and options will list the table names you can generate models for' - ); - - return $parser; - } - - /** - * Interact with FixtureTask to automatically bake fixtures when baking models. - * - * @param string $className Name of class to bake fixture for - * @param string|null $useTable Optional table name for fixture to use. - * @return void - * @see FixtureTask::bake - */ - public function bakeFixture($className, $useTable = null) - { - if (!empty($this->params['no-fixture'])) { - return; - } - $this->Fixture->connection = $this->connection; - $this->Fixture->plugin = $this->plugin; - $this->Fixture->interactive = $this->interactive; - $this->Fixture->bake($className, $useTable); - } - - /** - * Assembles and writes a unit test file - * - * @param string $className Model class name - * @return string|false - */ - public function bakeTest($className) - { - if (!empty($this->params['no-test'])) { - return false; - } - $this->Test->plugin = $this->plugin; - $this->Test->interactive = $this->interactive; - $this->Test->connection = $this->connection; - - return $this->Test->bake('Table', $className); - } -} diff --git a/vendor/cakephp/bake/src/Shell/Task/PluginTask.php b/vendor/cakephp/bake/src/Shell/Task/PluginTask.php deleted file mode 100644 index a80fc11..0000000 --- a/vendor/cakephp/bake/src/Shell/Task/PluginTask.php +++ /dev/null @@ -1,392 +0,0 @@ -path = current(App::path('Plugin')); - } - - /** - * Execution method always used for tasks - * - * @param string|null $name The name of the plugin to bake. - * @return null|bool - */ - public function main($name = null) - { - if (empty($name)) { - $this->err('You must provide a plugin name in CamelCase format.'); - $this->err('To make an "MyExample" plugin, run `cake bake plugin MyExample`.'); - - return false; - } - $parts = explode('/', $name); - $plugin = implode('/', array_map([$this, '_camelize'], $parts)); - - $pluginPath = $this->_pluginPath($plugin); - if (is_dir($pluginPath)) { - $this->out(sprintf('Plugin: %s already exists, no action taken', $plugin)); - $this->out(sprintf('Path: %s', $pluginPath)); - - return false; - } - if (!$this->bake($plugin)) { - $this->abort(sprintf("An error occurred trying to bake: %s in %s", $plugin, $this->path . $plugin)); - } - } - - /** - * Bake the plugin's contents - * - * Also update the autoloader and the root composer.json file if it can be found - * - * @param string $plugin Name of the plugin in CamelCased format - * @return bool|null - */ - public function bake($plugin) - { - $pathOptions = App::path('Plugin'); - if (count($pathOptions) > 1) { - $this->findPath($pathOptions); - } - $this->out(sprintf("Plugin Name: %s", $plugin)); - $this->out(sprintf("Plugin Directory: %s", $this->path . $plugin)); - $this->hr(); - - $looksGood = $this->in('Look okay?', ['y', 'n', 'q'], 'y'); - - if (strtolower($looksGood) !== 'y') { - return null; - } - - $this->_generateFiles($plugin, $this->path); - - $this->_modifyAutoloader($plugin, $this->path); - $this->_modifyApplication($plugin); - - $this->hr(); - $this->out(sprintf('Created: %s in %s', $plugin, $this->path . $plugin), 2); - - $emptyFile = $this->path . 'empty'; - $this->_deleteEmptyFile($emptyFile); - - return true; - } - - /** - * Modify the application class - * - * @param string $plugin Name of plugin - * the plugin - * @return void - */ - protected function _modifyApplication($plugin) - { - $application = new File(ROOT . DS . 'src' . DS . 'Application.php', false); - if (!$application->exists()) { - $this->err('Could not update application Application.php file, as it could not be found.'); - - return; - } - - $this->dispatchShell('plugin', 'load', $plugin); - } - - /** - * Generate all files for a plugin - * - * Find the first path which contains `src/Template/Bake/Plugin` that contains - * something, and use that as the template to recursively render a plugin's - * contents. Allows the creation of a bake them containing a `Plugin` folder - * to provide customized bake output for plugins. - * - * @param string $pluginName the CamelCase name of the plugin - * @param string $path the path to the plugins dir (the containing folder) - * @return void - */ - protected function _generateFiles($pluginName, $path) - { - $namespace = str_replace('/', '\\', $pluginName); - $baseNamespace = Configure::read('App.namespace'); - - $name = $pluginName; - $vendor = 'your-name-here'; - if (strpos($pluginName, '/') !== false) { - list($vendor, $name) = explode('/', $pluginName); - } - $package = $vendor . '/' . $name; - - $this->BakeTemplate->set([ - 'package' => $package, - 'namespace' => $namespace, - 'baseNamespace' => $baseNamespace, - 'plugin' => $pluginName, - 'routePath' => Inflector::dasherize($pluginName), - 'path' => $path, - 'root' => ROOT, - ]); - - $root = $path . $pluginName . DS; - - $paths = []; - if (!empty($this->params['theme'])) { - $paths[] = Plugin::path($this->params['theme']) . 'src/Template/'; - } - - $paths = array_merge($paths, Configure::read('App.paths.templates')); - $paths[] = Plugin::path('Bake') . 'src/Template/'; - - do { - $templatesPath = array_shift($paths) . 'Bake/Plugin'; - $templatesDir = new Folder($templatesPath); - $templates = $templatesDir->findRecursive('.*\.(twig|ctp)'); - } while (!$templates); - - sort($templates); - foreach ($templates as $template) { - $template = substr($template, strrpos($template, 'Plugin' . DIRECTORY_SEPARATOR) + 7, -4); - $template = rtrim($template, '.'); - $this->_generateFile($template, $root); - } - } - - /** - * Generate a file - * - * @param string $template The template to render - * @param string $root The path to the plugin's root - * @return void - */ - protected function _generateFile($template, $root) - { - $this->out(sprintf('Generating %s file...', $template)); - $out = $this->BakeTemplate->generate('Plugin/' . $template); - $this->createFile($root . $template, $out); - } - - /** - * Modifies App's composer.json to include the plugin and tries to call - * composer dump-autoload to refresh the autoloader cache - * - * @param string $plugin Name of plugin - * @param string $path The path to save the phpunit.xml file to. - * @return bool True if composer could be modified correctly - */ - protected function _modifyAutoloader($plugin, $path) - { - $file = $this->_rootComposerFilePath(); - - if (!file_exists($file)) { - $this->out(sprintf('Main composer file %s not found', $file)); - - return false; - } - - $autoloadPath = str_replace(ROOT, '.', $this->path); - $autoloadPath = str_replace('\\', '/', $autoloadPath); - $namespace = str_replace('/', '\\', $plugin); - - $config = json_decode(file_get_contents($file), true); - $config['autoload']['psr-4'][$namespace . '\\'] = $autoloadPath . $plugin . "/src/"; - $config['autoload-dev']['psr-4'][$namespace . '\\Test\\'] = $autoloadPath . $plugin . "/tests/"; - - $this->out('Modifying composer autoloader'); - - $out = json_encode($config, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE) . "\n"; - $this->createFile($file, $out); - - $composer = $this->findComposer(); - - if (!$composer) { - $this->abort('Could not locate composer. Add composer to your PATH, or use the --composer option.'); - - return false; - } - - try { - $cwd = getcwd(); - - // Windows makes running multiple commands at once hard. - chdir(dirname($this->_rootComposerFilePath())); - $command = 'php ' . escapeshellarg($composer) . ' dump-autoload'; - $this->callProcess($command); - - chdir($cwd); - } catch (\RuntimeException $e) { - $error = $e->getMessage(); - $this->abort(sprintf('Could not run `composer dump-autoload`: %s', $error)); - - return false; - } - - return true; - } - - /** - * The path to the main application's composer file - * - * This is a test isolation wrapper - * - * @return string the abs file path - */ - protected function _rootComposerFilePath() - { - return ROOT . DS . 'composer.json'; - } - - /** - * find and change $this->path to the user selection - * - * @param array $pathOptions The list of paths to look in. - * @return void - */ - public function findPath(array $pathOptions) - { - $valid = false; - foreach ($pathOptions as $i => $path) { - if (!is_dir($path)) { - unset($pathOptions[$i]); - } - } - $pathOptions = array_values($pathOptions); - $max = count($pathOptions); - - if ($max === 0) { - $this->err('No valid plugin paths found! Please configure a plugin path that exists.'); - throw new \RuntimeException(); - } - - if ($max === 1) { - $this->path = $pathOptions[0]; - - return; - } - - $choice = null; - while (!$valid) { - foreach ($pathOptions as $i => $option) { - $this->out($i + 1 . '. ' . $option); - } - $prompt = 'Choose a plugin path from the paths above.'; - $choice = (int)$this->in($prompt, null, '1'); - if ($choice > 0 && $choice <= $max) { - $valid = true; - } - } - $this->path = $pathOptions[$choice - 1]; - } - - /** - * Gets the option parser instance and configures it. - * - * @return \Cake\Console\ConsoleOptionParser - */ - public function getOptionParser() - { - $parser = parent::getOptionParser(); - $parser->setDescription( - 'Create the directory structure, AppController class and testing setup for a new plugin. ' . - 'Can create plugins in any of your bootstrapped plugin paths.' - )->addArgument('name', [ - 'help' => 'CamelCased name of the plugin to create.', - ])->addOption('composer', [ - 'default' => ROOT . DS . 'composer.phar', - 'help' => 'The path to the composer executable.', - ])->removeOption('plugin'); - - return $parser; - } - - /** - * Uses either the CLI option or looks in $PATH and cwd for composer. - * - * @return string|bool Either the path to composer or false if it cannot be found. - */ - public function findComposer() - { - if (!empty($this->params['composer'])) { - $path = $this->params['composer']; - if (file_exists($path)) { - return $path; - } - } - $composer = false; - $path = env('PATH'); - if (!empty($path)) { - $paths = explode(PATH_SEPARATOR, $path); - $composer = $this->_searchPath($paths); - } - - return $composer; - } - - /** - * Search the $PATH for composer. - * - * @param array $path The paths to search. - * @return string|bool - */ - protected function _searchPath($path) - { - $composer = ['composer.phar', 'composer']; - foreach ($path as $dir) { - foreach ($composer as $cmd) { - if (is_file($dir . DS . $cmd)) { - $this->_io->verbose('Found composer executable in ' . $dir); - - return $dir . DS . $cmd; - } - } - } - - return false; - } -} diff --git a/vendor/cakephp/bake/src/Shell/Task/ShellHelperTask.php b/vendor/cakephp/bake/src/Shell/Task/ShellHelperTask.php deleted file mode 100644 index f93891e..0000000 --- a/vendor/cakephp/bake/src/Shell/Task/ShellHelperTask.php +++ /dev/null @@ -1,55 +0,0 @@ -plugin) { - $namespace = $this->_pluginNamespace($this->plugin); - } - - return ['namespace' => $namespace]; - } - - /** - * Execute method - * - * @param string|null $name The name of the object to bake. - * @return int|null - */ - public function main($name = null) - { - parent::main(); - if (empty($name)) { - $this->abort('You must provide a name to bake a ' . $this->name()); - - return null; - } - $name = $this->_getName($name); - $name = Inflector::camelize($name); - $this->bake($name); - $this->bakeTest($name); - } - - /** - * Generate a class stub - * - * @param string $name The classname to generate. - * @return string - */ - public function bake($name) - { - $this->BakeTemplate->set('name', $name); - $this->BakeTemplate->set($this->templateData()); - $contents = $this->BakeTemplate->generate($this->template()); - - $filename = $this->getPath() . $this->fileName($name); - $this->createFile($filename, $contents); - $emptyFile = $this->getPath() . 'empty'; - $this->_deleteEmptyFile($emptyFile); - - return $contents; - } - - /** - * Generate a test case. - * - * @param string $className The class to bake a test for. - * @return string|bool|null - */ - public function bakeTest($className) - { - if (!empty($this->params['no-test'])) { - return null; - } - $this->Test->plugin = $this->plugin; - - return $this->Test->bake($this->name(), $className); - } - - /** - * Gets the option parser instance and configures it. - * - * @return \Cake\Console\ConsoleOptionParser - */ - public function getOptionParser() - { - $parser = parent::getOptionParser(); - $name = $this->name(); - $parser->setDescription( - sprintf('Bake a %s class file.', $name) - )->addArgument('name', [ - 'help' => sprintf( - 'Name of the %s to bake. Can use Plugin.name to bake %s files into plugins.', - $name, - $name - ), - ])->addOption('no-test', [ - 'boolean' => true, - 'help' => 'Do not generate a test skeleton.', - ]); - - return $parser; - } -} diff --git a/vendor/cakephp/bake/src/Shell/Task/TaskTask.php b/vendor/cakephp/bake/src/Shell/Task/TaskTask.php deleted file mode 100644 index 8594373..0000000 --- a/vendor/cakephp/bake/src/Shell/Task/TaskTask.php +++ /dev/null @@ -1,55 +0,0 @@ -path = current(App::path('Template')); - } - - /** - * Execution method always used for tasks - * - * @param string|null $name The name of the controller to bake view templates for. - * @param string|null $template The template to bake with. - * @param string|null $action The output action name. Defaults to $template. - * @return mixed - */ - public function main($name = null, $template = null, $action = null) - { - parent::main(); - - if (empty($name)) { - $this->out('Possible tables to bake view templates for based on your current database:'); - $this->Model->connection = $this->connection; - foreach ($this->Model->listUnskipped() as $table) { - $this->out('- ' . $this->_camelize($table)); - } - - return true; - } - $name = $this->_getName($name); - - $controller = null; - if (!empty($this->params['controller'])) { - $controller = $this->params['controller']; - } - $this->controller($name, $controller); - $this->model($name); - - if ($template && $action === null) { - $action = $template; - } - if ($template) { - $this->bake($template, true, $action); - - return true; - } - - $vars = $this->_loadController(); - $methods = $this->_methodsToBake(); - - foreach ($methods as $method) { - $content = $this->getContent($method, $vars); - if ($content) { - $this->bake($method, $content); - } - } - } - - /** - * Set the model class for the table. - * - * @param string $table The table/model that is being baked. - * @return void - */ - public function model($table) - { - $tableName = $this->_camelize($table); - $plugin = null; - if (!empty($this->params['plugin'])) { - $plugin = $this->params['plugin'] . '.'; - } - $this->modelName = $plugin . $tableName; - } - - /** - * Set the controller related properties. - * - * @param string $table The table/model that is being baked. - * @param string|null $controller The controller name if specified. - * @return void - */ - public function controller($table, $controller = null) - { - $tableName = $this->_camelize($table); - if (empty($controller)) { - $controller = $tableName; - } - $this->controllerName = $controller; - - $plugin = $this->param('plugin'); - if ($plugin) { - $plugin .= '.'; - } - $prefix = $this->_getPrefix(); - if ($prefix) { - $prefix .= '/'; - } - $this->controllerClass = (string)App::className($plugin . $prefix . $controller, 'Controller', 'Controller'); - } - - /** - * Get the path base for view templates. - * - * @return string - */ - public function getPath() - { - $path = parent::getPath(); - $path .= $this->controllerName . DS; - - return $path; - } - - /** - * Get a list of actions that can / should have view templates baked for them. - * - * @return array Array of action names that should be baked - */ - protected function _methodsToBake() - { - $base = Configure::read('App.namespace'); - - $methods = []; - if (class_exists($this->controllerClass)) { - $methods = array_diff( - array_map( - 'Cake\Utility\Inflector::underscore', - get_class_methods($this->controllerClass) - ), - array_map( - 'Cake\Utility\Inflector::underscore', - get_class_methods($base . '\Controller\AppController') - ) - ); - } - if (empty($methods)) { - $methods = $this->scaffoldActions; - } - foreach ($methods as $i => $method) { - if ($method[0] === '_') { - unset($methods[$i]); - } - } - - return $methods; - } - - /** - * Bake All view templates for all controller actions. - * - * @return void - */ - public function all() - { - $this->Model->connection = $this->connection; - $tables = $this->Model->listUnskipped(); - - foreach ($tables as $table) { - $this->main($table); - } - } - - /** - * Loads Controller and sets variables for the template - * Available template variables: - * - * - 'modelObject' - * - 'modelClass' - * - 'entityClass' - * - 'primaryKey' - * - 'displayField' - * - 'singularVar' - * - 'pluralVar' - * - 'singularHumanName' - * - 'pluralHumanName' - * - 'fields' - * - 'keyFields' - * - 'schema' - * - * @return array Returns variables to be made available to a view template - */ - protected function _loadController() - { - if (TableRegistry::getTableLocator()->exists($this->modelName)) { - $modelObject = TableRegistry::getTableLocator()->get($this->modelName); - } else { - $modelObject = TableRegistry::getTableLocator()->get($this->modelName, [ - 'connectionName' => $this->connection, - ]); - } - - $namespace = Configure::read('App.namespace'); - - $primaryKey = (array)$modelObject->getPrimaryKey(); - $displayField = $modelObject->getDisplayField(); - $singularVar = $this->_singularName($this->controllerName); - $singularHumanName = $this->_singularHumanName($this->controllerName); - $schema = $modelObject->getSchema(); - $fields = $schema->columns(); - $modelClass = $this->modelName; - - list(, $entityClass) = namespaceSplit($this->_entityName($this->modelName)); - $entityClass = sprintf('%s\Model\Entity\%s', $namespace, $entityClass); - if (!class_exists($entityClass)) { - $entityClass = EntityInterface::class; - } - $associations = $this->_filteredAssociations($modelObject); - $keyFields = []; - if (!empty($associations['BelongsTo'])) { - foreach ($associations['BelongsTo'] as $assoc) { - $keyFields[$assoc['foreignKey']] = $assoc['variable']; - } - } - - $pluralVar = Inflector::variable($this->controllerName); - $pluralHumanName = $this->_pluralHumanName($this->controllerName); - - return compact( - 'modelObject', - 'modelClass', - 'entityClass', - 'schema', - 'primaryKey', - 'displayField', - 'singularVar', - 'pluralVar', - 'singularHumanName', - 'pluralHumanName', - 'fields', - 'associations', - 'keyFields', - 'namespace' - ); - } - - /** - * Assembles and writes bakes the view file. - * - * @param string $template Template file to use. - * @param string|true $content Content to write. - * @param string $outputFile The output file to create. If null will use `$template` - * @return string|false Generated file content. - */ - public function bake($template, $content = '', $outputFile = null) - { - if ($outputFile === null) { - $outputFile = $template; - } - if ($content === true) { - $content = $this->getContent($template); - } - if (empty($content)) { - $this->err("No generated content for '{$template}.ctp', not generating template."); - - return false; - } - $this->out("\n" . sprintf('Baking `%s` view template file...', $outputFile), 1, Shell::QUIET); - $path = $this->getPath(); - $filename = $path . Inflector::underscore($outputFile) . '.ctp'; - $this->createFile($filename, $content); - - return $content; - } - - /** - * Builds content from template and variables - * - * @param string $action name to generate content to - * @param array|null $vars passed for use in templates - * @return string|false Content from template - */ - public function getContent($action, $vars = null) - { - if (!$vars) { - $vars = $this->_loadController(); - } - - if (empty($vars['primaryKey'])) { - $this->abort('Cannot generate views for models with no primary key'); - - return false; - } - - if ($action === "index" && !empty($this->params['index-columns'])) { - $this->BakeTemplate->set('indexColumns', $this->params['index-columns']); - } - - $this->BakeTemplate->set('action', $action); - $this->BakeTemplate->set('plugin', $this->plugin); - $this->BakeTemplate->set($vars); - - return $this->BakeTemplate->generate("Template/$action"); - } - - /** - * Gets the option parser instance and configures it. - * - * @return \Cake\Console\ConsoleOptionParser - */ - public function getOptionParser() - { - $parser = parent::getOptionParser(); - - $parser->setDescription( - 'Bake views for a controller, using built-in or custom templates. ' - )->addArgument('controller', [ - 'help' => 'Name of the controller views to bake. You can use Plugin.name as a shortcut for plugin baking.', - ])->addArgument('action', [ - 'help' => "Will bake a single action's file. core templates are (index, add, edit, view)", - ])->addArgument('alias', [ - 'help' => 'Will bake the template in but create the filename after .', - ])->addOption('controller', [ - 'help' => 'The controller name if you have a controller that does not follow conventions.', - ])->addOption('prefix', [ - 'help' => 'The routing prefix to generate views for.', - ])->addOption('index-columns', [ - 'help' => 'Limit for the number of index columns', - 'default' => 0, - ])->addSubcommand('all', [ - 'help' => '[optional] Bake all CRUD action views for all controllers. Requires models and controllers to exist.', - ]); - - return $parser; - } - - /** - * Get filtered associations - * To be mocked... - * - * @param \Cake\ORM\Table $model Table - * @return array associations - */ - protected function _filteredAssociations(Table $model) - { - if (is_null($this->_associationFilter)) { - $this->_associationFilter = new AssociationFilter(); - } - - return $this->_associationFilter->filterAssociations($model); - } -} diff --git a/vendor/cakephp/bake/src/Shell/Task/TestTask.php b/vendor/cakephp/bake/src/Shell/Task/TestTask.php deleted file mode 100644 index e6dacdc..0000000 --- a/vendor/cakephp/bake/src/Shell/Task/TestTask.php +++ /dev/null @@ -1,752 +0,0 @@ - 'Model\Entity', - 'Table' => 'Model\Table', - 'Controller' => 'Controller', - 'Component' => 'Controller\Component', - 'Behavior' => 'Model\Behavior', - 'Helper' => 'View\Helper', - 'Shell' => 'Shell', - 'Task' => 'Shell\Task', - 'ShellHelper' => 'Shell\Helper', - 'Cell' => 'View\Cell', - 'Form' => 'Form', - 'Mailer' => 'Mailer', - 'Command' => 'Command', - ]; - - /** - * class types that methods can be generated for - * - * @var array - */ - public $classSuffixes = [ - 'Entity' => '', - 'Table' => 'Table', - 'Controller' => 'Controller', - 'Component' => 'Component', - 'Behavior' => 'Behavior', - 'Helper' => 'Helper', - 'Shell' => 'Shell', - 'Task' => 'Task', - 'ShellHelper' => 'Helper', - 'Cell' => 'Cell', - 'Form' => 'Form', - 'Mailer' => 'Mailer', - 'Command' => 'Command', - ]; - - /** - * Internal list of fixtures that have been added so far. - * - * @var array - */ - protected $_fixtures = []; - - /** - * Execution method always used for tasks - * - * @param string|null $type Class type. - * @param string|null $name Name. - * @return array|null - */ - public function main($type = null, $name = null) - { - parent::main(); - $type = $this->normalize($type); - $name = $this->_getName($name); - - if (empty($type) && empty($name)) { - $this->outputTypeChoices(); - - return null; - } - - if ($this->param('all')) { - $this->_bakeAll($type); - - return null; - } - - if (empty($name)) { - return $this->outputClassChoices($type); - } - - if ($this->bake($type, $name)) { - $this->out('Done'); - } - } - - /** - * Output a list of class types you can bake a test for. - * - * @return void - */ - public function outputTypeChoices() - { - $this->out( - 'You must provide a class type to bake a test for. The valid types are:', - 2 - ); - $i = 0; - foreach ($this->classTypes as $option => $package) { - $this->out(++$i . '. ' . $option); - } - $this->out(''); - $this->out('Re-run your command as `cake bake `'); - } - - /** - * Output a list of possible classnames you might want to generate a test for. - * - * @param string $typeName The typename to get classes for. - * @return array - */ - public function outputClassChoices($typeName) - { - $type = $this->mapType($typeName); - $this->out( - 'You must provide a class to bake a test for. Some possible options are:', - 2 - ); - $options = $this->_getClassOptions($type); - $i = 0; - foreach ($options as $option) { - $this->out(++$i . '. ' . $option); - } - $this->out(''); - $this->out('Re-run your command as `cake bake ' . $typeName . ' `'); - - return $options; - } - - /** - * @param string $type The typename to get bake all classes for. - * @return void - */ - protected function _bakeAll($type) - { - $mappedType = $this->mapType($type); - $classes = $this->_getClassOptions($mappedType); - - foreach ($classes as $class) { - if ($this->bake($type, $class)) { - $this->out('Done - ' . $class . ''); - } else { - $this->out('Failed - ' . $class . ''); - } - } - - $this->out('Bake finished'); - } - - /** - * Get the possible classes for a given type. - * - * @param string $namespace The namespace fragment to look for classes in. - * @return array - */ - protected function _getClassOptions($namespace) - { - $classes = []; - $base = APP; - if ($this->plugin) { - $base = Plugin::classPath($this->plugin); - } - $path = $base . str_replace('\\', DS, $namespace); - $folder = new Folder($path); - list(, $files) = $folder->read(); - foreach ($files as $file) { - $classes[] = str_replace('.php', '', $file); - } - - return $classes; - } - - /** - * Completes final steps for generating data to create test case. - * - * @param string $type Type of object to bake test case for ie. Model, Controller - * @param string $className the 'cake name' for the class ie. Posts for the PostsController - * @return string|false - */ - public function bake($type, $className) - { - $type = $this->normalize($type); - if (!isset($this->classSuffixes[$type]) || !isset($this->classTypes[$type])) { - return false; - } - - $fullClassName = $this->getRealClassName($type, $className); - - if (empty($this->params['no-fixture'])) { - if (!empty($this->params['fixtures'])) { - $fixtures = array_map('trim', explode(',', $this->params['fixtures'])); - $this->_fixtures = array_filter($fixtures); - } elseif ($this->typeCanDetectFixtures($type) && class_exists($fullClassName)) { - $this->out('Bake is detecting possible fixtures...'); - $testSubject = $this->buildTestSubject($type, $fullClassName); - $this->generateFixtureList($testSubject); - } - } - - $methods = []; - if (class_exists($fullClassName)) { - $methods = $this->getTestableMethods($fullClassName); - } - $mock = $this->hasMockClass($type); - list($preConstruct, $construction, $postConstruct) = $this->generateConstructor($type, $fullClassName); - $uses = $this->generateUses($type, $fullClassName); - - $subject = $className; - list($namespace, $className) = namespaceSplit($fullClassName); - - $baseNamespace = Configure::read('App.namespace'); - if ($this->plugin) { - $baseNamespace = $this->_pluginNamespace($this->plugin); - } - $subNamespace = substr($namespace, strlen($baseNamespace) + 1); - - $properties = $this->generateProperties($type, $subject, $fullClassName); - - $this->out("\n" . sprintf('Baking test case for %s ...', $fullClassName), 1, Shell::QUIET); - - $this->BakeTemplate->set('fixtures', $this->_fixtures); - $this->BakeTemplate->set('plugin', $this->plugin); - $this->BakeTemplate->set(compact( - 'subject', - 'className', - 'properties', - 'methods', - 'type', - 'fullClassName', - 'mock', - 'type', - 'preConstruct', - 'postConstruct', - 'construction', - 'uses', - 'baseNamespace', - 'subNamespace', - 'namespace' - )); - $out = $this->BakeTemplate->generate('tests/test_case'); - - $filename = $this->testCaseFileName($type, $fullClassName); - $emptyFile = $this->getPath() . $this->getSubspacePath($type) . DS . 'empty'; - $this->_deleteEmptyFile($emptyFile); - if ($this->createFile($filename, $out)) { - return $out; - } - - return false; - } - - /** - * Checks whether the chosen type can find its own fixtures. - * Currently only model, and controller are supported - * - * @param string $type The Type of object you are generating tests for eg. controller - * @return bool - */ - public function typeCanDetectFixtures($type) - { - return in_array($type, ['Controller', 'Table'], true); - } - - /** - * Construct an instance of the class to be tested. - * So that fixtures can be detected - * - * @param string $type The type of object you are generating tests for eg. controller - * @param string $class The classname of the class the test is being generated for. - * @return object And instance of the class that is going to be tested. - */ - public function buildTestSubject($type, $class) - { - if ($type === 'Table') { - list(, $name) = namespaceSplit($class); - $name = str_replace('Table', '', $name); - if ($this->plugin) { - $name = $this->plugin . '.' . $name; - } - if (TableRegistry::getTableLocator()->exists($name)) { - $instance = TableRegistry::getTableLocator()->get($name); - } else { - $instance = TableRegistry::getTableLocator()->get($name, [ - 'connectionName' => $this->connection, - ]); - } - } elseif ($type === 'Controller') { - $instance = new $class(new Request(), new Response()); - } else { - $instance = new $class(); - } - - return $instance; - } - - /** - * Gets the real class name from the cake short form. If the class name is already - * suffixed with the type, the type will not be duplicated. - * - * @param string $type The Type of object you are generating tests for eg. controller. - * @param string $class the Classname of the class the test is being generated for. - * @return string Real class name - */ - public function getRealClassName($type, $class) - { - $namespace = Configure::read('App.namespace'); - if ($this->plugin) { - $namespace = str_replace('/', '\\', $this->plugin); - } - $suffix = $this->classSuffixes[$type]; - $subSpace = $this->mapType($type); - if ($suffix && strpos($class, $suffix) === false) { - $class .= $suffix; - } - $prefix = $this->_getPrefix(); - if (in_array($type, ['Controller', 'Cell'], true) && $prefix) { - $subSpace .= '\\' . str_replace('/', '\\', $prefix); - } - - return $namespace . '\\' . $subSpace . '\\' . $class; - } - - /** - * Gets the subspace path for a test. - * - * @param string $type The Type of object you are generating tests for eg. controller. - * @return string Path of the subspace. - */ - public function getSubspacePath($type) - { - $subspace = $this->mapType($type); - - return str_replace('\\', DS, $subspace); - } - - /** - * Map the types that TestTask uses to concrete types that App::className can use. - * - * @param string $type The type of thing having a test generated. - * @return string - * @throws \Cake\Core\Exception\Exception When invalid object types are requested. - */ - public function mapType($type) - { - if (empty($this->classTypes[$type])) { - throw new Exception('Invalid object type.'); - } - - return $this->classTypes[$type]; - } - - /** - * Get methods declared in the class given. - * No parent methods will be returned - * - * @param string $className Name of class to look at. - * @return array Array of method names. - */ - public function getTestableMethods($className) - { - $class = new ReflectionClass($className); - $out = []; - foreach ($class->getMethods() as $method) { - if ($method->getDeclaringClass()->getName() !== $className) { - continue; - } - if (!$method->isPublic()) { - continue; - } - $out[] = $method->getName(); - } - - return $out; - } - - /** - * Generate the list of fixtures that will be required to run this test based on - * loaded models. - * - * @param object $subject The object you want to generate fixtures for. - * @return array Array of fixtures to be included in the test. - */ - public function generateFixtureList($subject) - { - $this->_fixtures = []; - if ($subject instanceof Table) { - $this->_processModel($subject); - } elseif ($subject instanceof Controller) { - $this->_processController($subject); - } - - return array_values($this->_fixtures); - } - - /** - * Process a model, pull out model name + associations converted to fixture names. - * - * @param \Cake\ORM\Table $subject A Model class to scan for associations and pull fixtures off of. - * @return void - */ - protected function _processModel($subject) - { - if (!$subject instanceof Table) { - return; - } - $this->_addFixture($subject->getAlias()); - foreach ($subject->associations()->keys() as $alias) { - $assoc = $subject->getAssociation($alias); - $target = $assoc->getTarget(); - $name = $target->getAlias(); - $subjectClass = get_class($subject); - - if ($subjectClass !== 'Cake\ORM\Table' && $subjectClass === get_class($target)) { - continue; - } - if (!isset($this->_fixtures[$name])) { - $this->_addFixture($target->getAlias()); - } - } - } - - /** - * Process all the models attached to a controller - * and generate a fixture list. - * - * @param \Cake\Controller\Controller $subject A controller to pull model names off of. - * @return void - */ - protected function _processController($subject) - { - $models = [$subject->modelClass]; - foreach ($models as $model) { - list(, $model) = pluginSplit($model); - $this->_processModel($subject->{$model}); - } - } - - /** - * Add class name to the fixture list. - * Sets the app. or plugin.plugin_name. prefix. - * - * @param string $name Name of the Model class that a fixture might be required for. - * @return void - */ - protected function _addFixture($name) - { - if ($this->plugin) { - $prefix = 'plugin.' . $this->plugin . '.'; - } else { - $prefix = 'app.'; - } - $fixture = $prefix . $this->_fixtureName($name); - $this->_fixtures[$name] = $fixture; - } - - /** - * Is a mock class required for this type of test? - * Controllers require a mock class. - * - * @param string $type The type of object tests are being generated for eg. controller. - * @return bool - */ - public function hasMockClass($type) - { - return $type === 'Controller'; - } - - /** - * Generate a constructor code snippet for the type and class name - * - * @param string $type The Type of object you are generating tests for eg. controller - * @param string $fullClassName The full classname of the class the test is being generated for. - * @return array Constructor snippets for the thing you are building. - */ - public function generateConstructor($type, $fullClassName) - { - list(, $className) = namespaceSplit($fullClassName); - $pre = $construct = $post = ''; - if ($type === 'Table') { - $tableName = str_replace('Table', '', $className); - $pre = "\$config = TableRegistry::getTableLocator()->exists('{$tableName}') ? [] : ['className' => {$className}::class];"; - $construct = "TableRegistry::getTableLocator()->get('{$tableName}', \$config);"; - } - if ($type === 'Behavior' || $type === 'Entity' || $type === 'Form') { - $construct = "new {$className}();"; - } - if ($type === 'Helper') { - $pre = "\$view = new View();"; - $construct = "new {$className}(\$view);"; - } - if ($type === 'Command') { - $construct = "\$this->useCommandRunner();"; - } - if ($type === 'Component') { - $pre = "\$registry = new ComponentRegistry();"; - $construct = "new {$className}(\$registry);"; - } - if ($type === 'Shell') { - $pre = "\$this->io = \$this->getMockBuilder('Cake\Console\ConsoleIo')->getMock();"; - $construct = "new {$className}(\$this->io);"; - } - if ($type === 'Task') { - $pre = "\$this->io = \$this->getMockBuilder('Cake\Console\ConsoleIo')->getMock();"; - $construct = "new {$className}(\$this->io);"; - } - if ($type === 'Cell') { - $pre = "\$this->request = \$this->getMockBuilder('Cake\Http\ServerRequest')->getMock();\n"; - $pre .= " \$this->response = \$this->getMockBuilder('Cake\Http\Response')->getMock();"; - $construct = "new {$className}(\$this->request, \$this->response);"; - } - if ($type === 'ShellHelper') { - $pre = "\$this->stub = new ConsoleOutput();\n"; - $pre .= " \$this->io = new ConsoleIo(\$this->stub);"; - $construct = "new {$className}(\$this->io);"; - } - - return [$pre, $construct, $post]; - } - - /** - * Generate property info for the type and class name - * - * The generated property info consists of a set of arrays that hold the following keys: - * - * - `description` (the property description) - * - `type` (the property docblock type) - * - `name` (the property name) - * - `value` (optional - the properties initial value) - * - * @param string $type The Type of object you are generating tests for eg. controller - * @param string $subject The name of the test subject. - * @param string $fullClassName The Classname of the class the test is being generated for. - * @return array An array containing property info - */ - public function generateProperties($type, $subject, $fullClassName) - { - $properties = []; - switch ($type) { - case 'Cell': - $properties[] = [ - 'description' => 'Request mock', - 'type' => '\Cake\Http\ServerRequest|\PHPUnit_Framework_MockObject_MockObject', - 'name' => 'request', - ]; - $properties[] = [ - 'description' => 'Response mock', - 'type' => '\Cake\Http\Response|\PHPUnit_Framework_MockObject_MockObject', - 'name' => 'response', - ]; - break; - - case 'Shell': - case 'Task': - $properties[] = [ - 'description' => 'ConsoleIo mock', - 'type' => '\Cake\Console\ConsoleIo|\PHPUnit_Framework_MockObject_MockObject', - 'name' => 'io', - ]; - break; - - case 'ShellHelper': - $properties[] = [ - 'description' => 'ConsoleOutput stub', - 'type' => '\Cake\TestSuite\Stub\ConsoleOutput', - 'name' => 'stub', - ]; - $properties[] = [ - 'description' => 'ConsoleIo mock', - 'type' => '\Cake\Console\ConsoleIo', - 'name' => 'io', - ]; - break; - } - - if (!in_array($type, ['Controller', 'Command'])) { - $properties[] = [ - 'description' => 'Test subject', - 'type' => '\\' . $fullClassName, - 'name' => $subject, - ]; - } - - return $properties; - } - - /** - * Generate the uses() calls for a type & class name - * - * @param string $type The Type of object you are generating tests for eg. controller - * @param string $fullClassName The Classname of the class the test is being generated for. - * @return array An array containing used classes - */ - public function generateUses($type, $fullClassName) - { - $uses = []; - if ($type === 'Component') { - $uses[] = 'Cake\Controller\ComponentRegistry'; - } - if ($type === 'Table') { - $uses[] = 'Cake\ORM\TableRegistry'; - } - if ($type === 'Helper') { - $uses[] = 'Cake\View\View'; - } - if ($type === 'ShellHelper') { - $uses[] = 'Cake\TestSuite\Stub\ConsoleOutput'; - $uses[] = 'Cake\Console\ConsoleIo'; - } - $uses[] = $fullClassName; - - return $uses; - } - - /** - * Get the file path. - * - * @return string - */ - public function getPath() - { - $dir = 'TestCase/'; - $path = defined('TESTS') ? TESTS . $dir : ROOT . DS . 'tests' . DS . $dir; - if (isset($this->plugin)) { - $path = $this->_pluginPath($this->plugin) . 'tests/' . $dir; - } - - return $path; - } - - /** - * Make the filename for the test case. resolve the suffixes for controllers - * and get the plugin path if needed. - * - * @param string $type The Type of object you are generating tests for eg. controller - * @param string $className The fully qualified classname of the class the test is being generated for. - * @return string filename the test should be created on. - */ - public function testCaseFileName($type, $className) - { - $path = $this->getPath(); - $namespace = Configure::read('App.namespace'); - if ($this->plugin) { - $namespace = $this->plugin; - } - - $classTail = substr($className, strlen($namespace) + 1); - $path = $path . $classTail . 'Test.php'; - - return str_replace(['/', '\\'], DS, $path); - } - - /** - * Gets the option parser instance and configures it. - * - * @return \Cake\Console\ConsoleOptionParser - */ - public function getOptionParser() - { - $parser = parent::getOptionParser(); - - $types = array_keys($this->classTypes); - $types = array_merge($types, array_map([$this, 'underscore'], $types)); - - $parser->setDescription( - 'Bake test case skeletons for classes.' - )->addArgument('type', [ - 'help' => 'Type of class to bake, can be any of the following:' . - ' controller, model, helper, component or behavior.', - 'choices' => $types, - ])->addArgument('name', [ - 'help' => 'An existing class to bake tests for.', - ])->addOption('fixtures', [ - 'help' => 'A comma separated list of fixture names you want to include.', - ])->addOption('no-fixture', [ - 'boolean' => true, - 'default' => false, - 'help' => 'Select if you want to bake without fixture.', - ])->addOption('prefix', [ - 'default' => false, - 'help' => 'Use when baking tests for prefixed controllers.', - ])->addOption('all', [ - 'boolean' => true, - 'help' => 'Bake all classes of the given type', - ]); - - return $parser; - } - - /** - * Normalizes string into CamelCase format. - * - * @param string $string String to inflect - * @return string - */ - protected function normalize($string) - { - return Inflector::camelize(Inflector::underscore($string)); - } - - /** - * Helper to allow under_score format for CLI env usage. - * - * @param string $string String to inflect - * @return string - */ - protected function underscore($string) - { - return Inflector::underscore($string); - } -} diff --git a/vendor/cakephp/bake/src/Template/Bake/Command/command.twig b/vendor/cakephp/bake/src/Template/Bake/Command/command.twig deleted file mode 100644 index f41ab65..0000000 --- a/vendor/cakephp/bake/src/Template/Bake/Command/command.twig +++ /dev/null @@ -1,54 +0,0 @@ -{# -/** - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * - * Licensed under The MIT License - * For full copyright and license information, please see the LICENSE.txt - * Redistributions of files must retain the above copyright notice. - * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project - * @since 1.7.4 - * @license http://www.opensource.org/licenses/mit-license.php MIT License - */ -#} - 1 %} - -{% endif %} - {%- element 'Controller/' ~ action %} -{% endfor %} -} diff --git a/vendor/cakephp/bake/src/Template/Bake/Element/Controller/add.twig b/vendor/cakephp/bake/src/Template/Bake/Element/Controller/add.twig deleted file mode 100644 index dc7c0f6..0000000 --- a/vendor/cakephp/bake/src/Template/Bake/Element/Controller/add.twig +++ /dev/null @@ -1,45 +0,0 @@ -{# -/** - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * - * Licensed under The MIT License - * For full copyright and license information, please see the LICENSE.txt - * Redistributions of files must retain the above copyright notice. - * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project - * @since 2.0.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License - */ -#} -{% set compact = ["'#{singularName}'"] %} - /** - * Add method - * - * @return \Cake\Http\Response|null Redirects on successful add, renders view otherwise. - */ - public function add() - { - ${{ singularName }} = $this->{{ currentModelName }}->newEntity(); - if ($this->request->is('post')) { - ${{ singularName }} = $this->{{ currentModelName }}->patchEntity(${{ singularName }}, $this->request->getData()); - if ($this->{{ currentModelName }}->save(${{ singularName }})) { - $this->Flash->success(__('The {{ singularHumanName|lower }} has been saved.')); - - return $this->redirect(['action' => 'index']); - } - $this->Flash->error(__('The {{ singularHumanName|lower }} could not be saved. Please, try again.')); - } -{% set associations = Bake.aliasExtractor(modelObj, 'BelongsTo') %} -{% set associations = associations|merge(Bake.aliasExtractor(modelObj, 'BelongsToMany')) %} - -{%- for assoc in associations %} - {%- set otherName = Bake.getAssociatedTableAlias(modelObj, assoc) %} - {%- set otherPlural = otherName|variable %} - ${{ otherPlural }} = $this->{{ currentModelName }}->{{ otherName }}->find('list', ['limit' => 200]); - {{- "\n" }} - {%- set compact = compact|merge(["'#{otherPlural}'"]) %} -{% endfor %} - $this->set(compact({{ compact|join(', ')|raw }})); - } diff --git a/vendor/cakephp/bake/src/Template/Bake/Element/Controller/delete.twig b/vendor/cakephp/bake/src/Template/Bake/Element/Controller/delete.twig deleted file mode 100644 index 69c0cfc..0000000 --- a/vendor/cakephp/bake/src/Template/Bake/Element/Controller/delete.twig +++ /dev/null @@ -1,34 +0,0 @@ -{# -/** - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * - * Licensed under The MIT License - * For full copyright and license information, please see the LICENSE.txt - * Redistributions of files must retain the above copyright notice. - * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project - * @since 2.0.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License - */ -#} - /** - * Delete method - * - * @param string|null $id {{ singularHumanName }} id. - * @return \Cake\Http\Response|null Redirects to index. - * @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found. - */ - public function delete($id = null) - { - $this->request->allowMethod(['post', 'delete']); - ${{ singularName }} = $this->{{ currentModelName }}->get($id); - if ($this->{{ currentModelName }}->delete(${{ singularName }})) { - $this->Flash->success(__('The {{ singularHumanName|lower }} has been deleted.')); - } else { - $this->Flash->error(__('The {{ singularHumanName|lower }} could not be deleted. Please, try again.')); - } - - return $this->redirect(['action' => 'index']); - } diff --git a/vendor/cakephp/bake/src/Template/Bake/Element/Controller/edit.twig b/vendor/cakephp/bake/src/Template/Bake/Element/Controller/edit.twig deleted file mode 100644 index 82e9be3..0000000 --- a/vendor/cakephp/bake/src/Template/Bake/Element/Controller/edit.twig +++ /dev/null @@ -1,48 +0,0 @@ -{# -/** - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * - * Licensed under The MIT License - * For full copyright and license information, please see the LICENSE.txt - * Redistributions of files must retain the above copyright notice. - * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project - * @since 2.0.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License - */ -#} -{% set belongsTo = Bake.aliasExtractor(modelObj, 'BelongsTo') %} -{% set belongsToMany = Bake.aliasExtractor(modelObj, 'belongsToMany') %} -{% set compact = ["'#{singularName}'"] %} - /** - * Edit method - * - * @param string|null $id {{ singularHumanName }} id. - * @return \Cake\Http\Response|null Redirects on successful edit, renders view otherwise. - * @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found. - */ - public function edit($id = null) - { - ${{ singularName }} = $this->{{ currentModelName }}->get($id, [ - 'contain' => [{{ Bake.stringifyList(belongsToMany, {'indent': false})|raw }}], - ]); - if ($this->request->is(['patch', 'post', 'put'])) { - ${{ singularName }} = $this->{{ currentModelName }}->patchEntity(${{ singularName }}, $this->request->getData()); - if ($this->{{ currentModelName }}->save(${{ singularName }})) { - $this->Flash->success(__('The {{ singularHumanName|lower }} has been saved.')); - - return $this->redirect(['action' => 'index']); - } - $this->Flash->error(__('The {{ singularHumanName|lower }} could not be saved. Please, try again.')); - } -{% for assoc in belongsTo|merge(belongsToMany) %} - {%- set otherName = Bake.getAssociatedTableAlias(modelObj, assoc) %} - {%- set otherPlural = otherName|variable %} - ${{ otherPlural }} = $this->{{ currentModelName }}->{{ otherName }}->find('list', ['limit' => 200]); - {{- "\n" }} - {%- set compact = compact|merge(["'#{otherPlural}'"]) %} -{% endfor %} - $this->set(compact({{ compact|join(', ')|raw }})); - } diff --git a/vendor/cakephp/bake/src/Template/Bake/Element/Controller/index.twig b/vendor/cakephp/bake/src/Template/Bake/Element/Controller/index.twig deleted file mode 100644 index 9f98e0d..0000000 --- a/vendor/cakephp/bake/src/Template/Bake/Element/Controller/index.twig +++ /dev/null @@ -1,32 +0,0 @@ -{# -/** - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * - * Licensed under The MIT License - * For full copyright and license information, please see the LICENSE.txt - * Redistributions of files must retain the above copyright notice. - * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project - * @since 2.0.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License - */ -#} - /** - * Index method - * - * @return \Cake\Http\Response|null - */ - public function index() - { -{% set belongsTo = Bake.aliasExtractor(modelObj, 'BelongsTo') %} -{% if belongsTo %} - $this->paginate = [ - 'contain' => [{{ Bake.stringifyList(belongsTo, {'indent': false})|raw }}], - ]; -{% endif %} - ${{ pluralName }} = $this->paginate($this->{{ currentModelName }}); - - $this->set(compact('{{ pluralName }}')); - } diff --git a/vendor/cakephp/bake/src/Template/Bake/Element/Controller/login.twig b/vendor/cakephp/bake/src/Template/Bake/Element/Controller/login.twig deleted file mode 100644 index 97836e0..0000000 --- a/vendor/cakephp/bake/src/Template/Bake/Element/Controller/login.twig +++ /dev/null @@ -1,32 +0,0 @@ -{# -/** - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * - * Licensed under The MIT License - * For full copyright and license information, please see the LICENSE.txt - * Redistributions of files must retain the above copyright notice. - * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project - * @since 2.0.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License - */ -#} - /** - * Login method - * - * @return \Cake\Http\Response|null - */ - public function login() - { - if ($this->request->is('post')) { - $user = $this->Auth->identify(); - if ($user) { - $this->Auth->setUser($user); - - return $this->redirect($this->Auth->redirectUrl()); - } - $this->Flash->error(__('Invalid credentials, try again')); - } - } diff --git a/vendor/cakephp/bake/src/Template/Bake/Element/Controller/logout.twig b/vendor/cakephp/bake/src/Template/Bake/Element/Controller/logout.twig deleted file mode 100644 index 4a64757..0000000 --- a/vendor/cakephp/bake/src/Template/Bake/Element/Controller/logout.twig +++ /dev/null @@ -1,24 +0,0 @@ -{# -/** - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * - * Licensed under The MIT License - * For full copyright and license information, please see the LICENSE.txt - * Redistributions of files must retain the above copyright notice. - * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project - * @since 2.0.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License - */ -#} - /** - * Logout method - * - * @return \Cake\Http\Response - */ - public function logout() - { - return $this->redirect($this->Auth->logout()); - } diff --git a/vendor/cakephp/bake/src/Template/Bake/Element/Controller/view.twig b/vendor/cakephp/bake/src/Template/Bake/Element/Controller/view.twig deleted file mode 100644 index 94e2cf0..0000000 --- a/vendor/cakephp/bake/src/Template/Bake/Element/Controller/view.twig +++ /dev/null @@ -1,34 +0,0 @@ -{# -/** - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * - * Licensed under The MIT License - * For full copyright and license information, please see the LICENSE.txt - * Redistributions of files must retain the above copyright notice. - * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project - * @since 2.0.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License - */ -#} -{% set allAssociations = Bake.aliasExtractor(modelObj, 'BelongsTo') %} -{% set allAssociations = allAssociations|merge(Bake.aliasExtractor(modelObj, 'BelongsToMany')) %} -{% set allAssociations = allAssociations|merge(Bake.aliasExtractor(modelObj, 'HasOne')) %} -{% set allAssociations = allAssociations|merge(Bake.aliasExtractor(modelObj, 'HasMany')) %} - /** - * View method - * - * @param string|null $id {{ singularHumanName }} id. - * @return \Cake\Http\Response|null - * @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found. - */ - public function view($id = null) - { - ${{ singularName }} = $this->{{ currentModelName }}->get($id, [ - 'contain' => [{{ Bake.stringifyList(allAssociations, {'indent': false})|raw }}], - ]); - - $this->set('{{ singularName }}', ${{ singularName }}); - } diff --git a/vendor/cakephp/bake/src/Template/Bake/Element/array_property.twig b/vendor/cakephp/bake/src/Template/Bake/Element/array_property.twig deleted file mode 100644 index ff5bd9f..0000000 --- a/vendor/cakephp/bake/src/Template/Bake/Element/array_property.twig +++ /dev/null @@ -1,6 +0,0 @@ - /** - * {{ name|humanize }} - * - * @var array - */ - public ${{ name }} = [{{ Bake.stringifyList(value, {'indent': false})|raw }}]; \ No newline at end of file diff --git a/vendor/cakephp/bake/src/Template/Bake/Element/form.twig b/vendor/cakephp/bake/src/Template/Bake/Element/form.twig deleted file mode 100644 index b2d9e50..0000000 --- a/vendor/cakephp/bake/src/Template/Bake/Element/form.twig +++ /dev/null @@ -1,80 +0,0 @@ -{# -/** - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * - * Licensed under The MIT License - * For full copyright and license information, please see the LICENSE.txt - * Redistributions of files must retain the above copyright notice. - * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project - * @since 2.0.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License - */ -#} -{% set fields = Bake.filterFields(fields, schema, modelObject) %} - -
- Form->create(${{ singularVar }}) ?> -
- - Form->control('{{ field }}', ['options' => ${{ keyFields[field] }}, 'empty' => true]); - {{- "\n" }} - {%- else %} - echo $this->Form->control('{{ field }}', ['options' => ${{ keyFields[field] }}]); - {{- "\n" }} - {%- endif %} - {%- elseif field not in ['created', 'modified', 'updated'] %} - {%- set fieldData = Bake.columnData(field, schema) %} - {%- if fieldData.type in ['date', 'datetime', 'time'] and fieldData.null %} - echo $this->Form->control('{{ field }}', ['empty' => true]); - {{- "\n" }} - {%- else %} - echo $this->Form->control('{{ field }}'); - {{- "\n" }} - {%- endif %} - {%- endif %} -{%- endfor %} - -{%- if associations.BelongsToMany %} - {%- for assocName, assocData in associations.BelongsToMany %} - echo $this->Form->control('{{ assocData.property }}._ids', ['options' => ${{ assocData.variable }}]); - {{- "\n" }} - {%- endfor %} -{% endif %} - ?> -
- Form->button(__('Submit')) ?> - Form->end() ?> -
diff --git a/vendor/cakephp/bake/src/Template/Bake/Form/form.twig b/vendor/cakephp/bake/src/Template/Bake/Form/form.twig deleted file mode 100644 index 32bd7d5..0000000 --- a/vendor/cakephp/bake/src/Template/Bake/Form/form.twig +++ /dev/null @@ -1,60 +0,0 @@ -{# -/** -* CakePHP(tm) : Rapid Development Framework (http://cakephp.org) -* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) -* -* Licensed under The MIT License -* For full copyright and license information, please see the LICENSE.txt -* Redistributions of files must retain the above copyright notice. -* -* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) -* @link http://cakephp.org CakePHP(tm) Project -* @since 2.0.0 -* @license http://www.opensource.org/licenses/mit-license.php MIT License -*/ -#} -setTable('{{ table }}'); -{% endif %} - -{%- if displayField %} - $this->setDisplayField('{{ displayField }}'); -{% endif %} - -{%- if primaryKey %} - {%- if primaryKey is iterable and primaryKey|length > 1 %} - $this->setPrimaryKey([{{ Bake.stringifyList(primaryKey, {'indent': false})|raw }}]); - {{- "\n" }} - {%- else %} - $this->setPrimaryKey('{{ primaryKey|as_array|first }}'); - {{- "\n" }} - {%- endif %} -{% endif %} - -{%- if behaviors %} - -{% endif %} - -{%- for behavior, behaviorData in behaviors %} - $this->addBehavior('{{ behavior }}'{{ (behaviorData ? (", [" ~ Bake.stringifyList(behaviorData, {'indent': 3, 'quotes': false})|raw ~ ']') : '')|raw }}); -{% endfor %} - -{%- if associations.belongsTo or associations.hasMany or associations.belongsToMany %} - -{% endif %} - -{%- for type, assocs in associations %} - {%- for assoc in assocs %} - {%- set assocData = [] %} - {%- for key, val in assoc if key is not same as('alias') %} - {%- set assocData = assocData|merge({(key): val}) %} - {%- endfor %} - $this->{{ type }}('{{ assoc.alias }}', [{{ Bake.stringifyList(assocData, {'indent': 3})|raw }}]); - {{- "\n" }} - {%- endfor %} -{% endfor %} - } -{{- "\n" }} - -{%- if validation %} - - /** - * Default validation rules. - * - * @param \Cake\Validation\Validator $validator Validator instance. - * @return \Cake\Validation\Validator - */ - public function validationDefault(Validator $validator) - { -{% for field, rules in validation %} -{% set validationMethods = Bake.getValidationMethods(field, rules) %} -{% if validationMethods %} - $validator -{% for validationMethod in validationMethods %} -{% if loop.last %} -{% set validationMethod = validationMethod ~ ';' %} -{% endif %} - {{ validationMethod|raw }} -{% endfor %} - -{% endif %} -{% endfor %} - return $validator; - } -{% endif %} - -{%- if rulesChecker %} - - /** - * Returns a rules checker object that will be used for validating - * application integrity. - * - * @param \Cake\ORM\RulesChecker $rules The rules object to be modified. - * @return \Cake\ORM\RulesChecker - */ - public function buildRules(RulesChecker $rules) - { -{% for field, rule in rulesChecker %} - $rules->add($rules->{{ rule.name }}(['{{ field }}']{{ (rule.extra is defined and rule.extra ? (", '#{rule.extra}'") : '')|raw }})); -{% endfor %} - - return $rules; - } -{% endif %} - -{%- if connection is not same as('default') %} - - /** - * Returns the database connection name to use by default. - * - * @return string - */ - public static function defaultConnectionName() - { - return '{{ connection }}'; - } -{% endif %} -} diff --git a/vendor/cakephp/bake/src/Template/Bake/Plugin/.gitignore.twig b/vendor/cakephp/bake/src/Template/Bake/Plugin/.gitignore.twig deleted file mode 100644 index 2bcbfb6..0000000 --- a/vendor/cakephp/bake/src/Template/Bake/Plugin/.gitignore.twig +++ /dev/null @@ -1,4 +0,0 @@ -/composer.lock -/phpunit.xml -/vendor -config/Migrations/schema-dump-default.lock diff --git a/vendor/cakephp/bake/src/Template/Bake/Plugin/README.md.twig b/vendor/cakephp/bake/src/Template/Bake/Plugin/README.md.twig deleted file mode 100644 index 0763927..0000000 --- a/vendor/cakephp/bake/src/Template/Bake/Plugin/README.md.twig +++ /dev/null @@ -1,26 +0,0 @@ -{# -/** - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * - * Licensed under The MIT License - * For full copyright and license information, please see the LICENSE.txt - * Redistributions of files must retain the above copyright notice. - * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project - * @since 2.0.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License - */ -#} -# {{ plugin }} plugin for CakePHP - -## Installation - -You can install this plugin into your CakePHP application using [composer](https://getcomposer.org). - -The recommended way to install composer packages is: - -``` -composer require {{ package }} -``` diff --git a/vendor/cakephp/bake/src/Template/Bake/Plugin/composer.json.twig b/vendor/cakephp/bake/src/Template/Bake/Plugin/composer.json.twig deleted file mode 100644 index da1adf2..0000000 --- a/vendor/cakephp/bake/src/Template/Bake/Plugin/composer.json.twig +++ /dev/null @@ -1,39 +0,0 @@ -{# -/** - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * - * Licensed under The MIT License - * For full copyright and license information, please see the LICENSE.txt - * Redistributions of files must retain the above copyright notice. - * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project - * @since 2.0.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License - */ -#} -{% set namespace = namespace|replace({'\\': '\\\\'}) %} -{ - "name": "{{ package }}", - "description": "{{ plugin }} plugin for CakePHP", - "type": "cakephp-plugin", - "license": "MIT", - "require": { - "cakephp/cakephp": "^3.5" - }, - "require-dev": { - "phpunit/phpunit": "^5.7.14|^6.0" - }, - "autoload": { - "psr-4": { - "{{ namespace }}\\": "src/" - } - }, - "autoload-dev": { - "psr-4": { - "{{ namespace }}\\Test\\": "tests/", - "Cake\\Test\\": "vendor/cakephp/cakephp/tests/" - } - } -} diff --git a/vendor/cakephp/bake/src/Template/Bake/Plugin/config/routes.php.twig b/vendor/cakephp/bake/src/Template/Bake/Plugin/config/routes.php.twig deleted file mode 100644 index 30c8020..0000000 --- a/vendor/cakephp/bake/src/Template/Bake/Plugin/config/routes.php.twig +++ /dev/null @@ -1,27 +0,0 @@ -{# -/** - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * - * Licensed under The MIT License - * For full copyright and license information, please see the LICENSE.txt - * Redistributions of files must retain the above copyright notice. - * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project - * @since 2.0.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License - */ -#} - '/{{ routePath }}'], - function (RouteBuilder $routes) { - $routes->fallbacks(DashedRoute::class); - } -); diff --git a/vendor/cakephp/bake/src/Template/Bake/Plugin/phpunit.xml.dist.twig b/vendor/cakephp/bake/src/Template/Bake/Plugin/phpunit.xml.dist.twig deleted file mode 100644 index 2653e66..0000000 --- a/vendor/cakephp/bake/src/Template/Bake/Plugin/phpunit.xml.dist.twig +++ /dev/null @@ -1,50 +0,0 @@ -{# -/** - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * - * Licensed under The MIT License - * For full copyright and license information, please see the LICENSE.txt - * Redistributions of files must retain the above copyright notice. - * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project - * @since 2.0.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License - */ -#} - - - - - - - - - - - tests/TestCase/ - - - - - - - - - - - - - - - src/ - - - - diff --git a/vendor/cakephp/bake/src/Template/Bake/Plugin/src/Controller/AppController.php.twig b/vendor/cakephp/bake/src/Template/Bake/Plugin/src/Controller/AppController.php.twig deleted file mode 100644 index 2f82948..0000000 --- a/vendor/cakephp/bake/src/Template/Bake/Plugin/src/Controller/AppController.php.twig +++ /dev/null @@ -1,24 +0,0 @@ -{# -/** - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * - * Licensed under The MIT License - * For full copyright and license information, please see the LICENSE.txt - * Redistributions of files must retain the above copyright notice. - * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project - * @since 2.0.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License - */ -#} -out($this->OptionParser->help()); - } -} diff --git a/vendor/cakephp/bake/src/Template/Bake/Shell/task.twig b/vendor/cakephp/bake/src/Template/Bake/Shell/task.twig deleted file mode 100644 index 5c7b7fc..0000000 --- a/vendor/cakephp/bake/src/Template/Bake/Shell/task.twig +++ /dev/null @@ -1,46 +0,0 @@ -{# -/** - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * - * Licensed under The MIT License - * For full copyright and license information, please see the LICENSE.txt - * Redistributions of files must retain the above copyright notice. - * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project - * @license http://www.opensource.org/licenses/mit-license.php MIT License - */ -#} - -{% element 'form' %} diff --git a/vendor/cakephp/bake/src/Template/Bake/Template/edit.twig b/vendor/cakephp/bake/src/Template/Bake/Template/edit.twig deleted file mode 100644 index cde0d35..0000000 --- a/vendor/cakephp/bake/src/Template/Bake/Template/edit.twig +++ /dev/null @@ -1,22 +0,0 @@ -{# -/** - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * - * Licensed under The MIT License - * For full copyright and license information, please see the LICENSE.txt - * Redistributions of files must retain the above copyright notice. - * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project - * @since 2.0.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License - */ -#} - -{% element 'form' %} diff --git a/vendor/cakephp/bake/src/Template/Bake/Template/index.twig b/vendor/cakephp/bake/src/Template/Bake/Template/index.twig deleted file mode 100644 index 79050ef..0000000 --- a/vendor/cakephp/bake/src/Template/Bake/Template/index.twig +++ /dev/null @@ -1,90 +0,0 @@ -{# -/** - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * - * Licensed under The MIT License - * For full copyright and license information, please see the LICENSE.txt - * Redistributions of files must retain the above copyright notice. - * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project - * @since 2.0.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License - */ -#} - -{% set fields = Bake.filterFields(fields, schema, modelObject, indexColumns, ['binary', 'text']) %} - -
-

- - - -{% for field in fields %} - -{% endfor %} - - - - - - -{% for field in fields %} -{% set isKey = false %} -{% if associations.BelongsTo %} -{% for alias, details in associations.BelongsTo if field == details.foreignKey %} -{% set isKey = true %} - -{% endfor %} -{% endif %} -{% if isKey is not same as(true) %} -{% set columnData = Bake.columnData(field, schema) %} -{% if columnData.type not in ['integer', 'float', 'decimal', 'biginteger', 'smallinteger', 'tinyinteger'] %} - -{% else %} - -{% endif %} -{% endif %} -{% endfor %} -{% set pk = '$' ~ singularVar ~ '->' ~ primaryKey[0] %} - - - - -
Paginator->sort('{{ field }}') ?>
has('{{ details.property }}') ? $this->Html->link(${{ singularVar }}->{{ details.property }}->{{ details.displayField }}, ['controller' => '{{ details.controller }}', 'action' => 'view', ${{ singularVar }}->{{ details.property }}->{{ details.primaryKey[0] }}]) : '' ?>{{ field }}) ?>Number->format(${{ singularVar }}->{{ field }}) ?> - Html->link(__('View'), ['action' => 'view', {{ pk|raw }}]) ?> - Html->link(__('Edit'), ['action' => 'edit', {{ pk|raw }}]) ?> - Form->postLink(__('Delete'), ['action' => 'delete', {{ pk|raw }}], ['confirm' => __('Are you sure you want to delete # {0}?', {{ pk|raw }})]) ?> -
-
-
    - Paginator->first('<< ' . __('first')) ?> - Paginator->prev('< ' . __('previous')) ?> - Paginator->numbers() ?> - Paginator->next(__('next') . ' >') ?> - Paginator->last(__('last') . ' >>') ?> -
-

Paginator->counter(['format' => __('Page {{ '{{' }}page{{ '}}' }} of {{ '{{' }}pages{{ '}}' }}, showing {{ '{{' }}current{{ '}}' }} record(s) out of {{ '{{' }}count{{ '}}' }} total')]) ?>

-
-
diff --git a/vendor/cakephp/bake/src/Template/Bake/Template/login.twig b/vendor/cakephp/bake/src/Template/Bake/Template/login.twig deleted file mode 100644 index 7b03c8c..0000000 --- a/vendor/cakephp/bake/src/Template/Bake/Template/login.twig +++ /dev/null @@ -1,31 +0,0 @@ -{# -/** - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * - * Licensed under The MIT License - * For full copyright and license information, please see the LICENSE.txt - * Redistributions of files must retain the above copyright notice. - * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project - * @since 2.0.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License - */ -#} - -
-Flash->render('auth') ?> - Form->create() ?> -
- - Form->control('username') ?> - Form->control('password') ?> -
- Form->button(__('Login')); ?> - Form->end() ?> -
diff --git a/vendor/cakephp/bake/src/Template/Bake/Template/view.twig b/vendor/cakephp/bake/src/Template/Bake/Template/view.twig deleted file mode 100644 index 200a2f8..0000000 --- a/vendor/cakephp/bake/src/Template/Bake/Template/view.twig +++ /dev/null @@ -1,137 +0,0 @@ -{# -/** - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * - * Licensed under The MIT License - * For full copyright and license information, please see the LICENSE.txt - * Redistributions of files must retain the above copyright notice. - * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project - * @since 2.0.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License - */ -#} - -{% set associations = {'BelongsTo': [], 'HasOne': [], 'HasMany': [], 'BelongsToMany': []}|merge(associations) %} -{% set fieldsData = Bake.getViewFieldsData(fields, schema, associations) %} -{% set associationFields = fieldsData.associationFields %} -{% set groupedFields = fieldsData.groupedFields %} -{% set pK = '$' ~ singularVar ~ '->' ~ primaryKey[0] %} - -
-

{{ displayField }}) ?>

- -{% if groupedFields['string'] %} -{% for field in groupedFields['string'] %} -{% if associationFields[field] %} -{% set details = associationFields[field] %} - - - - -{% else %} - - - - -{% endif %} -{% endfor %} -{% endif %} -{% if associations.HasOne %} -{% for alias, details in associations.HasOne %} - - - - -{% endfor %} -{% endif %} -{% if groupedFields.number %} -{% for field in groupedFields.number %} - - - - -{% endfor %} -{% endif %} -{% if groupedFields.date %} -{% for field in groupedFields.date %} - - - - -{% endfor %} -{% endif %} -{% if groupedFields.boolean %} -{% for field in groupedFields.boolean %} - - - - -{% endfor %} -{% endif %} -
has('{{ details.property }}') ? $this->Html->link(${{ singularVar }}->{{ details.property }}->{{ details.displayField }}, ['controller' => '{{ details.controller }}', 'action' => 'view', ${{ singularVar }}->{{ details.property }}->{{ details.primaryKey[0] }}]) : '' ?>
{{ field }}) ?>
has('{{ details.property }}') ? $this->Html->link(${{ singularVar }}->{{ details.property }}->{{ details.displayField }}, ['controller' => '{{ details.controller }}', 'action' => 'view', ${{ singularVar }}->{{ details.property }}->{{ details.primaryKey[0] }}]) : '' ?>
Number->format(${{ singularVar }}->{{ field }}) ?>
{{ field }}) ?>
{{ field }} ? __('Yes') : __('No'); ?>
-{% if groupedFields.text %} -{% for field in groupedFields.text %} -
-

- Text->autoParagraph(h(${{ singularVar }}->{{ field }})); ?> -
-{% endfor %} -{% endif %} -{% set relations = associations.BelongsToMany|merge(associations.HasMany) %} -{% for alias, details in relations %} -{% set otherSingularVar = alias|variable %} -{% set otherPluralHumanName = details.controller|underscore|humanize %} - -{% endfor %} -
diff --git a/vendor/cakephp/bake/src/Template/Bake/View/cell.twig b/vendor/cakephp/bake/src/Template/Bake/View/cell.twig deleted file mode 100644 index 403ffe3..0000000 --- a/vendor/cakephp/bake/src/Template/Bake/View/cell.twig +++ /dev/null @@ -1,51 +0,0 @@ -{# -/** - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * - * Licensed under The MIT License - * For full copyright and license information, please see the LICENSE.txt - * Redistributions of files must retain the above copyright notice. - * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project - * @since 2.0.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License - */ -#} -records = {{ records|raw }}; - parent::init(); - } -{% endif %} -} diff --git a/vendor/cakephp/bake/src/Template/Bake/tests/test_case.twig b/vendor/cakephp/bake/src/Template/Bake/tests/test_case.twig deleted file mode 100644 index 3f50cd4..0000000 --- a/vendor/cakephp/bake/src/Template/Bake/tests/test_case.twig +++ /dev/null @@ -1,152 +0,0 @@ -{# -/** - * Test Case bake template - * - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * - * Licensed under The MIT License - * For full copyright and license information, please see the LICENSE.txt - * Redistributions of files must retain the above copyright notice. - * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project - * @since 2.0.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License - */ -#} -{% set isController = type|lower == 'controller' %} -{% set isShell = type|lower == 'shell' %} -{% set isCommand = type|lower == 'command' %} -{% if isController %} - {%- set traitName = 'IntegrationTestTrait' %} -{% elseif isShell or isCommand %} - {%- set traitName = 'ConsoleIntegrationTestTrait' %} -{% endif %} -{%- set uses = uses|merge(["Cake\\TestSuite\\TestCase"]) %} -{% if traitName %} - {%- set uses = uses|merge(["Cake\\TestSuite\\#{traitName}"]) %} -{% endif %} - -{%- set uses = uses|sort %} - 1 %} - -{% endif %} - /** - * {{ propertyInfo.description }} - * - * @var {{ propertyInfo.type }} - */ - public ${{ propertyInfo.name }}{% if propertyInfo.value is defined and propertyInfo.value %} = {{ propertyInfo.value }}{% endif %}; -{% if loop.last and (fixtures or construction or methods) %} - -{% endif %} -{% endfor %} -{% endif %} - -{%- if fixtures %} - /** - * Fixtures - * - * @var array - */ - public $fixtures = [{{ Bake.stringifyList(fixtures|values)|raw }}]; -{% if construction or methods %} - -{% endif %} -{% endif %} - -{%- if construction %} - /** - * setUp method - * - * @return void - */ - public function setUp() - { - parent::setUp(); -{% if preConstruct %} - {{ preConstruct|raw }} -{% endif %} -{% if isCommand %} - {{ construction|raw }} -{% else %} - $this->{{ (subject ~ ' = ' ~ construction)|raw }} -{% endif %} -{% if postConstruct %} - {{ postConstruct|raw }} -{% endif %} - } -{% if not isCommand %} - - /** - * tearDown method - * - * @return void - */ - public function tearDown() - { - unset($this->{{ subject }}); - - parent::tearDown(); - } -{% if methods %} - -{% endif %} -{% endif %} -{% endif %} - -{%- for method in methods %} -{% if loop.index > 1 %} - -{% endif %} - /** - * Test {{ method }} method - * - * @return void - */ - public function test{{ method|camelize }}() - { - $this->markTestIncomplete('Not implemented yet.'); - } -{% endfor %} - -{%- if not methods %} -{%- if traitName or properties or fixtures or construction or methods %} - -{% endif %} - /** - * Test initial setup - * - * @return void - */ - public function testInitialization() - { - $this->markTestIncomplete('Not implemented yet.'); - } -{% endif %} -} diff --git a/vendor/cakephp/bake/src/Utility/CommonOptionsTrait.php b/vendor/cakephp/bake/src/Utility/CommonOptionsTrait.php deleted file mode 100644 index ab0c56e..0000000 --- a/vendor/cakephp/bake/src/Utility/CommonOptionsTrait.php +++ /dev/null @@ -1,58 +0,0 @@ -addOption('plugin', [ - 'short' => 'p', - 'help' => 'Plugin to bake into.', - ])->addOption('force', [ - 'short' => 'f', - 'boolean' => true, - 'help' => 'Force overwriting existing files without prompting.', - ])->addOption('connection', [ - 'short' => 'c', - 'default' => 'default', - 'help' => 'The datasource connection to get data from.', - ])->addOption('theme', [ - 'short' => 't', - 'help' => 'The theme to use when baking code.', - 'default' => Configure::read('Bake.theme'), - 'choices' => $bakeThemes, - ]); - - return $parser; - } -} diff --git a/vendor/cakephp/bake/src/Utility/Model/AssociationFilter.php b/vendor/cakephp/bake/src/Utility/Model/AssociationFilter.php deleted file mode 100644 index 573ecac..0000000 --- a/vendor/cakephp/bake/src/Utility/Model/AssociationFilter.php +++ /dev/null @@ -1,112 +0,0 @@ -belongsToManyJunctionAliases($table); - - return array_values(array_diff($aliases, $belongsToManyJunctionsAliases)); - } - - /** - * Get the array of junction aliases for all the BelongsToMany associations - * - * @param Table $table Table - * @return array junction aliases of all the BelongsToMany associations - */ - public function belongsToManyJunctionAliases(Table $table) - { - $extractor = function ($val) { - return $val->junction()->getAlias(); - }; - - return array_map($extractor, $table->associations()->getByType('BelongsToMany')); - } - - /** - * Returns filtered associations for controllers models. HasMany association are filtered if - * already existing in BelongsToMany - * - * @param Table $model The model to build associations for. - * @return array associations - */ - public function filterAssociations(Table $model) - { - $belongsToManyJunctionsAliases = $this->belongsToManyJunctionAliases($model); - $keys = ['BelongsTo', 'HasOne', 'HasMany', 'BelongsToMany']; - $associations = []; - - foreach ($keys as $type) { - foreach ($model->associations()->getByType($type) as $assoc) { - $target = $assoc->getTarget(); - $assocName = $assoc->getName(); - $alias = $target->getAlias(); - //filter existing HasMany - if ($type === 'HasMany' && in_array($alias, $belongsToManyJunctionsAliases)) { - continue; - } - $targetClass = get_class($target); - list(, $className) = namespaceSplit($targetClass); - - $navLink = true; - $modelClass = get_class($model); - if ($modelClass !== Table::class && $targetClass === $modelClass) { - $navLink = false; - } - - $className = preg_replace('/(.*)Table$/', '\1', $className); - if ($className === '') { - $className = $alias; - } - - try { - $associations[$type][$assocName] = [ - 'property' => $assoc->getProperty(), - 'variable' => Inflector::variable($assocName), - 'primaryKey' => (array)$target->getPrimaryKey(), - 'displayField' => $target->getDisplayField(), - 'foreignKey' => $assoc->getForeignKey(), - 'alias' => $alias, - 'controller' => $className, - 'fields' => $target->getSchema()->columns(), - 'navLink' => $navLink, - ]; - } catch (Exception $e) { - // Do nothing it could be a bogus association name. - } - } - } - - return $associations; - } -} diff --git a/vendor/cakephp/bake/src/View/BakeView.php b/vendor/cakephp/bake/src/View/BakeView.php deleted file mode 100644 index aebf559..0000000 --- a/vendor/cakephp/bake/src/View/BakeView.php +++ /dev/null @@ -1,263 +0,0 @@ - tags - * - Add an extra newline to <%=, to counteract php automatically removing a newline - * - Replace remaining <=% with php short echo tags - * - Replace <% with php open tags - * - Replace %> with php close tags - * - * Replacements that start with `/` will be treated as regex replacements. - * All other values will be treated used with str_replace() - * - * @var array - */ - protected $_defaultConfig = [ - 'phpTagReplacements' => [ - ' "' => "CakePHPBakeCloseTag>", - ], - 'replacements' => [ - '/\n[ \t]+<%-( |$)/' => "\n<% ", - '/-%>/' => "?>", - '/<%=(.*)\%>\n(.)/' => "<%=$1%>\n\n$2", - '<%=' => ' '' => '?>', - ], - ]; - - /** - * Path where bake's intermediary files are written. - * Defaults to `TMP . 'bake' . DS`. - * - * @var string - */ - protected $_tmpLocation; - - /** - * Templates extensions to search for. - * - * @var array - */ - protected $extensions = [ - '.twig', - '.ctp', - ]; - - /** - * View file being evaluated. - * - * @var string - */ - protected $__viewFile; - - /** - * Initialize view - * - * @return void - */ - public function initialize() - { - $bakeTemplates = dirname(dirname(__FILE__)) . DS . 'Template' . DS; - $paths = (array)Configure::read('App.paths.templates'); - - if (!in_array($bakeTemplates, $paths)) { - $paths[] = $bakeTemplates; - Configure::write('App.paths.templates', $paths); - } - - $this->_tmpLocation = TMP . 'bake' . DS; - if (!file_exists($this->_tmpLocation)) { - mkdir($this->_tmpLocation); - } - - parent::initialize(); - } - - /** - * Renders view for given view file and layout. - * - * Render triggers helper callbacks, which are fired before and after the view are rendered, - * as well as before and after the layout. The helper callbacks are called: - * - * - `beforeRender` - * - `afterRender` - * - * View names can point to plugin views/layouts. Using the `Plugin.view` syntax - * a plugin view/layout can be used instead of the app ones. If the chosen plugin is not found - * the view will be located along the regular view path cascade. - * - * View can also be a template string, rather than the name of a view file - * - * @param string|null $view Name of view file to use, or a template string to render - * @param string|null $layout Layout to use. Not used, for consistency with other views only - * @return string|null Rendered content. - * @throws \Cake\Core\Exception\Exception If there is an error in the view. - */ - public function render($view = null, $layout = null) - { - $viewFileName = $this->_getViewFileName($view); - $templateEventName = str_replace( - ['.ctp', '.twig', DS], - ['', '', '.'], - explode('Template' . DS . 'Bake' . DS, $viewFileName)[1] - ); - - $this->_currentType = static::TYPE_TEMPLATE; - $this->dispatchEvent('View.beforeRender', [$viewFileName]); - $this->dispatchEvent('View.beforeRender' . $templateEventName, [$viewFileName]); - $this->Blocks->set('content', $this->_render($viewFileName)); - $this->dispatchEvent('View.afterRender', [$viewFileName]); - $this->dispatchEvent('View.afterRender' . $templateEventName, [$viewFileName]); - - if ($layout === null) { - $layout = $this->layout; - } - if ($layout && $this->autoLayout) { - $this->Blocks->set('content', $this->renderLayout('', $layout)); - } - - return $this->Blocks->get('content'); - } - - /** - * Wrapper for creating and dispatching events. - * - * Use the Bake prefix for bake related view events - * - * @param string $name Name of the event. - * @param array|null $data Any value you wish to be transported with this event to - * it can be read by listeners. - * - * @param object|null $subject The object that this event applies to - * ($this by default). - * - * @return \Cake\Event\Event - */ - public function dispatchEvent($name, $data = null, $subject = null) - { - $name = preg_replace('/^View\./', 'Bake.', $name); - - return parent::dispatchEvent($name, $data, $subject); - } - - /** - * Sandbox method to evaluate a template / view script in. - * - * @param string $viewFile Filename of the view - * @param array $dataForView Data to include in rendered view. - * If empty the current View::$viewVars will be used. - * @return string Rendered output - */ - protected function _evaluate($viewFile, $dataForView) - { - if (substr($viewFile, -4) === 'twig') { - return parent::_evaluate($viewFile, $dataForView); - } - - $viewString = $this->_getViewFileContents($viewFile); - - $replacements = $this->getConfig('phpTagReplacements') + $this->getConfig('replacements'); - - foreach ($replacements as $find => $replace) { - if ($this->_isRegex($find)) { - $viewString = preg_replace($find, $replace, $viewString); - } else { - $viewString = str_replace($find, $replace, $viewString); - } - } - - $this->__viewFile = $this->_tmpLocation . Text::slug(preg_replace('@.*Template[/\\\\]@', '', $viewFile)) . '.php'; - file_put_contents($this->__viewFile, $viewString); - - unset($viewFile, $viewString, $replacements, $find, $replace); - extract($dataForView); - ob_start(); - - include $this->__viewFile; - - $content = ob_get_clean(); - - $unPhp = $this->getConfig('phpTagReplacements'); - - return str_replace(array_values($unPhp), array_keys($unPhp), $content); - } - - /** - * Get the contents of the template file - * - * @param string $filename A template filename - * @return string Bake template to evaluate - */ - protected function _getViewFileContents($filename) - { - return file_get_contents($filename); - } - - /** - * Return all possible paths to find view files in order - * - * @param string $plugin Optional plugin name to scan for view files. - * @param bool $cached Set to false to force a refresh of view paths. Default true. - * @return array paths - */ - protected function _paths($plugin = null, $cached = true) - { - $paths = parent::_paths($plugin, false); - foreach ($paths as &$path) { - $path .= 'Bake' . DS; - } - - return $paths; - } - - /** - * Check if a replacement pattern is a regex - * - * Use preg_match to detect invalid regexes - * - * @param string $maybeRegex a fixed string or a regex - * @return bool - */ - protected function _isRegex($maybeRegex) - { - return substr($maybeRegex, 0, 1) === '/'; - } -} diff --git a/vendor/cakephp/bake/src/View/Helper/BakeHelper.php b/vendor/cakephp/bake/src/View/Helper/BakeHelper.php deleted file mode 100644 index 74e028b..0000000 --- a/vendor/cakephp/bake/src/View/Helper/BakeHelper.php +++ /dev/null @@ -1,409 +0,0 @@ - $name, - 'value' => $value, - ]; - - return $this->_View->element('array_property', $options); - } - - /** - * Returns an array converted into a formatted multiline string - * - * @param array $list array of items to be stringified - * @param array $options options to use - * @return string - */ - public function stringifyList(array $list, array $options = []) - { - $defaults = [ - 'indent' => 2, - 'tab' => ' ', - 'trailingComma' => (!isset($options['indent']) || $options['indent']) ? true : false, - 'quotes' => true, - ]; - $options += $defaults; - - if (!$list) { - return ''; - } - - foreach ($list as $k => &$v) { - if ($options['quotes']) { - $v = "'$v'"; - } - if (!is_numeric($k)) { - $nestedOptions = $options; - if ($nestedOptions['indent']) { - $nestedOptions['indent'] += 1; - } - if (is_array($v)) { - $v = sprintf( - "'%s' => [%s]", - $k, - $this->stringifyList($v, $nestedOptions) - ); - } else { - $v = "'$k' => $v"; - } - } elseif (is_array($v)) { - $nestedOptions = $options; - if ($nestedOptions['indent']) { - $nestedOptions['indent'] += 1; - } - $v = sprintf( - "[%s]", - $this->stringifyList($v, $nestedOptions) - ); - } - } - - $start = $end = ''; - $join = ', '; - if ($options['indent']) { - $join = ','; - $start = "\n" . str_repeat($options['tab'], $options['indent']); - $join .= $start; - $end = "\n" . str_repeat($options['tab'], $options['indent'] - 1); - } - - if ($options['trailingComma']) { - $end = "," . $end; - } - - return $start . implode($join, $list) . $end; - } - - /** - * Extract the aliases for associations, filters hasMany associations already extracted as - * belongsToMany - * - * @param \Cake\ORM\Table $table object to find associations on - * @param string $assoc association to extract - * @return array - */ - public function aliasExtractor($table, $assoc) - { - $extractor = function ($val) { - return $val->getTarget()->getAlias(); - }; - $aliases = array_map($extractor, $table->associations()->getByType($assoc)); - if ($assoc === 'HasMany') { - return $this->_filterHasManyAssociationsAliases($table, $aliases); - } - - return $aliases; - } - - /** - * Returns details about the given class. - * - * The returned array holds the following keys: - * - * - `fqn` (the fully qualified name) - * - `namespace` (the full namespace without leading separator) - * - `class` (the class name) - * - `plugin` (either the name of the plugin, or `null`) - * - `name` (the name of the component without suffix) - * - `fullName` (the full name of the class, including possible vendor and plugin name) - * - * @param string $class Class name - * @param string $type Class type/sub-namespace - * @param string $suffix Class name suffix - * @return array Class info - */ - public function classInfo($class, $type, $suffix) - { - list($plugin, $name) = \pluginSplit($class); - - $base = Configure::read('App.namespace'); - if ($plugin !== null) { - $base = $plugin; - } - $base = str_replace('/', '\\', trim($base, '\\')); - $sub = '\\' . str_replace('/', '\\', trim($type, '\\')); - $qn = $sub . '\\' . $name . $suffix; - - if (class_exists('\Cake' . $qn)) { - $base = 'Cake'; - } - - return [ - 'fqn' => '\\' . $base . $qn, - 'namespace' => $base . $sub, - 'plugin' => $plugin, - 'class' => $name . $suffix, - 'name' => $name, - 'fullName' => $class, - ]; - } - - /** - * Return list of fields to generate controls for. - * - * @param array $fields Fields list. - * @param \Cake\Datasource\SchemaInterface $schema Schema instance. - * @param \Cake\ORM\Table|null $modelObject Model object. - * @param array $takeFields Take fields. - * @param array $filterTypes Filter field types. - * @return array - */ - public function filterFields($fields, $schema, $modelObject = null, $takeFields = [], $filterTypes = ['binary']) - { - $fields = collection($fields) - ->filter(function ($field) use ($schema, $filterTypes) { - return !in_array($schema->getColumnType($field), $filterTypes); - }); - - if (isset($modelObject) && $modelObject->hasBehavior('Tree')) { - $fields = $fields->reject(function ($field) { - return $field === 'lft' || $field === 'rght'; - }); - } - - if (!empty($takeFields)) { - $fields = $fields->take($takeFields); - } - - return $fields->toArray(); - } - - /** - * Get fields data for view template. - * - * @param array $fields Fields list. - * @param \Cake\Datasource\SchemaInterface $schema Schema instance. - * @param array $associations Associations data. - * @return array - */ - public function getViewFieldsData($fields, $schema, $associations) - { - $immediateAssociations = $associations['BelongsTo']; - $associationFields = collection($fields) - ->map(function ($field) use ($immediateAssociations) { - foreach ($immediateAssociations as $alias => $details) { - if ($field === $details['foreignKey']) { - return [$field => $details]; - } - } - }) - ->filter() - ->reduce(function ($fields, $value) { - return $fields + $value; - }, []); - - $groupedFields = collection($fields) - ->filter(function ($field) use ($schema) { - return $schema->getColumnType($field) !== 'binary'; - }) - ->groupBy(function ($field) use ($schema, $associationFields) { - $type = $schema->getColumnType($field); - if (isset($associationFields[$field])) { - return 'string'; - } - if ( - in_array($type, [ - 'decimal', - 'biginteger', - 'integer', - 'float', - 'smallinteger', - 'tinyinteger', - ]) - ) { - return 'number'; - } - if (in_array($type, ['date', 'time', 'datetime', 'timestamp'])) { - return 'date'; - } - - return in_array($type, ['text', 'boolean']) ? $type : 'string'; - }) - ->toArray(); - - $groupedFields += [ - 'number' => [], - 'string' => [], - 'boolean' => [], - 'date' => [], - 'text' => [], - ]; - - return compact('associationFields', 'groupedFields'); - } - - /** - * Get column data from schema. - * - * @param string $field Field name. - * @param \Cake\Database\Schema\TableSchema $schema Schema. - * @return array - */ - public function columnData($field, $schema) - { - return $schema->getColumn($field); - } - - /** - * Get alias of associated table. - * - * @param \Cake\ORM\Table $modelObj Model object. - * @param string $assoc Association name. - * @return string - */ - public function getAssociatedTableAlias($modelObj, $assoc) - { - $association = $modelObj->getAssociation($assoc); - - return $association->getTarget()->getAlias(); - } - - /** - * Get validation methods data. - * - * @param string $field Field name. - * @param array $rules Validation rules list. - * @return array - */ - public function getValidationMethods($field, $rules) - { - $validationMethods = []; - - foreach ($rules as $ruleName => $rule) { - if ($rule['rule'] && !isset($rule['provider']) && !isset($rule['args'])) { - $validationMethods[] = sprintf("->%s('%s')", $rule['rule'], $field); - } elseif ($rule['rule'] && !isset($rule['provider'])) { - $formatTemplate = "->%s('%s')"; - if (!empty($rule['args'])) { - $formatTemplate = "->%s('%s', %s)"; - } - $validationMethods[] = sprintf( - $formatTemplate, - $rule['rule'], - $field, - $this->stringifyList( - $rule['args'], - ['indent' => false, 'quotes' => false] - ) - ); - } elseif ($rule['rule'] && isset($rule['provider'])) { - $validationMethods[] = sprintf( - "->add('%s', '%s', ['rule' => '%s', 'provider' => '%s'])", - $field, - $ruleName, - $rule['rule'], - $rule['provider'] - ); - } - } - - return $validationMethods; - } - - /** - * Get field accessibility data. - * - * @param mixed $fields Fields list. - * @param mixed $primaryKey Primary key. - * @return array - */ - public function getFieldAccessibility($fields = null, $primaryKey = null) - { - $accessible = []; - - if (!isset($fields) || $fields !== false) { - if (!empty($fields)) { - foreach ($fields as $field) { - $accessible[$field] = 'true'; - } - } elseif (!empty($primaryKey)) { - $accessible['*'] = 'true'; - foreach ($primaryKey as $field) { - $accessible[$field] = 'false'; - } - } - } - - return $accessible; - } - - /** - * Wrap string arguments with quotes - * - * @param array $args array of arguments - * @return array - */ - public function escapeArguments($args) - { - return array_map(function ($v) { - if (is_string($v)) { - $v = strtr($v, ["'" => "\'"]); - $v = "'$v'"; - } - - return $v; - }, $args); - } - - /** - * To be mocked elsewhere... - * - * @param \Cake\ORM\Table $table Table - * @param array $aliases array of aliases - * @return array - */ - protected function _filterHasManyAssociationsAliases($table, $aliases) - { - if (is_null($this->_associationFilter)) { - $this->_associationFilter = new AssociationFilter(); - } - - return $this->_associationFilter->filterHasManyAssociationsAliases($table, $aliases); - } -} diff --git a/vendor/cakephp/bake/src/View/Helper/DocBlockHelper.php b/vendor/cakephp/bake/src/View/Helper/DocBlockHelper.php deleted file mode 100644 index 2de3a16..0000000 --- a/vendor/cakephp/bake/src/View/Helper/DocBlockHelper.php +++ /dev/null @@ -1,301 +0,0 @@ - 1 && $annotation[0] === '@' && strpos($annotation, ' ') > 0) { - $type = substr($annotation, 0, strpos($annotation, ' ')); - if ( - $this->_annotationSpacing && - $previous !== false && - $previous !== $type - ) { - $lines[] = ''; - } - $previous = $type; - } - $lines[] = $annotation; - } - - $lines = array_merge(["/**"], (new Collection($lines))->map(function ($line) { - return rtrim(" * {$line}"); - })->toArray(), [" */"]); - - return implode("\n", $lines); - } - - /** - * Converts an entity class type to its DocBlock hint type counterpart. - * - * @param string $type The entity class type (a fully qualified class name). - * @param \Cake\ORM\Association $association The association related to the entity class. - * @return string The DocBlock type - */ - public function associatedEntityTypeToHintType($type, Association $association) - { - $annotationType = $association->type(); - if ( - $annotationType === Association::MANY_TO_MANY || - $annotationType === Association::ONE_TO_MANY - ) { - return $type . '[]'; - } - - return $type; - } - - /** - * Builds a map of entity columns as DocBlock types for use - * in generating `@property` hints. - * - * This method expects a property schema as generated by - * `\Bake\Shell\Task\ModelTask::getEntityPropertySchema()`. - * - * The generated map has the format of - * - * ``` - * [ - * 'property-name' => 'doc-block-type', - * ... - * ] - * ``` - * - * @see \Bake\Shell\Task\ModelTask::getEntityPropertySchema - * - * @param array $propertySchema The property schema to use for generating the type map. - * @return array The property DocType map. - */ - public function buildEntityPropertyHintTypeMap(array $propertySchema) - { - $properties = []; - foreach ($propertySchema as $property => $info) { - if ($info['kind'] === 'column') { - $type = $this->columnTypeToHintType($info['type']); - if (!empty($info['null'])) { - $type .= '|null'; - } - - $properties[$property] = $type; - } - } - - return $properties; - } - - /** - * Builds a map of entity associations as DocBlock types for use - * in generating `@property` hints. - * - * This method expects a property schema as generated by - * `\Bake\Shell\Task\ModelTask::getEntityPropertySchema()`. - * - * The generated map has the format of - * - * ``` - * [ - * 'property-name' => 'doc-block-type', - * ... - * ] - * ``` - * - * @see \Bake\Shell\Task\ModelTask::getEntityPropertySchema - * - * @param array $propertySchema The property schema to use for generating the type map. - * @return array The property DocType map. - */ - public function buildEntityAssociationHintTypeMap(array $propertySchema) - { - $properties = []; - foreach ($propertySchema as $property => $info) { - if ($info['kind'] === 'association') { - $type = $this->associatedEntityTypeToHintType($info['type'], $info['association']); - if ($info['association']->type() === Association::MANY_TO_ONE) { - $properties = $this->_insertAfter( - $properties, - $info['association']->getForeignKey(), - [$property => $type] - ); - } else { - $properties[$property] = $type; - } - } - } - - return $properties; - } - - /** - * Converts a column type to its DocBlock type counterpart. - * - * This method only supports the default CakePHP column types, - * custom column/database types will be ignored. - * - * @see \Cake\Database\Type - * - * @param string $type The column type. - * @return null|string The DocBlock type, or `null` for unsupported column types. - */ - public function columnTypeToHintType($type) - { - switch ($type) { - case 'string': - case 'text': - case 'uuid': - return 'string'; - - case 'integer': - case 'biginteger': - case 'smallinteger': - case 'tinyinteger': - return 'int'; - - case 'float': - case 'decimal': - return 'float'; - - case 'boolean': - return 'bool'; - - case 'array': - case 'json': - return 'array'; - - case 'binary': - return 'string|resource'; - - case 'date': - case 'datetime': - case 'time': - case 'timestamp': - $dbType = Type::build($type); - if (method_exists($dbType, 'getDateTimeClassName')) { - return '\\' . Type::build($type)->getDateTimeClassName(); - } - - return '\Cake\I18n\Time'; - } - - return null; - } - - /** - * Renders a map of DocBlock property types as an array of - * `@property` hints. - * - * @param array $properties A key value pair where key is the name of a property and the value is the type. - * @return array - */ - public function propertyHints(array $properties) - { - $lines = []; - foreach ($properties as $property => $type) { - $type = $type ? $type . ' ' : ''; - $lines[] = "@property {$type}\${$property}"; - } - - return $lines; - } - - /** - * Build property, method, mixing annotations for table class. - * - * @param array $associations Associations list. - * @param array $associationInfo Association info. - * @param array $behaviors Behaviors list. - * @param string $entity Entity name. - * @param string $namespace Namespace. - * @return array - */ - public function buildTableAnnotations($associations, $associationInfo, $behaviors, $entity, $namespace) - { - $annotations = []; - foreach ($associations as $type => $assocs) { - foreach ($assocs as $assoc) { - $typeStr = Inflector::camelize($type); - $tableFqn = $associationInfo[$assoc['alias']]['targetFqn']; - $annotations[] = "@property {$tableFqn}&\Cake\ORM\Association\\{$typeStr} \${$assoc['alias']}"; - } - } - $annotations[] = "@method \\{$namespace}\\Model\\Entity\\{$entity} get(\$primaryKey, \$options = [])"; - $annotations[] = "@method \\{$namespace}\\Model\\Entity\\{$entity} newEntity(\$data = null, array \$options = [])"; - $annotations[] = "@method \\{$namespace}\\Model\\Entity\\{$entity}[] newEntities(array \$data, array \$options = [])"; - $annotations[] = "@method \\{$namespace}\\Model\\Entity\\{$entity}|false save(\\Cake\\Datasource\\EntityInterface \$entity, \$options = [])"; - $annotations[] = "@method \\{$namespace}\\Model\\Entity\\{$entity} saveOrFail(\\Cake\\Datasource\\EntityInterface \$entity, \$options = [])"; - $annotations[] = "@method \\{$namespace}\\Model\\Entity\\{$entity} patchEntity(\\Cake\\Datasource\\EntityInterface \$entity, array \$data, array \$options = [])"; - $annotations[] = "@method \\{$namespace}\\Model\\Entity\\{$entity}[] patchEntities(\$entities, array \$data, array \$options = [])"; - $annotations[] = "@method \\{$namespace}\\Model\\Entity\\{$entity} findOrCreate(\$search, callable \$callback = null, \$options = [])"; - foreach ($behaviors as $behavior => $behaviorData) { - $className = App::className($behavior, 'Model/Behavior', 'Behavior'); - if ($className === false) { - $className = "Cake\ORM\Behavior\\{$behavior}Behavior"; - } - - $annotations[] = '@mixin \\' . $className; - } - - return $annotations; - } - - /** - * Inserts a value after a specific key in an associative array. - * - * In case the given key cannot be found, the value will be appended. - * - * @param array $target The array in which to insert the new value. - * @param string $key The array key after which to insert the new value. - * @param mixed $value The entry to insert. - * @return array The array with the new value inserted. - */ - protected function _insertAfter(array $target, $key, $value) - { - $index = array_search($key, array_keys($target)); - if ($index !== false) { - $target = array_merge( - array_slice($target, 0, $index + 1), - $value, - array_slice($target, $index + 1, null) - ); - } else { - $target += (array)$value; - } - - return $target; - } -} diff --git a/vendor/cakephp/bake/tests/Fixture/BakeArticlesBakeTagsFixture.php b/vendor/cakephp/bake/tests/Fixture/BakeArticlesBakeTagsFixture.php deleted file mode 100644 index f2ab05c..0000000 --- a/vendor/cakephp/bake/tests/Fixture/BakeArticlesBakeTagsFixture.php +++ /dev/null @@ -1,41 +0,0 @@ - ['type' => 'integer', 'null' => false], - 'bake_tag_id' => ['type' => 'integer', 'null' => false], - '_constraints' => ['UNIQUE_TAG' => ['type' => 'unique', 'columns' => ['bake_article_id', 'bake_tag_id']]], - ]; - - /** - * records property - * - * @var array - */ - public $records = []; -} diff --git a/vendor/cakephp/bake/tests/Fixture/BakeArticlesFixture.php b/vendor/cakephp/bake/tests/Fixture/BakeArticlesFixture.php deleted file mode 100644 index dd758ae..0000000 --- a/vendor/cakephp/bake/tests/Fixture/BakeArticlesFixture.php +++ /dev/null @@ -1,48 +0,0 @@ - ['type' => 'integer'], - 'bake_user_id' => ['type' => 'integer', 'null' => false], - 'title' => ['type' => 'string', 'length' => 50, 'null' => false], - 'body' => 'text', - 'rating' => ['type' => 'float', 'unsigned' => true, 'default' => 0.0, 'null' => false], - 'score' => ['type' => 'decimal', 'unsigned' => true, 'default' => 0.0, 'null' => false], - 'published' => ['type' => 'boolean', 'length' => 1, 'default' => false, 'null' => false], - 'created' => 'datetime', - 'updated' => 'datetime', - '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]], - ]; - - /** - * records property - * - * @var array - */ - public $records = []; -} diff --git a/vendor/cakephp/bake/tests/Fixture/BakeCarFixture.php b/vendor/cakephp/bake/tests/Fixture/BakeCarFixture.php deleted file mode 100644 index 5ec27b4..0000000 --- a/vendor/cakephp/bake/tests/Fixture/BakeCarFixture.php +++ /dev/null @@ -1,51 +0,0 @@ - ['type' => 'integer'], - 'bake_user_id' => ['type' => 'integer', 'null' => false], - 'title' => ['type' => 'string', 'null' => false], - 'body' => 'text', - 'published' => ['type' => 'boolean', 'length' => 1, 'default' => false], - 'created' => 'datetime', - 'updated' => 'datetime', - '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]], - ]; - - /** - * records property - * - * @var array - */ - public $records = []; -} diff --git a/vendor/cakephp/bake/tests/Fixture/BakeCommentsFixture.php b/vendor/cakephp/bake/tests/Fixture/BakeCommentsFixture.php deleted file mode 100644 index 69a663d..0000000 --- a/vendor/cakephp/bake/tests/Fixture/BakeCommentsFixture.php +++ /dev/null @@ -1,46 +0,0 @@ - ['type' => 'integer'], - 'bake_article_id' => ['type' => 'integer', 'null' => false], - 'bake_user_id' => ['type' => 'integer', 'null' => false], - 'comment' => 'text', - 'published' => ['type' => 'string', 'length' => 1, 'default' => 'N'], - 'created' => ['type' => 'datetime', 'length' => null, 'null' => false, 'default' => null, 'comment' => '', 'precision' => null], - 'updated' => ['type' => 'datetime', 'length' => null, 'null' => true, 'default' => null, 'comment' => '', 'precision' => null], - '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['otherid']]], - ]; - - /** - * records property - * - * @var array - */ - public $records = []; -} diff --git a/vendor/cakephp/bake/tests/Fixture/BakeTagsFixture.php b/vendor/cakephp/bake/tests/Fixture/BakeTagsFixture.php deleted file mode 100644 index 5f32092..0000000 --- a/vendor/cakephp/bake/tests/Fixture/BakeTagsFixture.php +++ /dev/null @@ -1,43 +0,0 @@ - ['type' => 'integer'], - 'tag' => ['type' => 'string', 'null' => false], - 'created' => 'datetime', - 'updated' => 'datetime', - '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]], - ]; - - /** - * records property - * - * @var array - */ - public $records = []; -} diff --git a/vendor/cakephp/bake/tests/Fixture/BakeTemplateAuthorsFixture.php b/vendor/cakephp/bake/tests/Fixture/BakeTemplateAuthorsFixture.php deleted file mode 100644 index ef293f2..0000000 --- a/vendor/cakephp/bake/tests/Fixture/BakeTemplateAuthorsFixture.php +++ /dev/null @@ -1,60 +0,0 @@ - ['type' => 'integer'], - 'role_id' => ['type' => 'integer', 'null' => false], - 'name' => ['type' => 'string', 'default' => null], - 'description' => ['type' => 'text', 'default' => null], - 'member' => ['type' => 'boolean'], - 'member_number' => ['type' => 'integer', 'null' => true], - 'account_balance' => ['type' => 'decimal', 'null' => true, 'precision' => 2, 'length' => 12], - 'created' => 'datetime', - 'modified' => 'datetime', - '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]], - ]; - - /** - * records property - * - * @var array - */ - public $records = [ - ['name' => 'mariano', 'role_id' => 1], - ['name' => 'nate', 'role_id' => 2], - ['name' => 'larry', 'role_id' => 2], - ['name' => 'garrett', 'role_id' => 1], - ]; -} diff --git a/vendor/cakephp/bake/tests/Fixture/BakeTemplateProfilesFixture.php b/vendor/cakephp/bake/tests/Fixture/BakeTemplateProfilesFixture.php deleted file mode 100644 index 84ae508..0000000 --- a/vendor/cakephp/bake/tests/Fixture/BakeTemplateProfilesFixture.php +++ /dev/null @@ -1,56 +0,0 @@ - ['type' => 'integer'], - 'author_id' => ['type' => 'integer', 'null' => false], - 'nick' => ['type' => 'string', 'null' => false], - 'avatar' => ['type' => 'string', 'default' => null], - '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]], - ]; - - /** - * records property - * - * @var array - */ - public $records = [ - ['author_id' => 1, 'nick' => 'The Comedian', 'avatar' => 'smiley.png'], - ['author_id' => 2, 'nick' => 'Rorschach', 'avatar' => 'stains.png'], - ['author_id' => 3, 'nick' => 'Ozymandias', 'avatar' => null], - ['author_id' => 4, 'nick' => 'Dr. Manhattan', 'avatar' => 'blue_lightning.png'], - ]; -} diff --git a/vendor/cakephp/bake/tests/Fixture/BakeTemplateRolesFixture.php b/vendor/cakephp/bake/tests/Fixture/BakeTemplateRolesFixture.php deleted file mode 100644 index 2a4f5be..0000000 --- a/vendor/cakephp/bake/tests/Fixture/BakeTemplateRolesFixture.php +++ /dev/null @@ -1,49 +0,0 @@ - ['type' => 'integer'], - 'name' => ['type' => 'string', 'null' => false], - '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]], - ]; - - /** - * records property - * - * @var array - */ - public $records = [ - ['name' => 'admin'], - ['name' => 'user'], - ]; -} diff --git a/vendor/cakephp/bake/tests/Fixture/BinaryTestsFixture.php b/vendor/cakephp/bake/tests/Fixture/BinaryTestsFixture.php deleted file mode 100644 index 0928152..0000000 --- a/vendor/cakephp/bake/tests/Fixture/BinaryTestsFixture.php +++ /dev/null @@ -1,42 +0,0 @@ - ['type' => 'integer'], - 'byte' => ['type' => 'binary', 'length' => 1], - 'data' => ['type' => 'binary', 'length' => 300], - '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]], - ]; - - /** - * records property - * - * @var array - */ - public $records = []; -} diff --git a/vendor/cakephp/bake/tests/Fixture/CategoriesFixture.php b/vendor/cakephp/bake/tests/Fixture/CategoriesFixture.php deleted file mode 100644 index 5c95b2b..0000000 --- a/vendor/cakephp/bake/tests/Fixture/CategoriesFixture.php +++ /dev/null @@ -1,57 +0,0 @@ - ['type' => 'integer', 'length' => 11, 'unsigned' => true, 'null' => false, 'default' => null, 'comment' => '', 'autoIncrement' => true, 'precision' => null], - 'created' => ['type' => 'datetime', 'length' => null, 'null' => false, 'default' => null, 'comment' => '', 'precision' => null], - 'modified' => ['type' => 'datetime', 'length' => null, 'null' => false, 'default' => null, 'comment' => '', 'precision' => null], - 'name' => ['type' => 'string', 'length' => 100, 'null' => false, 'default' => '', 'comment' => '', 'precision' => null, 'fixed' => null], - '_constraints' => [ - 'primary' => ['type' => 'primary', 'columns' => ['id'], 'length' => []], - ], - '_options' => [ - 'engine' => 'InnoDB', - 'collation' => 'utf8_general_ci' - ], - ]; - // @codingStandardsIgnoreEnd - - /** - * Records - * - * @var array - */ - public $records = [ - [ - 'created' => '2015-12-30 18:11:36', - 'modified' => '2015-12-30 18:11:36', - 'name' => 'Lorem ipsum dolor sit amet', - ], - ]; -} diff --git a/vendor/cakephp/bake/tests/Fixture/CategoriesProductsFixture.php b/vendor/cakephp/bake/tests/Fixture/CategoriesProductsFixture.php deleted file mode 100644 index beace82..0000000 --- a/vendor/cakephp/bake/tests/Fixture/CategoriesProductsFixture.php +++ /dev/null @@ -1,54 +0,0 @@ - ['type' => 'integer', 'length' => 11, 'unsigned' => true, 'null' => false, 'default' => null, 'comment' => '', 'precision' => null, 'autoIncrement' => null], - 'product_id' => ['type' => 'integer', 'length' => 11, 'unsigned' => true, 'null' => false, 'default' => null, 'comment' => '', 'precision' => null, 'autoIncrement' => null], - '_constraints' => [ - 'primary' => ['type' => 'primary', 'columns' => ['category_id', 'product_id'], 'length' => []], - ], - '_options' => [ - 'engine' => 'InnoDB', - 'collation' => 'utf8_general_ci' - ], - ]; - // @codingStandardsIgnoreEnd - - /** - * Records - * - * @var array - */ - public $records = [ - [ - 'category_id' => 1, - 'product_id' => 1, - ], - ]; -} diff --git a/vendor/cakephp/bake/tests/Fixture/CategoryThreadsFixture.php b/vendor/cakephp/bake/tests/Fixture/CategoryThreadsFixture.php deleted file mode 100644 index 21ff251..0000000 --- a/vendor/cakephp/bake/tests/Fixture/CategoryThreadsFixture.php +++ /dev/null @@ -1,54 +0,0 @@ - ['type' => 'integer'], - 'parent_id' => ['type' => 'integer'], - 'name' => ['type' => 'string', 'null' => false], - 'lft' => ['type' => 'integer', 'unsigned' => true], - 'rght' => ['type' => 'integer', 'unsigned' => true], - 'created' => 'datetime', - 'updated' => 'datetime', - '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]], - ]; - - /** - * records property - * - * @var array - */ - public $records = [ - ['parent_id' => 0, 'name' => 'Category 1', 'lft' => 1, 'rght' => 14, 'created' => '2007-03-18 15:30:23', 'updated' => '2007-03-18 15:32:31'], - ['parent_id' => 1, 'name' => 'Category 1.1', 'lft' => 2, 'rght' => 9, 'created' => '2007-03-18 15:30:23', 'updated' => '2007-03-18 15:32:31'], - ['parent_id' => 2, 'name' => 'Category 1.1.1', 'lft' => 3, 'rght' => 8, 'created' => '2007-03-18 15:30:23', 'updated' => '2007-03-18 15:32:31'], - ['parent_id' => 3, 'name' => 'Category 1.1.2', 'lft' => 4, 'rght' => 7, 'created' => '2007-03-18 15:30:23', 'updated' => '2007-03-18 15:32:31'], - ['parent_id' => 4, 'name' => 'Category 1.1.1.1', 'lft' => 5, 'rght' => 6, 'created' => '2007-03-18 15:30:23', 'updated' => '2007-03-18 15:32:31'], - ['parent_id' => 5, 'name' => 'Category 2', 'lft' => 10, 'rght' => 13, 'created' => '2007-03-18 15:30:23', 'updated' => '2007-03-18 15:32:31'], - ['parent_id' => 6, 'name' => 'Category 2.1', 'lft' => 11, 'rght' => 12, 'created' => '2007-03-18 15:30:23', 'updated' => '2007-03-18 15:32:31'], - ]; -} diff --git a/vendor/cakephp/bake/tests/Fixture/DatatypesFixture.php b/vendor/cakephp/bake/tests/Fixture/DatatypesFixture.php deleted file mode 100644 index 6203156..0000000 --- a/vendor/cakephp/bake/tests/Fixture/DatatypesFixture.php +++ /dev/null @@ -1,49 +0,0 @@ - ['type' => 'integer', 'null' => false], - 'decimal_field' => ['type' => 'decimal', 'length' => '6', 'precision' => 3, 'default' => '0.000'], - 'float_field' => ['type' => 'float', 'length' => '5,2', 'null' => false, 'default' => null], - 'huge_int' => ['type' => 'biginteger'], - 'small_int' => ['type' => 'smallinteger'], - 'tiny_int' => ['type' => 'tinyinteger'], - 'bool' => ['type' => 'boolean', 'null' => false, 'default' => false], - 'uuid' => ['type' => 'uuid'], - '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]], - ]; - - /** - * Records property - * - * @var array - */ - public $records = [ - ['float_field' => 42.23, 'huge_int' => '1234567891234567891', 'small_int' => '1234', 'tiny_int' => '12', 'bool' => 0], - ]; -} diff --git a/vendor/cakephp/bake/tests/Fixture/InvitationsFixture.php b/vendor/cakephp/bake/tests/Fixture/InvitationsFixture.php deleted file mode 100644 index 976fbe0..0000000 --- a/vendor/cakephp/bake/tests/Fixture/InvitationsFixture.php +++ /dev/null @@ -1,67 +0,0 @@ - ['type' => 'integer'], - 'sender_id' => ['type' => 'integer', 'null' => false], - 'receiver_id' => ['type' => 'integer', 'null' => false], - 'body' => 'text', - 'created' => 'datetime', - 'updated' => 'datetime', - '_constraints' => [ - 'primary' => ['type' => 'primary', 'columns' => ['id']], - 'sender_idx' => [ - 'type' => 'foreign', - 'columns' => ['sender_id'], - 'references' => ['users', 'id'], - 'update' => 'noAction', - 'delete' => 'noAction', - ], - 'receiver_idx' => [ - 'type' => 'foreign', - 'columns' => ['receiver_id'], - 'references' => ['users', 'id'], - 'update' => 'noAction', - 'delete' => 'noAction', - ], - ], - ]; - - /** - * records property - * - * @var array - */ - public $records = [ - [ - 'sender_id' => 1, - 'receiver_id' => 1, - 'body' => 'Try it out!', - ], - ]; -} diff --git a/vendor/cakephp/bake/tests/Fixture/NumberTreesFixture.php b/vendor/cakephp/bake/tests/Fixture/NumberTreesFixture.php deleted file mode 100644 index cd5ffd2..0000000 --- a/vendor/cakephp/bake/tests/Fixture/NumberTreesFixture.php +++ /dev/null @@ -1,47 +0,0 @@ - ['type' => 'integer'], - 'name' => ['type' => 'string', 'length' => 50, 'null' => false], - 'parent_id' => 'integer', - 'lft' => ['type' => 'integer', 'unsigned' => true], - 'rght' => ['type' => 'integer', 'unsigned' => true], - 'depth' => ['type' => 'integer', 'unsigned' => true], - '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]], - ]; - - /** - * Records - * - * @var array - */ - public $records = []; -} diff --git a/vendor/cakephp/bake/tests/Fixture/OldProductsFixture.php b/vendor/cakephp/bake/tests/Fixture/OldProductsFixture.php deleted file mode 100644 index aa2cda1..0000000 --- a/vendor/cakephp/bake/tests/Fixture/OldProductsFixture.php +++ /dev/null @@ -1,57 +0,0 @@ - ['type' => 'integer', 'length' => 11, 'unsigned' => true, 'null' => false, 'default' => null, 'comment' => '', 'autoIncrement' => true, 'precision' => null], - 'created' => ['type' => 'datetime', 'length' => null, 'null' => false, 'default' => null, 'comment' => '', 'precision' => null], - 'modified' => ['type' => 'datetime', 'length' => null, 'null' => true, 'default' => null, 'comment' => '', 'precision' => null], - 'name' => ['type' => 'string', 'length' => 100, 'null' => false, 'default' => '', 'comment' => '', 'precision' => null, 'fixed' => null], - '_constraints' => [ - 'primary' => ['type' => 'primary', 'columns' => ['id'], 'length' => []], - ], - '_options' => [ - 'engine' => 'InnoDB', - 'collation' => 'utf8_general_ci' - ], - ]; - // @codingStandardsIgnoreEnd - - /** - * Records - * - * @var array - */ - public $records = [ - [ - 'created' => '2015-12-30 18:11:36', - 'modified' => '2015-12-30 18:11:36', - 'name' => 'Lorem ipsum dolor sit amet', - ], - ]; -} diff --git a/vendor/cakephp/bake/tests/Fixture/ProductVersionsFixture.php b/vendor/cakephp/bake/tests/Fixture/ProductVersionsFixture.php deleted file mode 100644 index f2f9b68..0000000 --- a/vendor/cakephp/bake/tests/Fixture/ProductVersionsFixture.php +++ /dev/null @@ -1,55 +0,0 @@ - ['type' => 'integer', 'length' => 11, 'unsigned' => true, 'null' => false, 'default' => null, 'comment' => '', 'autoIncrement' => true, 'precision' => null], - 'product_id' => ['type' => 'integer', 'length' => 11, 'unsigned' => true, 'null' => false, 'default' => null, 'comment' => '', 'precision' => null, 'autoIncrement' => null], - 'version' => ['type' => 'datetime', 'length' => null, 'null' => false, 'default' => null, 'comment' => '', 'precision' => null], - '_constraints' => [ - 'primary' => ['type' => 'primary', 'columns' => ['id'], 'length' => []], - ], - '_options' => [ - 'engine' => 'InnoDB', - 'collation' => 'utf8_general_ci' - ], - ]; - // @codingStandardsIgnoreEnd - - /** - * Records - * - * @var array - */ - public $records = [ - [ - 'product_id' => 1, - 'version' => '2015-12-30 18:11:37', - ], - ]; -} diff --git a/vendor/cakephp/bake/tests/Fixture/ProductsFixture.php b/vendor/cakephp/bake/tests/Fixture/ProductsFixture.php deleted file mode 100644 index c701431..0000000 --- a/vendor/cakephp/bake/tests/Fixture/ProductsFixture.php +++ /dev/null @@ -1,57 +0,0 @@ - ['type' => 'integer', 'length' => 11, 'unsigned' => true, 'null' => false, 'default' => null, 'comment' => '', 'autoIncrement' => true, 'precision' => null], - 'created' => ['type' => 'datetime', 'length' => null, 'null' => false, 'default' => null, 'comment' => '', 'precision' => null], - 'modified' => ['type' => 'datetime', 'length' => null, 'null' => false, 'default' => null, 'comment' => '', 'precision' => null], - 'name' => ['type' => 'string', 'length' => 100, 'null' => false, 'default' => '', 'comment' => '', 'precision' => null, 'fixed' => null], - '_constraints' => [ - 'primary' => ['type' => 'primary', 'columns' => ['id'], 'length' => []], - ], - '_options' => [ - 'engine' => 'InnoDB', - 'collation' => 'utf8_general_ci' - ], - ]; - // @codingStandardsIgnoreEnd - - /** - * Records - * - * @var array - */ - public $records = [ - [ - 'created' => '2015-12-30 18:11:37', - 'modified' => '2015-12-30 18:11:37', - 'name' => 'Lorem ipsum dolor sit amet', - ], - ]; -} diff --git a/vendor/cakephp/bake/tests/bootstrap.php b/vendor/cakephp/bake/tests/bootstrap.php deleted file mode 100644 index 9c29d1c..0000000 --- a/vendor/cakephp/bake/tests/bootstrap.php +++ /dev/null @@ -1,59 +0,0 @@ - 'App', - 'paths' => [ - 'plugins' => [ROOT . 'Plugin' . DS], - 'templates' => [ROOT . 'App' . DS . 'Template' . DS] - ], - 'encoding' => 'UTF-8' -]); - -if (!getenv('db_dsn')) { - putenv('db_dsn=sqlite:///:memory:'); -} -ConnectionManager::setConfig('test', ['url' => getenv('db_dsn')]); - -Plugin::getCollection()->add(new \Bake\Plugin()); diff --git a/vendor/cakephp/cakephp-codesniffer/.editorconfig b/vendor/cakephp/cakephp-codesniffer/.editorconfig deleted file mode 100644 index e43d095..0000000 --- a/vendor/cakephp/cakephp-codesniffer/.editorconfig +++ /dev/null @@ -1,17 +0,0 @@ -; This file is for unifying the coding style for different editors and IDEs. -; More information at http://editorconfig.org - -root = true - -[*] -indent_style = space -indent_size = 4 -end_of_line = lf -insert_final_newline = true -trim_trailing_whitespace = true - -[*.bat] -end_of_line = crlf - -[*.yml] -indent_size = 2 diff --git a/vendor/cakephp/cakephp-codesniffer/.gitattributes b/vendor/cakephp/cakephp-codesniffer/.gitattributes deleted file mode 100644 index af6a864..0000000 --- a/vendor/cakephp/cakephp-codesniffer/.gitattributes +++ /dev/null @@ -1,10 +0,0 @@ -# Define the line ending behavior of the different file extensions -# Set default behaviour, in case users don't have core.autocrlf set. -* text=lf - -# Explicitly declare text files we want to always be normalized and converted -# to native line endings on checkout. -*.php eol=lf - -# Declare files that will always have CRLF line endings on checkout. -*.bat eol=crlf diff --git a/vendor/cakephp/cakephp-codesniffer/.gitignore b/vendor/cakephp/cakephp-codesniffer/.gitignore deleted file mode 100644 index 217b42f..0000000 --- a/vendor/cakephp/cakephp-codesniffer/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/build/ -/dist/ -tags -composer.lock -vendor/ -/.idea/ diff --git a/vendor/cakephp/cakephp-codesniffer/.travis.yml b/vendor/cakephp/cakephp-codesniffer/.travis.yml deleted file mode 100644 index 4d2d14b..0000000 --- a/vendor/cakephp/cakephp-codesniffer/.travis.yml +++ /dev/null @@ -1,37 +0,0 @@ -language: php - -php: - - 5.6 - - 7.0 - - 7.1 - - 7.2 - - 7.3 - - 7.4snapshot - -matrix: - fast_finish: true - - include: - - php: 7.2 - env: PHPCS=1 - -before_install: - - if [[ $TRAVIS_PHP_VERSION != "7.4snapshot" ]]; then phpenv config-rm xdebug.ini; fi - -before_script: - - composer install --prefer-source - -script: - - if [[ $PHPCS != 1 && $TRAVIS_PHP_VERSION = 7.1 ]]; then composer run-script test-coverage --timeout=0; fi - - if [[ $PHPCS != 1 && $TRAVIS_PHP_VERSION != 7.1 ]]; then composer test; fi - - if [[ $PHPCS = 1 ]]; then composer cs-check; fi - -after_success: - - if [[ $PHPCS != 1 && $TRAVIS_PHP_VERSION = 7.1 ]]; then bash <(curl -s https://codecov.io/bash); fi - -cache: - directories: - - $HOME/.composer/cache - -notifications: - email: false diff --git a/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/Commenting/DocBlockAlignmentSniff.php b/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/Commenting/DocBlockAlignmentSniff.php deleted file mode 100644 index 799d737..0000000 --- a/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/Commenting/DocBlockAlignmentSniff.php +++ /dev/null @@ -1,88 +0,0 @@ -getTokens(); - $commentClose = $phpcsFile->findNext(T_DOC_COMMENT_CLOSE_TAG, $stackPtr); - $afterComment = $phpcsFile->findNext(T_WHITESPACE, $commentClose + 1, null, true); - $commentIndentation = $tokens[$stackPtr]['column'] - 1; - $codeIndentation = $tokens[$afterComment]['column'] - 1; - - // Check for doc block opening being misaligned - if ($commentIndentation != $codeIndentation) { - $msg = 'Doc block not aligned with code; expected indentation of %s but found %s'; - $data = [$codeIndentation, $commentIndentation]; - $fix = $phpcsFile->addFixableError($msg, $stackPtr, 'DocBlockMisaligned', $data); - if ($fix === true) { - // Collect tokens to change indentation of - $tokensToIndent = [ - $stackPtr => $codeIndentation, - ]; - $commentOpenLine = $tokens[$stackPtr]['line']; - $commentCloseLine = $tokens[$commentClose]['line']; - $lineBreaksInComment = $commentCloseLine - $commentOpenLine; - if ($lineBreaksInComment !== 0) { - $searchToken = $stackPtr + 1; - do { - $commentBorder = $phpcsFile->findNext( - [T_DOC_COMMENT_STAR, T_DOC_COMMENT_CLOSE_TAG], - $searchToken, - $commentClose + 1 - ); - if ($commentBorder !== false) { - $tokensToIndent[$commentBorder] = $codeIndentation + 1; - $searchToken = $commentBorder + 1; - } - } while ($commentBorder !== false); - } - - // Update indentation - $phpcsFile->fixer->beginChangeset(); - foreach ($tokensToIndent as $searchToken => $indent) { - $indentString = str_repeat(' ', $indent); - $isOpenTag = $tokens[$searchToken]['type'] === 'T_DOC_COMMENT_OPEN_TAG'; - if ($isOpenTag && $commentIndentation === 0) { - $phpcsFile->fixer->addContentBefore($searchToken, $indentString); - } else { - $phpcsFile->fixer->replaceToken($searchToken - 1, $indentString); - } - } - $phpcsFile->fixer->endChangeset(); - } - } - } -} diff --git a/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/Commenting/FunctionCommentSniff.php b/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/Commenting/FunctionCommentSniff.php deleted file mode 100644 index d6fe498..0000000 --- a/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/Commenting/FunctionCommentSniff.php +++ /dev/null @@ -1,479 +0,0 @@ - - * @author Marc McIntyre - * @copyright 2006-2014 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - * @link http://pear.php.net/package/PHP_CodeSniffer - */ -namespace CakePHP\Sniffs\Commenting; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Standards\PEAR\Sniffs\Commenting\FunctionCommentSniff as PearFunctionCommentSniff; -use PHP_CodeSniffer\Util\Common; - -/** - * Parses and verifies the doc comments for functions. - * - * Verifies that : - *
    - *
  • A comment exists
  • - *
  • There is a blank newline after the short description
  • - *
  • There is a blank newline between the long and short description
  • - *
  • There is a blank newline between the long description and tags
  • - *
  • Parameter names represent those in the method
  • - *
  • Parameter comments are in the correct order
  • - *
  • Parameter comments are complete
  • - *
  • A type hint is provided for array and custom class
  • - *
  • Type hint matches the actual variable/class type
  • - *
  • A blank line is present before the first and after the last parameter
  • - *
  • A return type exists
  • - *
  • Any throw tag must have a comment
  • - *
  • The tag order and indentation are correct
  • - *
- * - * @category PHP - * @package PHP_CodeSniffer - * @author Greg Sherwood - * @author Marc McIntyre - * @copyright 2006-2014 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - * @version Release: @package_version@ - * @link http://pear.php.net/package/PHP_CodeSniffer - */ -class FunctionCommentSniff extends PearFunctionCommentSniff -{ - /** - * Is the comment an inheritdoc? - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the stack passed in $tokens. - * @return bool True if the comment is an inheritdoc - */ - protected function isInheritDoc(File $phpcsFile, $stackPtr) - { - $start = $phpcsFile->findPrevious(T_DOC_COMMENT_OPEN_TAG, $stackPtr - 1); - $end = $phpcsFile->findNext(T_DOC_COMMENT_CLOSE_TAG, $start); - $content = $phpcsFile->getTokensAsString($start, ($end - $start)); - - return preg_match('/{@inheritDoc}|@inheritDoc/i', $content) === 1; - } - - /** - * Process the return comment of this function comment. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the stack passed in $tokens. - * @param int $commentStart The position in the stack where the comment started. - * @return void - */ - protected function processReturn(File $phpcsFile, $stackPtr, $commentStart) - { - if ($this->isInheritDoc($phpcsFile, $stackPtr)) { - return; - } - - $tokens = $phpcsFile->getTokens(); - - // Skip constructor and destructor. - $className = ''; - foreach ($tokens[$stackPtr]['conditions'] as $condPtr => $condition) { - if ($condition === T_CLASS || $condition === T_INTERFACE) { - $className = $phpcsFile->getDeclarationName($condPtr); - $className = strtolower(ltrim($className, '_')); - } - } - - $methodName = $phpcsFile->getDeclarationName($stackPtr); - $isSpecialMethod = ($methodName === '__construct' || $methodName === '__destruct'); - if ($methodName !== '_') { - $methodName = strtolower(ltrim($methodName, '_')); - } - - $return = null; - foreach ($tokens[$commentStart]['comment_tags'] as $tag) { - if ($tokens[$tag]['content'] === '@return') { - if ($return !== null) { - $error = 'Only 1 @return tag is allowed in a function comment'; - $phpcsFile->addError($error, $tag, 'DuplicateReturn'); - - return; - } - - $return = $tag; - } - } - - if ($isSpecialMethod === true) { - return; - } - - if ($return === null) { - $error = 'Missing @return tag in function comment'; - $phpcsFile->addWarning($error, $tokens[$commentStart]['comment_closer'], 'MissingReturn'); - - return; - } - - $content = $tokens[($return + 2)]['content']; - if (empty($content) === true || $tokens[($return + 2)]['code'] !== T_DOC_COMMENT_STRING) { - $error = 'Return type missing for @return tag in function comment'; - $phpcsFile->addError($error, $return, 'MissingReturnType'); - - return; - } - - // Check return type (can be multiple, separated by '|'). - list($types, ) = explode(' ', $content); - $typeNames = explode('|', $types); - $suggestedNames = []; - foreach ($typeNames as $i => $typeName) { - if ($typeName === 'integer') { - $suggestedName = 'int'; - } elseif ($typeName === 'boolean') { - $suggestedName = 'bool'; - } elseif (in_array($typeName, ['int', 'bool'])) { - $suggestedName = $typeName; - } else { - $suggestedName = Common::suggestType($typeName); - } - if (in_array($suggestedName, $suggestedNames) === false) { - $suggestedNames[] = $suggestedName; - } - } - - $suggestedType = implode('|', $suggestedNames); - if ($types !== $suggestedType) { - $error = 'Expected "%s" but found "%s" for function return type'; - $data = [ - $suggestedType, - $types, - ]; - $phpcsFile->addError($error, $return, 'InvalidReturn', $data); - } - - $endToken = isset($tokens[$stackPtr]['scope_closer']) ? $tokens[$stackPtr]['scope_closer'] : false; - if (!$endToken) { - return; - } - - // If the return type is void, make sure there is - // no non-void return statements in the function. - if ($typeNames === ['void']) { - for ($returnToken = $stackPtr; $returnToken < $endToken; $returnToken++) { - if ($tokens[$returnToken]['code'] === T_CLOSURE) { - $returnToken = $tokens[$returnToken]['scope_closer']; - continue; - } - - if ( - $tokens[$returnToken]['code'] === T_RETURN - || $tokens[$returnToken]['code'] === T_YIELD - || $tokens[$returnToken]['code'] === T_YIELD_FROM - ) { - break; - } - } - - if ($returnToken !== $endToken) { - // If the function is not returning anything, just - // exiting, then there is no problem. - $semicolon = $phpcsFile->findNext(T_WHITESPACE, ($returnToken + 1), null, true); - if ($tokens[$semicolon]['code'] !== T_SEMICOLON) { - $error = 'Function return type is void, but function contains return statement'; - $phpcsFile->addWarning($error, $return, 'InvalidReturnVoid'); - } - } - - return; - } - - // If return type is not void, there needs to be a return statement - // somewhere in the function that returns something. - if (!in_array('mixed', $typeNames, true) && !in_array('void', $typeNames, true)) { - $returnToken = $phpcsFile->findNext([T_RETURN, T_YIELD, T_YIELD_FROM], $stackPtr, $endToken); - if ($returnToken === false) { - $error = 'Function return type is not void, but function has no return statement'; - $phpcsFile->addWarning($error, $return, 'InvalidNoReturn'); - } else { - $semicolon = $phpcsFile->findNext(T_WHITESPACE, ($returnToken + 1), null, true); - if ($tokens[$semicolon]['code'] === T_SEMICOLON) { - $error = 'Function return type is not void, but function is returning void here'; - $phpcsFile->addWarning($error, $returnToken, 'InvalidReturnNotVoid'); - } - } - } - } - - /** - * Process any throw tags that this function comment has. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the stack passed in $tokens. - * @param int $commentStart The position in the stack where the comment started. - * @return void - */ - protected function processThrows(File $phpcsFile, $stackPtr, $commentStart) - { - $tokens = $phpcsFile->getTokens(); - - foreach ($tokens[$commentStart]['comment_tags'] as $pos => $tag) { - if ($tokens[$tag]['content'] !== '@throws') { - continue; - } - - $exception = $comment = null; - if ($tokens[($tag + 2)]['code'] === T_DOC_COMMENT_STRING) { - $matches = []; - preg_match('/([^\s]+)(?:\s+(.*))?/', $tokens[($tag + 2)]['content'], $matches); - $exception = $matches[1]; - if (isset($matches[2]) === true) { - $comment = $matches[2]; - } - } - - if ($exception === null) { - $error = 'Exception type and comment missing for @throws tag in function comment'; - $phpcsFile->addWarning($error, $tag, 'InvalidThrows'); - } elseif ($comment === null) { - $error = 'Comment missing for @throws tag in function comment'; - $phpcsFile->addWarning($error, $tag, 'EmptyThrows'); - } else { - // Any strings until the next tag belong to this comment. - if (isset($tokens[$commentStart]['comment_tags'][($pos + 1)]) === true) { - $end = $tokens[$commentStart]['comment_tags'][($pos + 1)]; - } else { - $end = $tokens[$commentStart]['comment_closer']; - } - - for ($i = ($tag + 3); $i < $end; $i++) { - if ($tokens[$i]['code'] === T_DOC_COMMENT_STRING) { - $comment .= ' ' . $tokens[$i]['content']; - } - } - - // Starts with a capital letter and ends with a fullstop. - $firstChar = $comment[0]; - if (strtoupper($firstChar) !== $firstChar) { - $error = '@throws tag comment must start with a capital letter'; - $phpcsFile->addWarning($error, ($tag + 2), 'ThrowsNotCapital'); - } - - $lastChar = substr($comment, -1); - if ($lastChar !== '.') { - $error = '@throws tag comment must end with a full stop'; - $phpcsFile->addWarning($error, ($tag + 2), 'ThrowsNoFullStop'); - } - } - } - } - - /** - * Process the function parameter comments. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the stack passed in $tokens. - * @param int $commentStart The position in the stack where the comment started. - * @return void - */ - protected function processParams(File $phpcsFile, $stackPtr, $commentStart) - { - if ($this->isInheritDoc($phpcsFile, $stackPtr)) { - return; - } - - $tokens = $phpcsFile->getTokens(); - - $params = []; - $maxType = $maxVar = 0; - foreach ($tokens[$commentStart]['comment_tags'] as $pos => $tag) { - if ($tokens[$tag]['content'] !== '@param') { - continue; - } - - $type = $var = $comment = ''; - $typeSpace = $varSpace = 0; - $commentLines = []; - if ($tokens[($tag + 2)]['code'] === T_DOC_COMMENT_STRING) { - $matches = []; - preg_match('/([^$&]+)(?:((?:\$|&)[^\s]+)(?:(\s+)(.*))?)?/', $tokens[($tag + 2)]['content'], $matches); - - $typeLen = strlen($matches[1]); - $type = trim($matches[1]); - $typeSpace = ($typeLen - strlen($type)); - $typeLen = strlen($type); - if ($typeLen > $maxType) { - $maxType = $typeLen; - } - - if (isset($matches[2]) === true) { - $var = $matches[2]; - $varLen = strlen($var); - if ($varLen > $maxVar) { - $maxVar = $varLen; - } - - if (isset($matches[4]) === true) { - $varSpace = strlen($matches[3]); - $comment = $matches[4]; - $commentLines[] = [ - 'comment' => $comment, - 'token' => ($tag + 2), - 'indent' => $varSpace, - ]; - - // Any strings until the next tag belong to this comment. - if (isset($tokens[$commentStart]['comment_tags'][($pos + 1)]) === true) { - $end = $tokens[$commentStart]['comment_tags'][($pos + 1)]; - } else { - $end = $tokens[$commentStart]['comment_closer']; - } - - for ($i = ($tag + 3); $i < $end; $i++) { - if ($tokens[$i]['code'] === T_DOC_COMMENT_STRING) { - $indent = 0; - if ($tokens[($i - 1)]['code'] === T_DOC_COMMENT_WHITESPACE) { - $indent = strlen($tokens[($i - 1)]['content']); - } - - $comment .= ' ' . $tokens[$i]['content']; - $commentLines[] = [ - 'comment' => $tokens[$i]['content'], - 'token' => $i, - 'indent' => $indent, - ]; - } - } - } else { - $error = 'Missing parameter comment'; - $phpcsFile->addError($error, $tag, 'MissingParamComment'); - $commentLines[] = ['comment' => '']; - } - } else { - $error = 'Missing parameter name'; - $phpcsFile->addError($error, $tag, 'MissingParamName'); - } - } else { - $error = 'Missing parameter type'; - $phpcsFile->addError($error, $tag, 'MissingParamType'); - } - - $params[] = compact('tag', 'type', 'var', 'comment', 'commentLines', 'typeSpace', 'varSpace'); - } - - $realParams = $phpcsFile->getMethodParameters($stackPtr); - $foundParams = []; - - foreach ($params as $pos => $param) { - // If the type is empty, the whole line is empty. - if ($param['type'] === '') { - continue; - } - - // Check the param type value. - $typeNames = explode('|', $param['type']); - foreach ($typeNames as $typeName) { - if ($typeName === 'integer') { - $suggestedName = 'int'; - } elseif ($typeName === 'boolean') { - $suggestedName = 'bool'; - } elseif (in_array($typeName, ['int', 'bool'])) { - $suggestedName = $typeName; - } else { - $suggestedName = Common::suggestType($typeName); - } - - if ($typeName !== $suggestedName) { - $error = 'Expected "%s" but found "%s" for parameter type'; - $data = [$suggestedName, $typeName]; - - $fix = $phpcsFile->addFixableError($error, $param['tag'], 'IncorrectParamVarName', $data); - if ($fix === true) { - $content = $suggestedName; - $content .= str_repeat(' ', $param['typeSpace']); - $content .= $param['var']; - $content .= str_repeat(' ', $param['varSpace']); - if (isset($param['commentLines'][0])) { - $content .= $param['commentLines'][0]['comment']; - } - $phpcsFile->fixer->replaceToken(($param['tag'] + 2), $content); - } - } - } - - if ($param['var'] === '') { - continue; - } - - $foundParams[] = $param['var']; - - // Make sure the param name is correct. - if (isset($realParams[$pos]) === true) { - $realName = $realParams[$pos]['name']; - if ($realName !== $param['var']) { - $code = 'ParamNameNoMatch'; - $data = [$param['var'], $realName]; - - $error = 'Doc comment for parameter %s does not match '; - if (strtolower($param['var']) === strtolower($realName)) { - $error .= 'case of '; - $code = 'ParamNameNoCaseMatch'; - } - - $error .= 'actual variable name %s'; - - $fix = $phpcsFile->addFixableWarning($error, $param['tag'], $code, $data); - - if ($fix === true) { - $content = $suggestedName; - $content .= str_repeat(' ', $param['typeSpace']); - $content .= $realName; - $content .= str_repeat(' ', $param['varSpace']); - $content .= $param['commentLines'][0]['comment']; - $phpcsFile->fixer->replaceToken(($param['tag'] + 2), $content); - } - } - } elseif (substr($param['var'], -4) !== ',...') { - // We must have an extra parameter comment. - $error = 'Superfluous parameter comment'; - $phpcsFile->addError($error, $param['tag'], 'ExtraParamComment'); - } - - if ($param['comment'] === '') { - continue; - } - - // Param comments must start with a capital letter and end with the full stop. - $firstChar = $param['comment'][0]; - if (preg_match('|\p{Lu}|u', $firstChar) === 0) { - $error = 'Parameter comment must start with a capital letter'; - $phpcsFile->addWarning($error, $param['tag'], 'ParamCommentNotCapital'); - } - - $lastChar = substr($param['comment'], -1); - if ($lastChar !== '.') { - $error = 'Parameter comment must end with a full stop'; - $phpcsFile->addWarning($error, $param['tag'], 'ParamCommentFullStop'); - } - } - - $realNames = []; - foreach ($realParams as $realParam) { - $realNames[] = $realParam['name']; - } - - // Report missing comments. - $diff = array_diff($realNames, $foundParams); - foreach ($diff as $neededParam) { - $error = 'Doc comment for parameter "%s" missing'; - $data = [$neededParam]; - $phpcsFile->addWarning($error, $commentStart, 'MissingParamTag', $data); - } - } -} diff --git a/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/ControlStructures/ControlStructuresSniff.php b/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/ControlStructures/ControlStructuresSniff.php deleted file mode 100644 index 0727230..0000000 --- a/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/ControlStructures/ControlStructuresSniff.php +++ /dev/null @@ -1,62 +0,0 @@ -getTokens(); - - $nextToken = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); - if ($tokens[$nextToken]['code'] === T_OPEN_PARENTHESIS) { - $closer = $tokens[$nextToken]['parenthesis_closer']; - $diff = $closer - $stackPtr; - $nextToken = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + $diff + 1), null, true); - } - if ($tokens[$nextToken]['code'] === T_IF) { - // "else if" is not checked by this sniff, another sniff takes care of that. - return; - } - if ($tokens[$nextToken]['code'] !== T_OPEN_CURLY_BRACKET && $tokens[$nextToken]['code'] !== T_COLON) { - $error = 'Curly brackets required for if/elseif/else.'; - $phpcsFile->addError($error, $stackPtr, 'NotAllowed'); - } - } -} diff --git a/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/ControlStructures/ElseIfDeclarationSniff.php b/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/ControlStructures/ElseIfDeclarationSniff.php deleted file mode 100644 index fa1816e..0000000 --- a/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/ControlStructures/ElseIfDeclarationSniff.php +++ /dev/null @@ -1,53 +0,0 @@ -getTokens(); - - $nextToken = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); - if ($tokens[$nextToken]['code'] !== T_IF) { - return; - } - - $error = 'Usage of ELSE IF not allowed; use ELSEIF instead'; - $phpcsFile->addError($error, $stackPtr, 'NotAllowed'); - } -} diff --git a/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/ControlStructures/WhileStructuresSniff.php b/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/ControlStructures/WhileStructuresSniff.php deleted file mode 100644 index 42045f8..0000000 --- a/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/ControlStructures/WhileStructuresSniff.php +++ /dev/null @@ -1,61 +0,0 @@ -getTokens(); - - $nextToken = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); - if ($tokens[$nextToken]['code'] === T_OPEN_PARENTHESIS) { - $closer = $tokens[$nextToken]['parenthesis_closer']; - $diff = $closer - $stackPtr; - $nextToken = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + $diff + 1), null, true); - } - - if ($tokens[$stackPtr]['code'] === T_WHILE && $tokens[$nextToken]['code'] === T_SEMICOLON) { - /* This while is probably part of a do-while construction, skip it .. */ - return; - } - if ($tokens[$nextToken]['code'] !== T_OPEN_CURLY_BRACKET && $tokens[$nextToken]['code'] !== T_COLON) { - $error = 'Curly brackets required in a do-while or while loop'; - $phpcsFile->addError($error, $stackPtr, 'NotAllowed'); - } - } -} diff --git a/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/Formatting/BlankLineBeforeReturnSniff.php b/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/Formatting/BlankLineBeforeReturnSniff.php deleted file mode 100644 index bebba1c..0000000 --- a/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/Formatting/BlankLineBeforeReturnSniff.php +++ /dev/null @@ -1,80 +0,0 @@ - - * @license http://spdx.org/licenses/MIT MIT License - * @link https://github.com/escapestudios/Symfony2-coding-standard - */ -class BlankLineBeforeReturnSniff implements Sniff -{ - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = [ - 'PHP', - 'JS', - ]; - - /** - * {@inheritDoc} - */ - public function register() - { - return [T_RETURN]; - } - - /** - * {@inheritDoc} - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - $current = $stackPtr; - $previousLine = $tokens[$stackPtr]['line'] - 1; - $prevLineTokens = []; - - while ($current >= 0 && $tokens[$current]['line'] >= $previousLine) { - if ( - $tokens[$current]['line'] == $previousLine - && $tokens[$current]['type'] !== 'T_WHITESPACE' - && $tokens[$current]['type'] !== 'T_COMMENT' - && $tokens[$current]['type'] !== 'T_DOC_COMMENT_OPEN_TAG' - && $tokens[$current]['type'] !== 'T_DOC_COMMENT_TAG' - && $tokens[$current]['type'] !== 'T_DOC_COMMENT_STRING' - && $tokens[$current]['type'] !== 'T_DOC_COMMENT_CLOSE_TAG' - && $tokens[$current]['type'] !== 'T_DOC_COMMENT_WHITESPACE' - ) { - $prevLineTokens[] = $tokens[$current]['type']; - } - $current--; - } - - if ( - isset($prevLineTokens[0]) - && ($prevLineTokens[0] === 'T_OPEN_CURLY_BRACKET' - || $prevLineTokens[0] === 'T_COLON' - || $prevLineTokens[0] === 'T_OPEN_TAG') - ) { - return; - } elseif (count($prevLineTokens) > 0) { - $fix = $phpcsFile->addFixableError( - 'Missing blank line before return statement', - $stackPtr, - 'BlankLineBeforeReturn' - ); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->addNewlineBefore($stackPtr - 1); - $phpcsFile->fixer->endChangeset(); - } - } - } -} diff --git a/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/Formatting/UseInAlphabeticalOrderSniff.php b/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/Formatting/UseInAlphabeticalOrderSniff.php deleted file mode 100644 index 5e76934..0000000 --- a/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/Formatting/UseInAlphabeticalOrderSniff.php +++ /dev/null @@ -1,154 +0,0 @@ -_processed[$phpcsFile->getFilename()])) { - return; - } - $filename = $phpcsFile->getFilename(); - - $this->_uses = []; - $next = $stackPtr; - - while ($next !== false) { - $this->_checkUseToken($phpcsFile, $next); - $next = $phpcsFile->findNext(T_USE, $next + 1); - } - - // Prevent multiple uses in the same file from entering - $this->_processed[$phpcsFile->getFilename()] = true; - - foreach ($this->_uses as $scope => $used) { - $defined = $sorted = array_keys($used); - - natcasesort($sorted); - $sorted = array_values($sorted); - if ($sorted === $defined) { - continue; - } - - foreach ($defined as $i => $name) { - if ($name !== $sorted[$i]) { - $error = 'Use classes must be in alphabetical order. Was expecting ' . $sorted[$i]; - $phpcsFile->addError($error, $used[$name], 'UseInAlphabeticalOrder'); - } - } - } - } - - /** - * Check all the use tokens in a file. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file to check. - * @param int $stackPtr The index of the first use token. - * @return void - */ - protected function _checkUseToken($phpcsFile, $stackPtr) - { - // If the use token is for a closure we want to ignore it. - $isClosure = $this->_isClosure($phpcsFile, $stackPtr); - if ($isClosure) { - return; - } - - $tokens = $phpcsFile->getTokens(); - - $scope = 'use'; - $useType = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); - if ($useType !== false && $tokens[$useType]['code'] === T_STRING) { - $useContent = strtolower($tokens[$useType]['content']); - if ($useContent === 'function' || $useContent === 'const') { - $scope .= ' ' . $useContent; - $stackPtr = $useType + 1; - } - } - - $content = ''; - $end = $phpcsFile->findNext([T_SEMICOLON, T_OPEN_CURLY_BRACKET], $stackPtr); - $useTokens = array_slice($tokens, $stackPtr, $end - $stackPtr, true); - - foreach ($useTokens as $index => $token) { - if ($token['code'] === T_STRING || $token['code'] === T_NS_SEPARATOR) { - $content .= $token['content']; - } - } - - // Check for class scoping on use. Traits should be - // ordered independently. - if (!empty($token['conditions'])) { - $scope .= key($token['conditions']); - } - $this->_uses[$scope][$content] = $stackPtr; - } - - /** - * Check if the current stackPtr is a use token that is for a closure. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The index of the first use token. - * @return bool - */ - protected function _isClosure($phpcsFile, $stackPtr) - { - return $phpcsFile->findPrevious( - [T_CLOSURE], - ($stackPtr - 1), - null, - false, - null, - true - ); - } -} diff --git a/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/Functions/ClosureDeclarationSniff.php b/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/Functions/ClosureDeclarationSniff.php deleted file mode 100644 index eb0bbfa..0000000 --- a/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/Functions/ClosureDeclarationSniff.php +++ /dev/null @@ -1,54 +0,0 @@ -getTokens(); - $spaces = 0; - - if ($tokens[($stackPtr + 1)]['code'] === T_WHITESPACE) { - $spaces = strlen($tokens[($stackPtr + 1)]['content']); - } - - if ($spaces !== 1) { - $error = 'Expected 1 space after closure\'s function keyword; %s found'; - $data = [$spaces]; - $phpcsFile->addError($error, $stackPtr, 'SpaceAfterFunction', $data); - } - } -} diff --git a/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/Functions/FunctionDeclarationArgumentSpacingSniff.php b/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/Functions/FunctionDeclarationArgumentSpacingSniff.php deleted file mode 100644 index e3f4ea5..0000000 --- a/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/Functions/FunctionDeclarationArgumentSpacingSniff.php +++ /dev/null @@ -1,34 +0,0 @@ -getDeclarationName($stackPtr); - $className = $phpcsFile->getDeclarationName($currScope); - $errorData = [$className . '::' . $methodName]; - - // Ignore magic methods - if (preg_match('/^__(' . implode('|', $this->_magicMethods) . ')$/', $methodName)) { - return; - } - - $methodProps = $phpcsFile->getMethodProperties($stackPtr); - if ($methodProps['scope_specified'] === false) { - // Let another sniffer take care of that - return; - } - - $isPublic = $methodProps['scope'] === 'public'; - - if ($isPublic === true && $methodName[0] === '_') { - $error = 'Public method name "%s" must not be prefixed with underscore'; - $phpcsFile->addError($error, $stackPtr, 'PublicWithUnderscore', $errorData); - - return; - } - } - - /** - * {@inheritDoc} - */ - protected function processTokenOutsideScope(File $phpcsFile, $stackPtr) - { - } -} diff --git a/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/NamingConventions/ValidTraitNameSniff.php b/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/NamingConventions/ValidTraitNameSniff.php deleted file mode 100644 index 5c9acb4..0000000 --- a/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/NamingConventions/ValidTraitNameSniff.php +++ /dev/null @@ -1,51 +0,0 @@ -getTokens(); - $traitName = $tokens[$stackPtr + 2]['content']; - - if (substr($traitName, -5) !== 'Trait') { - $error = 'Traits must have a "Trait" suffix.'; - $phpcsFile->addError($error, $stackPtr, 'InvalidTraitName'); - } - } -} diff --git a/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/PHP/CommaAfterArrayItemSniff.php b/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/PHP/CommaAfterArrayItemSniff.php deleted file mode 100644 index 93c3998..0000000 --- a/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/PHP/CommaAfterArrayItemSniff.php +++ /dev/null @@ -1,73 +0,0 @@ -= 70300; - - /** - * @inheritDoc - */ - public function register() - { - return [ - T_OPEN_SHORT_ARRAY, - ]; - } - - /** - * @inheritDoc - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - $arrayToken = $tokens[$stackPtr]; - $closeParenthesisPointer = $arrayToken['bracket_closer']; - $openParenthesisToken = $tokens[$arrayToken['bracket_opener']]; - $closeParenthesisToken = $tokens[$closeParenthesisPointer]; - if ($openParenthesisToken['line'] === $closeParenthesisToken['line']) { - return; - } - - $previousToCloseParenthesisPointer = $phpcsFile->findPrevious(Tokens::$emptyTokens, $closeParenthesisPointer - 1, 0, true); - $previousToCloseParenthesisToken = $tokens[$previousToCloseParenthesisPointer]; - if ( - $previousToCloseParenthesisPointer === $arrayToken['bracket_opener'] - || $previousToCloseParenthesisToken['code'] === T_COMMA - || $closeParenthesisToken['line'] === $previousToCloseParenthesisToken['line'] - ) { - return; - } - if (!$this->enableAfterHeredoc && in_array($previousToCloseParenthesisToken['code'], [T_END_HEREDOC, T_END_NOWDOC], true)) { - return; - } - $fix = $phpcsFile->addFixableError( - 'Multi-line arrays must have a trailing comma after the last element.', - $previousToCloseParenthesisPointer, - 'MissingTrailingComma' - ); - if (!$fix) { - return; - } - - $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->addContent($previousToCloseParenthesisPointer, ','); - $phpcsFile->fixer->endChangeset(); - } -} diff --git a/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/PHP/DisallowShortOpenTagSniff.php b/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/PHP/DisallowShortOpenTagSniff.php deleted file mode 100644 index eaf6548..0000000 --- a/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/PHP/DisallowShortOpenTagSniff.php +++ /dev/null @@ -1,62 +0,0 @@ -getTokens(); - $openTag = $tokens[$stackPtr]; - - if (trim($openTag['content']) === 'addError($error, $stackPtr, 'Found', $data); - } - } -} diff --git a/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/PHP/TypeCastingSniff.php b/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/PHP/TypeCastingSniff.php deleted file mode 100644 index 0ccae90..0000000 --- a/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/PHP/TypeCastingSniff.php +++ /dev/null @@ -1,86 +0,0 @@ -getTokens(); - - // Process !! casts - if ($tokens[$stackPtr]['code'] == T_BOOLEAN_NOT) { - $nextToken = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); - if (!$nextToken) { - return; - } - if ($tokens[$nextToken]['code'] != T_BOOLEAN_NOT) { - return; - } - $error = 'Usage of !! cast is not allowed. Please use (bool) to cast.'; - $phpcsFile->addError($error, $stackPtr, 'NotAllowed'); - - return; - } - - // Only allow short forms if both short and long forms are possible - $matching = [ - '(boolean)' => '(bool)', - '(integer)' => '(int)', - ]; - $content = $tokens[$stackPtr]['content']; - $key = strtolower($content); - if (isset($matching[$key])) { - $error = 'Please use ' . $matching[$key] . ' instead of ' . $content . '.'; - $phpcsFile->addError($error, $stackPtr, 'NotAllowed'); - - return; - } - if ($content !== $key) { - $error = 'Please use ' . $key . ' instead of ' . $content . '.'; - $phpcsFile->addError($error, $stackPtr, 'NotAllowed'); - - return; - } - } -} diff --git a/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/Strings/ConcatenationSpacingSniff.php b/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/Strings/ConcatenationSpacingSniff.php deleted file mode 100644 index 05b544d..0000000 --- a/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/Strings/ConcatenationSpacingSniff.php +++ /dev/null @@ -1,71 +0,0 @@ -getTokens(); - if ($tokens[($stackPtr - 1)]['code'] !== T_WHITESPACE) { - $message = 'Expected 1 space before ., but 0 found'; - $phpcsFile->addError($message, $stackPtr, 'MissingBefore'); - } else { - $content = str_replace("\r\n", "\n", $tokens[($stackPtr - 1)]['content']); - $spaces = strlen($content); - if ($spaces > 1) { - $message = 'Expected 1 space before ., but %d found'; - $data = [$spaces]; - $phpcsFile->addError($message, $stackPtr, 'TooManyBefore', $data); - } - } - - if ($tokens[($stackPtr + 1)]['code'] !== T_WHITESPACE) { - $message = 'Expected 1 space after ., but 0 found'; - $phpcsFile->addError($message, $stackPtr, 'MissingAfter'); - } else { - $content = str_replace("\r\n", "\n", $tokens[($stackPtr + 1)]['content']); - $spaces = strlen($content); - if ($spaces > 1) { - $message = 'Expected 1 space after ., but %d found'; - $data = [$spaces]; - $phpcsFile->addError($message, $stackPtr, 'TooManyAfter', $data); - } - } - } -} diff --git a/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/WhiteSpace/CommaSpacingSniff.php b/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/WhiteSpace/CommaSpacingSniff.php deleted file mode 100644 index 7f96cda..0000000 --- a/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/WhiteSpace/CommaSpacingSniff.php +++ /dev/null @@ -1,72 +0,0 @@ -getTokens(); - - $next = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); - - if ($tokens[$next]['code'] !== T_WHITESPACE && ($next !== $stackPtr + 2)) { - // Skip if immediate char is comma - if ($tokens[$next]['code'] === T_COMMA) { - return; - } - - // Last character in a line is ok. - if ($tokens[$next]['line'] === $tokens[$stackPtr]['line']) { - $error = 'Missing space after comma'; - $fix = $phpcsFile->addFixableError($error, $next, 'MissingSpaceAfterComma'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->addContent($stackPtr, ' '); - $phpcsFile->fixer->endChangeset(); - } - } - } - - $previous = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true); - - if ($tokens[$previous]['code'] !== T_WHITESPACE && ($previous !== $stackPtr - 1)) { - $error = 'Space before comma, expected none, though'; - $phpcsFile->addError($error, $next, 'SpaceBeforeComma'); - } - } -} diff --git a/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/WhiteSpace/EmptyLinesSniff.php b/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/WhiteSpace/EmptyLinesSniff.php deleted file mode 100644 index 667feed..0000000 --- a/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/WhiteSpace/EmptyLinesSniff.php +++ /dev/null @@ -1,62 +0,0 @@ -getTokens(); - // If the current and next two tokens are newlines - // We can remove the next token (the first newline) - if ( - $tokens[$stackPtr]['content'] === $phpcsFile->eolChar - && isset($tokens[$stackPtr + 1]) - && $tokens[$stackPtr + 1]['content'] === $phpcsFile->eolChar - && isset($tokens[$stackPtr + 2]) - && $tokens[$stackPtr + 2]['content'] === $phpcsFile->eolChar - ) { - $error = 'Found more than a single empty line between content'; - $fix = $phpcsFile->addFixableError($error, $stackPtr + 2, 'EmptyLines'); - if ($fix) { - $phpcsFile->fixer->replaceToken($stackPtr + 2, ''); - } - } - } -} diff --git a/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/WhiteSpace/FunctionCallSpacingSniff.php b/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/WhiteSpace/FunctionCallSpacingSniff.php deleted file mode 100644 index 0d89cf7..0000000 --- a/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/WhiteSpace/FunctionCallSpacingSniff.php +++ /dev/null @@ -1,68 +0,0 @@ -getTokens(); - - // Find the next non-empty token. - $openBracket = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); - - if ($tokens[$openBracket]['code'] !== T_OPEN_PARENTHESIS) { - // Not a function call. - return; - } - - // Look for funcName ( - if (($stackPtr + 1) !== $openBracket) { - $error = 'Space before opening parenthesis of function call not allowed'; - $phpcsFile->addError($error, $stackPtr, 'SpaceBeforeOpenBracket'); - } - } -} diff --git a/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/WhiteSpace/FunctionClosingBraceSpaceSniff.php b/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/WhiteSpace/FunctionClosingBraceSpaceSniff.php deleted file mode 100644 index 1a97f5d..0000000 --- a/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/WhiteSpace/FunctionClosingBraceSpaceSniff.php +++ /dev/null @@ -1,74 +0,0 @@ -getTokens(); - - if (isset($tokens[$stackPtr]['scope_closer']) === false) { - // Probably an interface method. - return; - } - - $closeBrace = $tokens[$stackPtr]['scope_closer']; - $prevContent = $phpcsFile->findPrevious(T_WHITESPACE, ($closeBrace - 1), null, true); - - $braceLine = $tokens[$closeBrace]['line']; - $prevLine = $tokens[$prevContent]['line']; - - $found = ($braceLine - $prevLine - 1); - if ($phpcsFile->hasCondition($stackPtr, T_FUNCTION) === true || isset($tokens[$stackPtr]['nested_parenthesis']) === true) { - // Nested function. - if ($found < 0) { - $error = 'Closing brace of nested function must be on a new line'; - $phpcsFile->addError($error, $closeBrace, 'ContentBeforeClose'); - } elseif ($found > 0) { - $error = 'Expected 0 blank lines before closing brace of nested function; %s found'; - $data = [$found]; - $phpcsFile->addError($error, $closeBrace, 'SpacingBeforeNestedClose', $data); - } - } else { - if ($found !== 0) { - $error = 'Expected 0 blank lines before closing function brace; %s found'; - $data = [$found]; - $phpcsFile->addError($error, $closeBrace, 'SpacingBeforeClose', $data); - } - } - } -} diff --git a/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/WhiteSpace/FunctionOpeningBraceSpaceSniff.php b/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/WhiteSpace/FunctionOpeningBraceSpaceSniff.php deleted file mode 100644 index d0d54c0..0000000 --- a/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/WhiteSpace/FunctionOpeningBraceSpaceSniff.php +++ /dev/null @@ -1,68 +0,0 @@ -getTokens(); - - if (isset($tokens[$stackPtr]['scope_opener']) === false) { - // Probably an interface method. - return; - } - - $openBrace = $tokens[$stackPtr]['scope_opener']; - $nextContent = $phpcsFile->findNext(T_WHITESPACE, ($openBrace + 1), null, true); - - if ($nextContent === $tokens[$stackPtr]['scope_closer']) { - // The next bit of content is the closing brace, so this - // is an empty function and should have a blank line - // between the opening and closing braces. - return; - } - - $braceLine = $tokens[$openBrace]['line']; - $nextLine = $tokens[$nextContent]['line']; - - $found = ($nextLine - $braceLine - 1); - if ($found > 0) { - $error = 'Expected 0 blank lines after opening function brace; %s found'; - $data = [$found]; - $phpcsFile->addError($error, $openBrace, 'SpacingAfter', $data); - } - } -} diff --git a/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/WhiteSpace/FunctionSpacingSniff.php b/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/WhiteSpace/FunctionSpacingSniff.php deleted file mode 100644 index 75498ab..0000000 --- a/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/WhiteSpace/FunctionSpacingSniff.php +++ /dev/null @@ -1,154 +0,0 @@ -getTokens(); - - $level = $tokens[$stackPointer]['level']; - if ($level < 1) { - return; - } - - $openingBraceIndex = $phpCsFile->findNext(T_OPEN_CURLY_BRACKET, $stackPointer + 1); - // Fix interface methods - if (!$openingBraceIndex) { - $openingParenthesisIndex = $phpCsFile->findNext(T_OPEN_PARENTHESIS, $stackPointer + 1); - $closingParenthesisIndex = $tokens[$openingParenthesisIndex]['parenthesis_closer']; - - $semicolonIndex = $phpCsFile->findNext(T_SEMICOLON, $closingParenthesisIndex + 1); - - $nextContentIndex = $phpCsFile->findNext(T_WHITESPACE, $semicolonIndex + 1, null, true); - - // Do not mess with the end of the class - if ($tokens[$nextContentIndex]['type'] === 'T_CLOSE_CURLY_BRACKET') { - return; - } - - if ($tokens[$nextContentIndex]['line'] - $tokens[$semicolonIndex]['line'] <= 1) { - $fix = $phpCsFile->addFixableError('Every function/method needs a newline afterwards', $closingParenthesisIndex, 'Abstract'); - if ($fix) { - $phpCsFile->fixer->addNewline($semicolonIndex); - } - } - - return; - } - - $closingBraceIndex = $tokens[$openingBraceIndex]['scope_closer']; - - // Ignore closures - $nextIndex = $phpCsFile->findNext(Tokens::$emptyTokens, $closingBraceIndex + 1, null, true); - if (in_array($tokens[$nextIndex]['content'], [';', ',', ')'])) { - return; - } - - $nextContentIndex = $phpCsFile->findNext(T_WHITESPACE, $closingBraceIndex + 1, null, true); - - // Do not mess with the end of the class - if ($tokens[$nextContentIndex]['type'] === 'T_CLOSE_CURLY_BRACKET') { - return; - } - - $this->assertNewLineAtTheEnd($phpCsFile, $closingBraceIndex, $nextContentIndex); - $this->assertNewLineAtTheBeginning($phpCsFile, $stackPointer); - } - - /** - * @param \PHP_CodeSniffer\Files\File $phpCsFile File - * @param int $closingBraceIndex Index - * @param int|null $nextContentIndex Index - * - * @return void - */ - protected function assertNewLineAtTheEnd(File $phpCsFile, $closingBraceIndex, $nextContentIndex) - { - $tokens = $phpCsFile->getTokens(); - - if (!$nextContentIndex || $tokens[$nextContentIndex]['line'] - $tokens[$closingBraceIndex]['line'] <= 1) { - $fix = $phpCsFile->addFixableError('Every function/method needs a newline afterwards', $closingBraceIndex, 'Concrete'); - if ($fix) { - $phpCsFile->fixer->addNewline($closingBraceIndex); - } - } - } - - /** - * Asserts newline at the beginning, including the doc block. - * - * @param \PHP_CodeSniffer\Files\File $phpCsFile File - * @param int $stackPointer Stack pointer - * - * @return void - */ - protected function assertNewLineAtTheBeginning(File $phpCsFile, $stackPointer) - { - $tokens = $phpCsFile->getTokens(); - - $line = $tokens[$stackPointer]['line']; - $firstTokenInLineIndex = $stackPointer; - while ($tokens[$firstTokenInLineIndex - 1]['line'] === $line) { - $firstTokenInLineIndex--; - } - - $prevContentIndex = $phpCsFile->findPrevious(T_WHITESPACE, $firstTokenInLineIndex - 1, null, true); - if ($tokens[$prevContentIndex]['type'] === 'T_DOC_COMMENT_CLOSE_TAG') { - $firstTokenInLineIndex = $tokens[$prevContentIndex]['comment_opener']; - while ($tokens[$firstTokenInLineIndex - 1]['line'] === $line) { - $firstTokenInLineIndex--; - } - } - - $prevContentIndex = $phpCsFile->findPrevious(T_WHITESPACE, $firstTokenInLineIndex - 1, null, true); - - // Do not mess with the start of the class - if ($tokens[$prevContentIndex]['type'] === 'T_OPEN_CURLY_BRACKET') { - return; - } - - if ($tokens[$prevContentIndex]['line'] < $tokens[$firstTokenInLineIndex]['line'] - 1) { - return; - } - - $fix = $phpCsFile->addFixableError('Every function/method needs a newline before', $firstTokenInLineIndex, 'Concrete'); - if ($fix) { - $phpCsFile->fixer->addNewline($prevContentIndex); - } - } -} diff --git a/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/WhiteSpace/ObjectOperatorSpacingSniff.php b/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/WhiteSpace/ObjectOperatorSpacingSniff.php deleted file mode 100644 index c14a163..0000000 --- a/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/WhiteSpace/ObjectOperatorSpacingSniff.php +++ /dev/null @@ -1,50 +0,0 @@ -getTokens(); - - $nextType = $tokens[($stackPtr + 1)]['code']; - if (in_array($nextType, Tokens::$emptyTokens) === true) { - $error = 'Space found after object operator'; - $phpcsFile->addError($error, $stackPtr, 'After'); - } - } -} diff --git a/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/WhiteSpace/OperatorSpacingSniff.php b/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/WhiteSpace/OperatorSpacingSniff.php deleted file mode 100644 index 8a332c7..0000000 --- a/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/WhiteSpace/OperatorSpacingSniff.php +++ /dev/null @@ -1,208 +0,0 @@ -getTokens(); - - // Skip default values in function declarations. - // and declare statements - if ( - $tokens[$stackPtr]['code'] === T_EQUAL - || $tokens[$stackPtr]['code'] === T_MINUS - ) { - if (isset($tokens[$stackPtr]['nested_parenthesis']) === true) { - $parenthesis = array_keys($tokens[$stackPtr]['nested_parenthesis']); - $bracket = array_pop($parenthesis); - if (isset($tokens[$bracket]['parenthesis_owner']) === true) { - $function = $tokens[$bracket]['parenthesis_owner']; - if ( - $tokens[$function]['code'] === T_FUNCTION || - $tokens[$function]['code'] === T_DECLARE - ) { - return; - } - } - } - } - - if ($tokens[$stackPtr]['code'] === T_EQUAL) { - // Skip for '=&' case. - if (isset($tokens[($stackPtr + 1)]) === true && $tokens[($stackPtr + 1)]['code'] === T_BITWISE_AND) { - return; - } - } - - if ($tokens[$stackPtr]['code'] === T_BITWISE_AND) { - // If its not a reference, then we expect one space either side of the - // bitwise operator. - if (!$phpcsFile->isReference($stackPtr) && !$this->_isVariable($stackPtr, $tokens, $phpcsFile)) { - // Check there is one space before the & operator. - if ($tokens[($stackPtr - 1)]['code'] !== T_WHITESPACE) { - $error = 'Expected 1 space before "&" operator; 0 found'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NoSpaceBeforeAmp'); - if ($fix === true) { - $phpcsFile->fixer->addContentBefore($stackPtr, ' '); - } - } - - // Check there is one space after the & operator. - if ($tokens[($stackPtr + 1)]['code'] !== T_WHITESPACE) { - $error = 'Expected 1 space after "&" operator; 0 found'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NoSpaceAfterAmp'); - if ($fix === true) { - $phpcsFile->fixer->addContent($stackPtr, ' '); - } - } - } - } else { - if ($tokens[$stackPtr]['code'] === T_MINUS) { - // Skip declaration of negative value in new array format; eg. $arr = [-1]. - if ($tokens[($stackPtr - 1)]['code'] === T_OPEN_SHORT_ARRAY) { - return; - } - - // Check minus spacing, but make sure we aren't just assigning - // a minus value or returning one. - $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true); - if ($tokens[$prev]['code'] === T_RETURN) { - // Just returning a negative value; eg. return -1. - return; - } - - if (in_array($tokens[$prev]['code'], Tokens::$operators) === true) { - // Just trying to operate on a negative value; eg. ($var * -1). - return; - } - - if (in_array($tokens[$prev]['code'], Tokens::$comparisonTokens) === true) { - // Just trying to compare a negative value; eg. ($var === -1). - return; - } - - // A list of tokens that indicate that the token is not - // part of an arithmetic operation. - $invalidTokens = [ - T_COMMA, - T_OPEN_PARENTHESIS, - T_OPEN_SQUARE_BRACKET, - T_DOUBLE_ARROW, - T_COLON, - T_INLINE_THEN, - T_INLINE_ELSE, - T_CASE, - ]; - - if (in_array($tokens[$prev]['code'], $invalidTokens) === true) { - // Just trying to use a negative value; eg. myFunction($var, -2). - return; - } - if (in_array($tokens[$prev]['code'], Tokens::$assignmentTokens) === true) { - // Just trying to assign a negative value; eg. ($var = -1). - return; - } - } - - $operator = $tokens[$stackPtr]['content']; - - if ($tokens[($stackPtr - 1)]['code'] !== T_WHITESPACE) { - $error = "Expected 1 space before \"$operator\"; 0 found"; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NoSpaceBefore'); - if ($fix === true) { - $phpcsFile->fixer->addContentBefore($stackPtr, ' '); - } - } - - if ($tokens[($stackPtr + 1)]['code'] !== T_WHITESPACE) { - $error = "Expected 1 space after \"$operator\"; 0 found"; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NoSpaceAfter'); - if ($fix === true) { - $phpcsFile->fixer->addContent($stackPtr, ' '); - } - } - } - } - - /** - * Check if the current token is inside an array. - * - * @param int $stackPtr The current token offset. - * @param array $tokens The current token list. - * @param \PHP_CodeSniffer\Files\File $phpcsFile The current file being checked. - * @return bool - */ - protected function _isVariable($stackPtr, $tokens, $phpcsFile) - { - $tokenAfter = $phpcsFile->findNext( - Tokens::$emptyTokens, - ($stackPtr + 1), - null, - true - ); - $tokenBefore = $phpcsFile->findNext( - Tokens::$emptyTokens, - ($stackPtr - 1), - null, - true - ); - - return ($tokens[$tokenAfter]['code'] === T_VARIABLE && - ( - $tokens[$tokenBefore]['code'] === T_OPEN_PARENTHESIS || - $tokens[$tokenBefore]['code'] === T_COMMA || - $tokens[$tokenBefore]['code'] === T_OPEN_SHORT_ARRAY - ) - ); - } -} diff --git a/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/WhiteSpace/TabAndSpaceSniff.php b/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/WhiteSpace/TabAndSpaceSniff.php deleted file mode 100644 index e9d14cb..0000000 --- a/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/WhiteSpace/TabAndSpaceSniff.php +++ /dev/null @@ -1,75 +0,0 @@ -getTokens(); - - $line = $tokens[$stackPtr]['line']; - if ($stackPtr > 0 && $tokens[($stackPtr - 1)]['line'] !== $line) { - return; - } - - if (strpos($tokens[$stackPtr]['content'], ' ') !== false) { - $error = 'Double space found'; - $phpcsFile->addError($error, $stackPtr, 'DoubleSpace'); - } - if (strpos($tokens[$stackPtr]['content'], " \t") !== false) { - $error = 'Space and tab found'; - $phpcsFile->addError($error, $stackPtr, 'SpaceAndTab'); - } - if (strpos($tokens[$stackPtr]['content'], "\t ") !== false) { - $error = 'Tab and space found'; - $phpcsFile->addError($error, $stackPtr, 'TabAndSpace'); - } - } -} diff --git a/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/Commenting/DocBlockAlignmentUnitTest.1.inc b/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/Commenting/DocBlockAlignmentUnitTest.1.inc deleted file mode 100644 index 38bf963..0000000 --- a/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/Commenting/DocBlockAlignmentUnitTest.1.inc +++ /dev/null @@ -1,34 +0,0 @@ - 1, - 7 => 1, - 14 => 1, - 21 => 1, - 30 => 1, - ]; - - default: - return []; - } - } - - /** - * {@inheritDoc} - */ - public function getWarningList() - { - return []; - } -} diff --git a/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/Commenting/FunctionCommentUnitTest.inc b/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/Commenting/FunctionCommentUnitTest.inc deleted file mode 100644 index 4225b82..0000000 --- a/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/Commenting/FunctionCommentUnitTest.inc +++ /dev/null @@ -1,251 +0,0 @@ - 1, - 13 => 1, - 23 => 1, - 24 => 1, - 34 => 1, - 35 => 1, - 90 => 1, - 97 => 1, - 104 => 1, - 112 => 1, - 222 => 1, - 231 => 1, - ]; - } - - /** - * {@inheritDoc} - */ - public function getWarningList() - { - return [ - 14 => 1, - 31 => 2, - 45 => 1, - 140 => 1, - 145 => 1, - 155 => 1, - 165 => 1, - 174 => 1, - 182 => 1, - 190 => 1, - 197 => 1, - 198 => 1, - 205 => 1, - 206 => 1, - 215 => 1, - 221 => 1, - ]; - } -} diff --git a/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/ControlStructures/ControlStructuresUnitTest.inc b/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/ControlStructures/ControlStructuresUnitTest.inc deleted file mode 100644 index b514577..0000000 --- a/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/ControlStructures/ControlStructuresUnitTest.inc +++ /dev/null @@ -1,14 +0,0 @@ - 100) { - echo 'i > 100'; -} - -if($abc == true) - echo 'hello'; diff --git a/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/ControlStructures/ControlStructuresUnitTest.php b/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/ControlStructures/ControlStructuresUnitTest.php deleted file mode 100644 index 1e1cc02..0000000 --- a/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/ControlStructures/ControlStructuresUnitTest.php +++ /dev/null @@ -1,26 +0,0 @@ - 1, - ]; - } - - /** - * {@inheritDoc} - */ - public function getWarningList() - { - return []; - } -} diff --git a/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/ControlStructures/ElseIfDeclarationUnitTest.inc b/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/ControlStructures/ElseIfDeclarationUnitTest.inc deleted file mode 100644 index aa97c9e..0000000 --- a/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/ControlStructures/ElseIfDeclarationUnitTest.inc +++ /dev/null @@ -1,6 +0,0 @@ - 1, - ]; - } - - /** - * {@inheritDoc} - */ - public function getWarningList() - { - return []; - } -} diff --git a/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/ControlStructures/WhileStructuresUnitTest.inc b/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/ControlStructures/WhileStructuresUnitTest.inc deleted file mode 100644 index 79b57da..0000000 --- a/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/ControlStructures/WhileStructuresUnitTest.inc +++ /dev/null @@ -1,16 +0,0 @@ - 1, - 5 => 1, - ]; - } - - /** - * {@inheritDoc} - */ - public function getWarningList() - { - return []; - } -} diff --git a/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/Formatting/BlankLineBeforeReturnUnitTest.inc b/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/Formatting/BlankLineBeforeReturnUnitTest.inc deleted file mode 100644 index c5c3725..0000000 --- a/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/Formatting/BlankLineBeforeReturnUnitTest.inc +++ /dev/null @@ -1,104 +0,0 @@ - 'bar' -]; - -function invalidFunctionReturnOne() -{ - echo ""; - return null; -} - -function invalidFunctionReturnOne() -{ - if(true) { - echo ""; - } - return null; -} - -/** - * [validFunctionReturnOne description] - * - * @return null - */ -function validFunctionReturnOne() -{ - return null; -} - -/** - * [validFunctionReturnTwo description] - * - * @return null|bool - */ -function validFunctionReturnTwo() -{ - if ($a) { - return true; - } - - return null; -} - -/** - * [validFunctionReturnThree description] - * - * @return null - */ -function validFunctionReturnThree() -{ - echo ""; - - return null; -} - -/** - * [validFunctionReturnFour description] - * - * @return null - */ -function validFunctionReturnFour() -{ - // comment - return null; -} - -/** - * [validFunctionReturnFive description] - * - * @return null - */ -function validFunctionReturnFive() -{ - /** - * multi-line - */ - return null; -} - -/** - * [validFunctionReturnSix description] - * - * @return null|bool - */ -function validFunctionReturnSix() -{ - switch ($condition) { - case 'foo': - return true; - default: - return false; - } -} - -/** - * [validFunctionReturnSeven description] - * - * @return null - */ -function validFunctionReturnSeven() -{ - /** @var Foo $foo */ - return null; -} diff --git a/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/Formatting/BlankLineBeforeReturnUnitTest.inc.fixed b/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/Formatting/BlankLineBeforeReturnUnitTest.inc.fixed deleted file mode 100644 index cb38504..0000000 --- a/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/Formatting/BlankLineBeforeReturnUnitTest.inc.fixed +++ /dev/null @@ -1,106 +0,0 @@ - 'bar' -]; - -function invalidFunctionReturnOne() -{ - echo ""; - - return null; -} - -function invalidFunctionReturnOne() -{ - if(true) { - echo ""; - } - - return null; -} - -/** - * [validFunctionReturnOne description] - * - * @return null - */ -function validFunctionReturnOne() -{ - return null; -} - -/** - * [validFunctionReturnTwo description] - * - * @return null|bool - */ -function validFunctionReturnTwo() -{ - if ($a) { - return true; - } - - return null; -} - -/** - * [validFunctionReturnThree description] - * - * @return null - */ -function validFunctionReturnThree() -{ - echo ""; - - return null; -} - -/** - * [validFunctionReturnFour description] - * - * @return null - */ -function validFunctionReturnFour() -{ - // comment - return null; -} - -/** - * [validFunctionReturnFive description] - * - * @return null - */ -function validFunctionReturnFive() -{ - /** - * multi-line - */ - return null; -} - -/** - * [validFunctionReturnSix description] - * - * @return null|bool - */ -function validFunctionReturnSix() -{ - switch ($condition) { - case 'foo': - return true; - default: - return false; - } -} - -/** - * [validFunctionReturnSeven description] - * - * @return null - */ -function validFunctionReturnSeven() -{ - /** @var Foo $foo */ - return null; -} diff --git a/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/Formatting/BlankLineBeforeReturnUnitTest.php b/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/Formatting/BlankLineBeforeReturnUnitTest.php deleted file mode 100644 index 42a87ed..0000000 --- a/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/Formatting/BlankLineBeforeReturnUnitTest.php +++ /dev/null @@ -1,27 +0,0 @@ - 1, - 17 => 1, - ]; - } - - /** - * {@inheritDoc} - */ - public function getWarningList() - { - return []; - } -} diff --git a/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/Formatting/UseInAlphabeticalOrderUnitTest.1.inc b/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/Formatting/UseInAlphabeticalOrderUnitTest.1.inc deleted file mode 100644 index 99780ef..0000000 --- a/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/Formatting/UseInAlphabeticalOrderUnitTest.1.inc +++ /dev/null @@ -1,10 +0,0 @@ - 1, - 4 => 1, - 8 => 1, - 9 => 1, - ]; - - default: - return []; - } - } - - /** - * {@inheritDoc} - */ - public function getWarningList() - { - return []; - } -} diff --git a/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/Functions/ClosureDeclarationUnitTest.inc b/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/Functions/ClosureDeclarationUnitTest.inc deleted file mode 100644 index 013c2f0..0000000 --- a/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/Functions/ClosureDeclarationUnitTest.inc +++ /dev/null @@ -1,36 +0,0 @@ - 1, - 30 => 1, - ]; - } - - /** - * {@inheritDoc} - */ - public function getWarningList() - { - return []; - } -} diff --git a/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/Functions/FunctionDeclarationArgumentSpacingUnitTest.inc b/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/Functions/FunctionDeclarationArgumentSpacingUnitTest.inc deleted file mode 100644 index 82a3e7a..0000000 --- a/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/Functions/FunctionDeclarationArgumentSpacingUnitTest.inc +++ /dev/null @@ -1,21 +0,0 @@ - 1, - 4 => 2, - 5 => 2, - 6 => 2, - 7 => 2, - 8 => 2, - 9 => 9, - 10 => 6, - 11 => 6, - 12 => 4, - 13 => 4, - 14 => 2, - ]; - } - - /** - * {@inheritDoc} - */ - public function getWarningList() - { - return []; - } -} diff --git a/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/NamingConventions/ValidFunctionNameUnitTest.inc b/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/NamingConventions/ValidFunctionNameUnitTest.inc deleted file mode 100644 index e4bc565..0000000 --- a/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/NamingConventions/ValidFunctionNameUnitTest.inc +++ /dev/null @@ -1,177 +0,0 @@ -passingPublic = 'changed'; - $this->underscored = 'has value now'; - $this->doubleUnderscore = 'not recommended'; - } - - public static function setStatics() - { - self::$publicStatic = true; - self::$protectedStatic = true; - self::$privateStatic = true; - } - - protected function _someFunc() - { - // code here - } - - protected function noUnderscorePrefix() - { - // code here - $closure = function () { - // code here - }; - } - - public function __call($name, $arguments) - { - } - public function __construct() - { - } - public function __clone() - { - } - public function __debugInfo() - { - } - public function __destruct() - { - } - public function __get($name) - { - } - public function __invoke() - { - } - public function __isset($name) - { - } - public function __set($name, $value) - { - } - public function __sleep() - { - } - public function __toString() - { - return ''; - } - public function __unset($name) - { - } - public function __wakeup() - { - } -} - -interface FunctionNamesInterface -{ - public function _forbidden(); - - public function setVariables(); - - public static function setStatics(); -} - -trait FunctionNamesTrait -{ - public function _forbidden() - { - echo "I emit an error"; - } - - private function notDiscouraged() - { - echo "I don't emit a warning anymore"; - } - - public function setVariables() - { - $this->passingPublic = 'changed'; - $this->underscored = 'has value now'; - $this->doubleUnderscore = 'not recommended'; - } - - public static function setStatics() - { - self::$publicStatic = true; - self::$protectedStatic = true; - self::$privateStatic = true; - } - - protected function _someFunc() - { - // code here - } - - protected function noUnderscorePrefix() - { - // code here - } - - function _noScopeSpecified() - { - echo 'handled by an other Sniff'; - } - - public function __call($name, $arguments) - { - } - public function __construct() - { - } - public function __clone() - { - } - public function __debugInfo() - { - } - public function __destruct() - { - } - public function __get($name) - { - } - public function __invoke() - { - } - public function __isset($name) - { - } - public function __set($name, $value) - { - } - public function __sleep() - { - } - public function __toString() - { - return ''; - } - public function __unset($name) - { - } - public function __wakeup() - { - } -} - -public function __passingOutside() {} diff --git a/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/NamingConventions/ValidFunctionNameUnitTest.php b/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/NamingConventions/ValidFunctionNameUnitTest.php deleted file mode 100644 index 5312675..0000000 --- a/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/NamingConventions/ValidFunctionNameUnitTest.php +++ /dev/null @@ -1,28 +0,0 @@ - 1, - 87 => 1, - 96 => 1, - ]; - } - - /** - * {@inheritDoc} - */ - public function getWarningList() - { - return []; - } -} diff --git a/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/NamingConventions/ValidTraitNameUnitTest.inc b/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/NamingConventions/ValidTraitNameUnitTest.inc deleted file mode 100644 index 57a83ea..0000000 --- a/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/NamingConventions/ValidTraitNameUnitTest.inc +++ /dev/null @@ -1,6 +0,0 @@ - 1, - ]; - } - - /** - * {@inheritDoc} - */ - public function getWarningList() - { - return []; - } -} diff --git a/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/PHP/DisallowShortOpenTagUnitTest.inc b/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/PHP/DisallowShortOpenTagUnitTest.inc deleted file mode 100644 index 97995d3..0000000 --- a/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/PHP/DisallowShortOpenTagUnitTest.inc +++ /dev/null @@ -1,9 +0,0 @@ - - - 1, - ]; - } - - /** - * {@inheritDoc} - */ - public function getWarningList() - { - return []; - } -} diff --git a/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/PHP/TypeCastingUnitTest.inc b/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/PHP/TypeCastingUnitTest.inc deleted file mode 100644 index d1c47b3..0000000 --- a/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/PHP/TypeCastingUnitTest.inc +++ /dev/null @@ -1,11 +0,0 @@ - 1, - 4 => 1, - 5 => 1, - 6 => 1, - 7 => 1, - ]; - } - - /** - * {@inheritDoc} - */ - public function getWarningList() - { - return []; - } -} diff --git a/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/Strings/ConcatenationSpacingUnitTest.inc b/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/Strings/ConcatenationSpacingUnitTest.inc deleted file mode 100644 index 44cc716..0000000 --- a/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/Strings/ConcatenationSpacingUnitTest.inc +++ /dev/null @@ -1,10 +0,0 @@ - 1, - 5 => 1, - 6 => 2, - 7 => 1, - 8 => 1, - ]; - } - - /** - * {@inheritDoc} - */ - public function getWarningList() - { - return []; - } -} diff --git a/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/WhiteSpace/CommaSpacingUnitTest.inc b/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/WhiteSpace/CommaSpacingUnitTest.inc deleted file mode 100644 index a4c9adb..0000000 --- a/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/WhiteSpace/CommaSpacingUnitTest.inc +++ /dev/null @@ -1,5 +0,0 @@ - 1, - 3 => 1, - ]; - } - - /** - * {@inheritDoc} - */ - public function getWarningList() - { - return []; - } -} diff --git a/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/WhiteSpace/EmptyLinesUnitTest.inc b/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/WhiteSpace/EmptyLinesUnitTest.inc deleted file mode 100644 index 7fb201f..0000000 --- a/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/WhiteSpace/EmptyLinesUnitTest.inc +++ /dev/null @@ -1,49 +0,0 @@ - 1, - 21 => 1, - 42 => 1, - 43 => 1, - 47 => 1, - 48 => 1, - 49 => 1, - ]; - } - - /** - * {@inheritDoc} - */ - public function getWarningList() - { - return []; - } -} diff --git a/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/WhiteSpace/FunctionCallSpacingUnitTest.inc b/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/WhiteSpace/FunctionCallSpacingUnitTest.inc deleted file mode 100644 index 57070a3..0000000 --- a/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/WhiteSpace/FunctionCallSpacingUnitTest.inc +++ /dev/null @@ -1,8 +0,0 @@ -something ('testing'); -fail_whale (); diff --git a/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/WhiteSpace/FunctionCallSpacingUnitTest.php b/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/WhiteSpace/FunctionCallSpacingUnitTest.php deleted file mode 100644 index d98f76d..0000000 --- a/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/WhiteSpace/FunctionCallSpacingUnitTest.php +++ /dev/null @@ -1,32 +0,0 @@ - 1, - 3 => 1, - 4 => 1, - 5 => 1, - 6 => 1, - 7 => 1, - 8 => 1, - ]; - } - - /** - * {@inheritDoc} - */ - public function getWarningList() - { - return []; - } -} diff --git a/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/WhiteSpace/FunctionClosingBraceSpaceUnitTest.inc b/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/WhiteSpace/FunctionClosingBraceSpaceUnitTest.inc deleted file mode 100644 index fc76fc8..0000000 --- a/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/WhiteSpace/FunctionClosingBraceSpaceUnitTest.inc +++ /dev/null @@ -1,31 +0,0 @@ - 1, - 6 => 1, - 10 => 1, - 25 => 1, - 28 => 1, - 30 => 1, - ]; - } - - /** - * {@inheritDoc} - */ - public function getWarningList() - { - return []; - } -} diff --git a/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/WhiteSpace/FunctionOpeningBraceSpaceUnitTest.inc b/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/WhiteSpace/FunctionOpeningBraceSpaceUnitTest.inc deleted file mode 100644 index 6e81d9f..0000000 --- a/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/WhiteSpace/FunctionOpeningBraceSpaceUnitTest.inc +++ /dev/null @@ -1,10 +0,0 @@ - 1, - ]; - } - - /** - * {@inheritDoc} - */ - public function getWarningList() - { - return []; - } -} diff --git a/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/WhiteSpace/ObjectOperatorSpacingUnitTest.inc b/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/WhiteSpace/ObjectOperatorSpacingUnitTest.inc deleted file mode 100644 index 0dc8f6a..0000000 --- a/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/WhiteSpace/ObjectOperatorSpacingUnitTest.inc +++ /dev/null @@ -1,4 +0,0 @@ - failling() ; -$test->passing() ; diff --git a/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/WhiteSpace/ObjectOperatorSpacingUnitTest.php b/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/WhiteSpace/ObjectOperatorSpacingUnitTest.php deleted file mode 100644 index 513bbbc..0000000 --- a/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/WhiteSpace/ObjectOperatorSpacingUnitTest.php +++ /dev/null @@ -1,26 +0,0 @@ - 1, - ]; - } - - /** - * {@inheritDoc} - */ - public function getWarningList() - { - return []; - } -} diff --git a/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/WhiteSpace/OperatorSpacingUnitTest.inc b/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/WhiteSpace/OperatorSpacingUnitTest.inc deleted file mode 100644 index d04d62a..0000000 --- a/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/WhiteSpace/OperatorSpacingUnitTest.inc +++ /dev/null @@ -1,34 +0,0 @@ - 1, - 4 => 1, - 5 => 2, - 6 => 1, - 7 => 1, - 8 => 2, - ]; - } - - /** - * {@inheritDoc} - */ - public function getWarningList() - { - return []; - } -} diff --git a/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/WhiteSpace/OperatorSpacingunitTest.inc.fixed b/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/WhiteSpace/OperatorSpacingunitTest.inc.fixed deleted file mode 100644 index 26c5612..0000000 --- a/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/WhiteSpace/OperatorSpacingunitTest.inc.fixed +++ /dev/null @@ -1,34 +0,0 @@ - 1, - 3 => 1, - ]; - } - - /** - * {@inheritDoc} - */ - public function getWarningList() - { - return []; - } -} diff --git a/vendor/cakephp/cakephp-codesniffer/CakePHP/ruleset.xml b/vendor/cakephp/cakephp-codesniffer/CakePHP/ruleset.xml deleted file mode 100644 index 02573fc..0000000 --- a/vendor/cakephp/cakephp-codesniffer/CakePHP/ruleset.xml +++ /dev/null @@ -1,181 +0,0 @@ - - - CakePHP coding standard - - \.git - */Config/*.ini.php - /*/tmp/ - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - 0 - - - 0 - - - - - 0 - - - 0 - - - 0 - - - - - 0 - - - - - - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */config/* - */tests/* - - - */tests/* - - - */tests/* - - - */CakePHP/* - */tests/* - - - */tests/* - - - */tests/* - - - */src/* - */tests/* - - - */src/* - */tests/* - - - */src/* - */tests/* - - - - diff --git a/vendor/cakephp/cakephp-codesniffer/LICENSE.txt b/vendor/cakephp/cakephp-codesniffer/LICENSE.txt deleted file mode 100644 index 0a0a98c..0000000 --- a/vendor/cakephp/cakephp-codesniffer/LICENSE.txt +++ /dev/null @@ -1,28 +0,0 @@ -The MIT License - -CakePHP(tm) : The Rapid Development PHP Framework (http://cakephp.org) -Copyright (c) 2005-present, Cake Software Foundation, Inc. - -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. - -Cake Software Foundation, Inc. -1785 E. Sahara Avenue, -Suite 490-204 -Las Vegas, Nevada 89104, -United States of America. diff --git a/vendor/cakephp/cakephp-codesniffer/README.md b/vendor/cakephp/cakephp-codesniffer/README.md deleted file mode 100644 index 5ef1738..0000000 --- a/vendor/cakephp/cakephp-codesniffer/README.md +++ /dev/null @@ -1,80 +0,0 @@ -# CakePHP Code Sniffer - -[![Build Status](https://img.shields.io/travis/cakephp/cakephp-codesniffer/master.svg?style=flat-square)](https://travis-ci.org/cakephp/cakephp-codesniffer) -[![Coverage Status](https://img.shields.io/codecov/c/github/cakephp/cakephp-codesniffer.svg?style=flat-square)](https://codecov.io/github/cakephp/cakephp-codesniffer) -[![Total Downloads](https://img.shields.io/packagist/dt/cakephp/cakephp-codesniffer.svg?style=flat-square)](https://packagist.org/packages/cakephp/cakephp-codesniffer) -[![Latest Stable Version](https://img.shields.io/packagist/v/cakephp/cakephp-codesniffer.svg?style=flat-square)](https://packagist.org/packages/cakephp/cakephp-codesniffer) - -This code works with [phpcs](http://pear.php.net/manual/en/package.php.php-codesniffer.php) -and checks code against the coding standards used in CakePHP. - -:warning: The `master` branch contains codesniffer rules that are based on the -PSR2 standard. If you want to check against the historical CakePHP coding -standard use any of the `1.x` releases. - -## Which version should I use? - -| Sniffer version | CakePHP version | PHP min | -| -------- | ------- | ------- | -| 1.x | 2.x | PHP 5.4 | -| 2.x | 3.x | PHP 5.5 | -| 3.x | 3.x | PHP 5.6 | -| 4.x | 4.x | PHP 7.1 | - -## Installation - -You should install this codesniffer with composer: - - composer require --dev "cakephp/cakephp-codesniffer" - vendor/bin/phpcs --config-set installed_paths /path/to/your/app/vendor/cakephp/cakephp-codesniffer - -The second command lets `phpcs` know where to find your new sniffs. Ensure that -you do not overwrite any existing `installed_paths` value. - -## Usage - -:warning: Warning when these sniffs are installed with composer, ensure that -you have configured the CodeSniffer `installed_paths` setting. - -Depending on how you installed the code sniffer changes how you run it. If you have -installed phpcs, and this package with PEAR, you can do the following: - - vendor/bin/phpcs --colors -p -s --standard=CakePHP /path/to/code - -You can also copy the `phpcs.xml.dist` file to your project's root folder as `phpcs.xml`. -This file will import the CakePHP Coding Standard. From there you can edit it to -include/exclude as needed. With this file in place, you can run: - - vendor/bin/phpcs --colors -p -s /path/to/code - -If you are using Composer to manage your CakePHP project, you can also add the below to your composer.json file: - -```json -{ - "scripts": { - "cs-check": "vendor/bin/phpcs --colors -p -s --extensions=ctp,php ./src ./tests" - } -} -``` - -## Running Tests - -You can run tests with composer. Because of how PHPCS test suites work, there is -additional configuration state in `phpcs` that is required. - -```bash -composer test -``` - -Once this has been done once, you can use `phpunit --filter CakePHP` to run the -tests for the rules in this repository. - -## Contributing - -If you'd like to contribute to the Code Sniffer, you can fork the project add -features and send pull requests. - -## Releasing CakePHP Code Sniffer - -* Create a signed tag -* Write the changelog in the tag commit diff --git a/vendor/cakephp/cakephp-codesniffer/composer.json b/vendor/cakephp/cakephp-codesniffer/composer.json deleted file mode 100644 index 551c0c6..0000000 --- a/vendor/cakephp/cakephp-codesniffer/composer.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "name": "cakephp/cakephp-codesniffer", - "description": "CakePHP CodeSniffer Standards", - "type": "phpcodesniffer-standard", - "keywords": ["framework", "codesniffer"], - "homepage": "https://cakephp.org", - "license": "MIT", - "authors": [ - { - "name": "CakePHP Community", - "homepage": "https://github.com/cakephp/cakephp-codesniffer/graphs/contributors" - } - ], - "support": { - "issues": "https://github.com/cakephp/cakephp-codesniffer/issues", - "forum": "https://stackoverflow.com/tags/cakephp", - "irc": "irc://irc.freenode.org/cakephp", - "source": "https://github.com/cakephp/cakephp-codesniffer" - }, - "require": { - "php": ">=5.6", - "squizlabs/php_codesniffer": "^3.0.0" - }, - "require-dev": { - "phpunit/phpunit": "<6.0" - }, - "autoload": { - "psr-4": { - "CakePHP\\": "CakePHP/" - } - }, - "scripts": { - "increase-severity": "sed -i.bak 's/0<\\/severity>//' CakePHP/ruleset.xml", - "reset-ruleset": [ - "sed -i.bak 's//0<\\/severity>/' CakePHP/ruleset.xml", - "rm -f CakePHP/ruleset.xml.bak" - ], - "add-standard" : "phpcs --config-set installed_paths $(pwd)", - "test": [ - "@add-standard", - "@increase-severity", - "phpunit", - "@reset-ruleset" - ], - "test-coverage": [ - "@add-standard", - "@increase-severity", - "phpunit --coverage-clover=clover.xml", - "@reset-ruleset" - ], - "cs-check": "vendor/bin/phpcs --colors -p -s --extensions=php CakePHP/", - "cs-fix": "vendor/bin/phpcbf --colors -p --extensions=php CakePHP/", - "explain": "vendor/bin/phpcs -e" - } -} diff --git a/vendor/cakephp/cakephp-codesniffer/phpcs.xml b/vendor/cakephp/cakephp-codesniffer/phpcs.xml deleted file mode 100644 index ae84391..0000000 --- a/vendor/cakephp/cakephp-codesniffer/phpcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - CakePHP coding standard - - - diff --git a/vendor/cakephp/cakephp-codesniffer/phpcs.xml.dist b/vendor/cakephp/cakephp-codesniffer/phpcs.xml.dist deleted file mode 100644 index f3b4f08..0000000 --- a/vendor/cakephp/cakephp-codesniffer/phpcs.xml.dist +++ /dev/null @@ -1,6 +0,0 @@ - - - App Coding Standard - - - diff --git a/vendor/cakephp/cakephp-codesniffer/phpunit.xml b/vendor/cakephp/cakephp-codesniffer/phpunit.xml deleted file mode 100644 index de25c26..0000000 --- a/vendor/cakephp/cakephp-codesniffer/phpunit.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - vendor/squizlabs/php_codesniffer/tests/AllTests.php - - - - - - - ./CakePHP/Sniffs - - - diff --git a/vendor/cakephp/chronos/.appveyor.yml b/vendor/cakephp/chronos/.appveyor.yml deleted file mode 100644 index 827713b..0000000 --- a/vendor/cakephp/chronos/.appveyor.yml +++ /dev/null @@ -1,34 +0,0 @@ -build: false -shallow_clone: false -platform: 'x86' -clone_folder: c:\projects\chronos - -branches: - only: - - master - -environment: - global: - PHP: "C:/PHP" - -init: - - SET PATH=C:\php\;%PATH% - -install: - - cd c:\ - - curl -fsS https://windows.php.net/downloads/releases/archives/php-5.6.40-nts-Win32-VC11-x86.zip -o php.zip - - 7z x php.zip -oc:\php - - cd c:\php - - copy php.ini-production php.ini - - echo date.timezone="UTC" >> php.ini - - echo extension_dir=ext >> php.ini - - echo extension=php_openssl.dll >> php.ini - - cd C:\projects\chronos - - appveyor DownloadFile https://getcomposer.org/composer.phar - # phpstan requires php 7.0. While here used php 5.5 we can't install it - - php composer.phar remove --dev phpstan/phpstan - - php composer.phar install --prefer-dist --no-interaction --ansi --no-progress - -test_script: - - cd C:\projects\chronos - - vendor\bin\phpunit.bat diff --git a/vendor/cakephp/chronos/Dockerfile b/vendor/cakephp/chronos/Dockerfile deleted file mode 100644 index 0d8356e..0000000 --- a/vendor/cakephp/chronos/Dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -# Basic docker based environment -# Necessary to trick dokku into building the documentation -# using dockerfile instead of herokuish -FROM php:7.3 - -WORKDIR /code - -VOLUME ["/code"] - -CMD [ '/bin/bash' ] diff --git a/vendor/cakephp/chronos/LICENSE b/vendor/cakephp/chronos/LICENSE deleted file mode 100644 index 97f3ee6..0000000 --- a/vendor/cakephp/chronos/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -Copyright (C) Brian Nesbitt -Copyright (C) Cake Software Foundation, Inc. (http://cakefoundation.org) - -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/vendor/cakephp/chronos/README.md b/vendor/cakephp/chronos/README.md deleted file mode 100644 index 5049973..0000000 --- a/vendor/cakephp/chronos/README.md +++ /dev/null @@ -1,150 +0,0 @@ -# CakePHP Chronos - -[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE) -[![Build Status](https://img.shields.io/travis/cakephp/chronos/master.svg?style=flat-square)](https://travis-ci.org/cakephp/chronos) -[![Coverage Status](https://img.shields.io/coveralls/cakephp/chronos/master.svg?style=flat-square)](https://coveralls.io/r/cakephp/chronos?branch=master) -[![Total Downloads](https://img.shields.io/packagist/dt/cakephp/chronos.svg?style=flat-square)](https://packagist.org/packages/cakephp/chronos) - -Chronos aims to be a drop-in replacement for `nesbot/carbon`. It focuses on providing -immutable date/datetime objects. Immutable objects help ensure that datetime objects -aren't accidentally modified keeping data more predictable. - -# Installation - -Installing with composer: - -``` -$ composer require cakephp/chronos -``` - -You can then use Chronos: - -```php -modify('+2 hours'); - -// This will keep modifications -$date = new Chronos('2015-10-21 16:29:00'); -$date = $date->modify('+2 hours'); -``` - -## Getting Mutable Objects - -In the case that you need a mutable instance you can get one: - -```php -$time = new Chronos('2015-10-21 16:29:00'); -$mutable = $time->toMutable(); - -$date = new Date('2015-10-21'); -$mutable = $date->toMutable(); -``` - -## Converting Mutable Objects into Immutable ones. - -If you have a mutable object and want an immutable variant you can do the following: - -```php -$time = new MutableDateTime('2015-10-21 16:29:00'); -$fixed = $time->toImmutable(); - -$date = new MutableDate('2015-10-21'); -$fixed = $date->toImmutable(); -``` - -# Calendar Dates - -PHP only offers datetime objects as part of the native extensions. Chronos -adds a number of conveniences to the traditional DateTime object and introduces -a `Date` object. `Date` instances offer compatibility with the `ChronosInterface`, but -have their time & timezone frozen to `00:00:00 UTC`. This makes them ideal when working with -calendar dates as the time components will always match. - -```php -use Cake\Chronos\Date; - -$today = new Date(); -echo $today; -// Outputs '2015-10-21' - -echo $today->modify('+3 hours'); -// Outputs '2015-10-21' -``` - -Like instances of `Chronos`, `Date` objects are also *immutable*. The `MutableDate` class provides -a mutable variant of `Date`. - -# Documentation - -A more descriptive documentation can be found at [book.cakephp.org/chronos/1.x/en/](https://book.cakephp.org/chronos/1.x/en/). - -# API Documentation - -API documentation can be found on [api.cakephp.org/chronos](https://api.cakephp.org/chronos). diff --git a/vendor/cakephp/chronos/composer.json b/vendor/cakephp/chronos/composer.json deleted file mode 100644 index d63b284..0000000 --- a/vendor/cakephp/chronos/composer.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "name": "cakephp/chronos", - "type": "library", - "description": "A simple API extension for DateTime.", - "keywords": [ - "date", - "time", - "DateTime" - ], - "homepage": "http://cakephp.org", - "license": "MIT", - "authors": [ - { - "name": "Brian Nesbitt", - "email": "brian@nesbot.com", - "homepage": "http://nesbot.com" - }, - { - "name": "The CakePHP Team", - "homepage": "http://cakephp.org" - } - ], - "support": { - "issues": "https://github.com/cakephp/chronos/issues", - "irc": "irc://irc.freenode.org/cakephp", - "source": "https://github.com/cakephp/chronos" - }, - "require": { - "php": ">=5.6" - }, - "require-dev": { - "phpunit/phpunit": "<6.0 || ^7.0", - "athletic/athletic": "~0.1", - "cakephp/cakephp-codesniffer": "^3.0", - "phpbench/phpbench": "@dev" - }, - "autoload": { - "psr-4": { - "Cake\\Chronos\\": "src/" - }, - "files": ["src/carbon_compat.php"] - }, - "autoload-dev": { - "psr-4": { - "Cake\\Chronos\\Test\\": "tests/" - }, - "files": ["tests/TestCase.php"] - }, - "scripts": { - "check": [ - "@test", - "@cs-check", - "@phpstan" - ], - "test": "phpunit", - "cs-check": "phpcs", - "cs-fix": "phpcbf", - "bench": "phpbench run", - "phpstan-setup": "cp composer.json composer.backup && composer require --dev phpstan/phpstan-shim:^0.11 && mv composer.backup composer.json", - "phpstan": "phpstan analyze -c phpstan.neon -l 3 src/" - } -} diff --git a/vendor/cakephp/chronos/docs.Dockerfile b/vendor/cakephp/chronos/docs.Dockerfile deleted file mode 100644 index 3c6a7f5..0000000 --- a/vendor/cakephp/chronos/docs.Dockerfile +++ /dev/null @@ -1,20 +0,0 @@ -# Generate the HTML output. -FROM markstory/cakephp-docs-builder as builder - -RUN pip install git+https://github.com/sphinx-contrib/video.git@master - -COPY docs /data/docs - -# build docs with sphinx -RUN cd /data/docs-builder && \ - make website LANGS="en fr ja pt" SOURCE=/data/docs DEST=/data/website - -# Build a small nginx container with just the static site in it. -FROM nginx:1.15-alpine - -COPY --from=builder /data/website /data/website -COPY --from=builder /data/docs-builder/nginx.conf /etc/nginx/conf.d/default.conf - -# Move docs into place. -RUN cp -R /data/website/html/* /usr/share/nginx/html \ - && rm -rf /data/website diff --git a/vendor/cakephp/chronos/docs/config/__init__.py b/vendor/cakephp/chronos/docs/config/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/vendor/cakephp/chronos/docs/config/all.py b/vendor/cakephp/chronos/docs/config/all.py deleted file mode 100644 index c310307..0000000 --- a/vendor/cakephp/chronos/docs/config/all.py +++ /dev/null @@ -1,48 +0,0 @@ -# Global configuration information used across all the -# translations of documentation. -# -# Import the base theme configuration -from cakephpsphinx.config.all import * - -# The version info for the project you're documenting, acts as replacement for -# |version| and |release|, also used in various other places throughout the -# built documents. -# - -# The full version, including alpha/beta/rc tags. -release = '1.x' - -# The search index version. -search_version = 'chronos-1' - -# The marketing display name for the book. -version_name = '' - -# Project name shown in the black header bar -project = 'Chronos' - -# Other versions that display in the version picker menu. -version_list = [ - {'name': '1.x', 'number': '/chronos/1.x', 'title': '1.x', 'current': True}, -] - -# Languages available. -languages = ['en', 'fr', 'ja', 'pt'] - -# The GitHub branch name for this version of the docs -# for edit links to point at. -branch = 'master' - -# Current version being built -version = '1.x' - -# Language in use for this directory. -language = 'en' - -show_root_link = True - -repository = 'cakephp/chronos' - -source_path = 'docs/' - -hide_page_contents = ('search', '404', 'contents') diff --git a/vendor/cakephp/chronos/docs/en/conf.py b/vendor/cakephp/chronos/docs/en/conf.py deleted file mode 100644 index f638bda..0000000 --- a/vendor/cakephp/chronos/docs/en/conf.py +++ /dev/null @@ -1,9 +0,0 @@ -import sys, os - -# Append the top level directory of the docs, so we can import from the config dir. -sys.path.insert(0, os.path.abspath('..')) - -# Pull in all the configuration options defined in the global config file.. -from config.all import * - -language = 'en' diff --git a/vendor/cakephp/chronos/docs/en/contents.rst b/vendor/cakephp/chronos/docs/en/contents.rst deleted file mode 100644 index 10625a2..0000000 --- a/vendor/cakephp/chronos/docs/en/contents.rst +++ /dev/null @@ -1,7 +0,0 @@ -.. toctree:: - :maxdepth: 2 - :caption: CakePHP Chronos - - /index - - API \ No newline at end of file diff --git a/vendor/cakephp/chronos/docs/en/index.rst b/vendor/cakephp/chronos/docs/en/index.rst deleted file mode 100644 index 3cffdd9..0000000 --- a/vendor/cakephp/chronos/docs/en/index.rst +++ /dev/null @@ -1,313 +0,0 @@ -Chronos -####### - -Chronos provides a zero-dependency collection of extensions to the ``DateTime`` -object. In addition to convenience methods, Chronos provides: - -* ``Date`` objects for representing calendar dates. -* Immutable date and datetime objects. -* A pluggable translation system. Only English translations are included in the - library. However, ``cakephp/i18n`` can be used for full language support. - -Installation ------------- - -To install Chronos, you should use ``composer``. From your -application's ROOT directory (where composer.json file is located) run the -following:: - - php composer.phar require cakephp/chronos "@stable" - -Overview --------- - -Chronos provides a number of extensions to the DateTime objects provided by PHP. -Chronos provides 5 classes that cover mutable and immutable date/time variants -and extensions to ``DateInterval``. - -* ``Cake\Chronos\Chronos`` is an immutable *date and time* object. -* ``Cake\Chronos\Date`` is a immutable *date* object. -* ``Cake\Chronos\MutableDateTime`` is a mutable *date and time* object. -* ``Cake\Chronos\MutableDate`` is a mutable *date* object. -* ``Cake\Chronos\ChronosInterval`` is an extension to the ``DateInterval`` - object. - -Lastly, if you want to typehint against Chronos-provided date/time objects you -should use ``Cake\Chronos\ChronosInterface``. All of the date and time objects -implement this interface. - -Creating Instances ------------------- - -There are many ways to get an instance of Chronos or Date. There are a number of -factory methods that work with different argument sets:: - - use Cake\Chronos\Chronos; - - $now = Chronos::now(); - $today = Chronos::today(); - $yesterday = Chronos::yesterday(); - $tomorrow = Chronos::tomorrow(); - - // Parse relative expressions - $date = Chronos::parse('+2 days, +3 hours'); - - // Date and time integer values. - $date = Chronos::create(2015, 12, 25, 4, 32, 58); - - // Date or time integer values. - $date = Chronos::createFromDate(2015, 12, 25); - $date = Chronos::createFromTime(11, 45, 10); - - // Parse formatted values. - $date = Chronos::createFromFormat('m/d/Y', '06/15/2015'); - -Working with Immutable Objects ------------------------------- - -If you've used PHP's ``DateTime`` objects, you're comfortable with *mutable* -objects. Chronos offers mutable objects, but it also provides *immutable* -objects. Immutable objects create copies of objects each time an object is -modified. Because modifier methods around datetimes are not always transparent, -data can be modified accidentally or without the developer knowing. -Immutable objects prevent accidental changes to -data, and make code free of order-based dependency issues. Immutability -does mean that you will need to remember to replace variables when using -modifiers:: - - // This code doesn't work with immutable objects - $time->addDay(1); - doSomething($time); - return $time; - - // This works like you'd expect - $time = $time->addDay(1); - $time = doSomething($time); - return $time; - -By capturing the return value of each modification your code will work as -expected. If you ever have an immutable object, and want to create a mutable -one, you can use ``toMutable()``:: - - $inplace = $time->toMutable(); - -Date Objects ------------- - -PHP only provides a single DateTime object. Representing calendar dates can be -a bit awkward with this class as it includes timezones, and time components that -don't really belong in the concept of a 'day'. Chronos provides a ``Date`` -object that allows you to represent dates. The time and timezone for these -objects is always fixed to ``00:00:00 UTC`` and all formatting/difference -methods operate at the day resolution:: - - use Cake\Chronos\Date; - - $today = Date::today(); - - // Changes to the time/timezone are ignored. - $today->modify('+1 hours'); - - // Outputs '2015-12-20' - echo $today; - -Modifier Methods ----------------- - -Chronos objects provide modifier methods that let you modify the value in -a granular way:: - - // Set components of the datetime value. - $halloween = Chronos::create() - ->year(2015) - ->month(10) - ->day(31) - ->hour(20) - ->minute(30); - -You can also modify parts of the datetime relatively:: - - $future = Chronos::create() - ->addYear(1) - ->subMonth(2) - ->addDays(15) - ->addHours(20) - ->subMinutes(2); - -It is also possible to make big jumps to defined points in time:: - - $time = Chronos::create(); - $time->startOfDay(); - $time->endOfDay(); - $time->startOfMonth(); - $time->endOfMonth(); - $time->startOfYear(); - $time->endOfYear(); - $time->startOfWeek(); - $time->endOfWeek(); - -Or jump to specific days of the week:: - - $time->next(ChronosInterface::TUESDAY); - $time->previous(ChronosInterface::MONDAY); - -When modifying dates/times across :abbr:`DST (Daylight Savings Time)` transitions -your operations may gain/lose an additional hours resulting in hour values that -don't add up. You can avoid these issues by first changing your timezone to -``UTC``, modifying the time:: - - // Additional hour gained. - $time = new Chronos('2014-03-30 00:00:00', 'Europe/London'); - debug($time->modify('+24 hours')); // 2014-03-31 01:00:00 - - // First switch to UTC, and modify - $time = $time->setTimezone('UTC') - ->modify('+24 hours'); - -Once you are done modifying the time you can add the original timezone to get -the localized time. - -Comparison Methods ------------------- - -Once you have 2 instances of Chronos date/time objects you can compare them in -a variety of ways:: - - // Full suite of comparators exist - // ne, gt, lt, lte. - $first->eq($second); - $first->gte($second); - - // See if the current object is between two others. - $now->between($start, $end); - - // Find which argument is closest or farthest. - $now->closest($june, $november); - $now->farthest($june, $november); - -You can also inquire about where a given value falls on the calendar:: - - $now->isToday(); - $now->isYesterday(); - $now->isFuture(); - $now->isPast(); - - // Check the day of the week - $now->isWeekend(); - - // All other weekday methods exist too. - $now->isMonday(); - -You can also find out if a value was within a relative time period:: - - $time->wasWithinLast('3 days'); - $time->isWithinNext('3 hours'); - -Generating Differences ----------------------- - -In addition to comparing datetimes, calculating differences or deltas between -two values is a common task:: - - // Get a DateInterval representing the difference - $first->diff($second); - - // Get difference as a count of specific units. - $first->diffInHours($second); - $first->diffInDays($second); - $first->diffInWeeks($second); - $first->diffInYears($second); - -You can generate human readable differences suitable for use in a feed or -timeline:: - - // Difference from now. - echo $date->diffForHumans(); - - // Difference from another point in time. - echo $date->diffForHumans($other); // 1 hour ago; - -Formatting Strings ------------------- - -Chronos provides a number of methods for displaying our outputting datetime -objects:: - - // Uses the format controlled by setToStringFormat() - echo $date; - - // Different standard formats - echo $time->toAtomString(); // 1975-12-25T14:15:16-05:00 - echo $time->toCookieString(); // Thursday, 25-Dec-1975 14:15:16 EST - echo $time->toIso8601String(); // 1975-12-25T14:15:16-05:00 - echo $time->toRfc822String(); // Thu, 25 Dec 75 14:15:16 -0500 - echo $time->toRfc850String(); // Thursday, 25-Dec-75 14:15:16 EST - echo $time->toRfc1036String(); // Thu, 25 Dec 75 14:15:16 -0500 - echo $time->toRfc1123String(); // Thu, 25 Dec 1975 14:15:16 -0500 - echo $time->toRfc2822String(); // Thu, 25 Dec 1975 14:15:16 -0500 - echo $time->toRfc3339String(); // 1975-12-25T14:15:16-05:00 - echo $time->toRssString(); // Thu, 25 Dec 1975 14:15:16 -0500 - echo $time->toW3cString(); // 1975-12-25T14:15:16-05:00 - - // Get the quarter/week - echo $time->toQuarter(); // 4 - echo $time->toWeek(); // 52 - - // Generic formatting - echo $time->toTimeString(); // 14:15:16 - echo $time->toDateString(); // 1975-12-25 - echo $time->toDateTimeString(); // 1975-12-25 14:15:16 - echo $time->toFormattedDateString(); // Dec 25, 1975 - echo $time->toDayDateTimeString(); // Thu, Dec 25, 1975 2:15 PM - -Extracting Date Components --------------------------- - -Getting parts of a date object can be done by directly accessing properties:: - - $time = new Chronos('2015-12-31 23:59:58'); - $time->year; // 2015 - $time->month; // 12 - $time->day; // 31 - $time->hour // 23 - $time->minute // 59 - $time->second // 58 - -Other properties that can be accessed are: - -- timezone -- timezoneName -- micro -- dayOfWeek -- dayOfMonth -- dayOfYear -- daysInMonth -- timestamp -- quarter - -Testing Aids ------------- - -When writing unit tests, it is helpful to fixate the current time. Chronos lets -you fix the current time for each class. As part of your test suite's bootstrap -process you can include the following:: - - Chronos::setTestNow(Chronos::now()); - MutableDateTime::setTestNow(MutableDateTime::now()); - Date::setTestNow(Date::now()); - MutableDate::setTestNow(MutableDate::now()); - -This will fix the current time of all objects to be the point at which the test -suite started. - -For example, if you fixate the ``Chronos`` to some moment in the past, any new -instance of ``Chronos`` created with ``now`` or a relative time string, will be -returned relative to the fixated time:: - - Chronos::setTestNow(new Chronos('1975-12-25 00:00:00')); - - $time = new Chronos(); // 1975-12-25 00:00:00 - $time = new Chronos('1 hour ago'); // 1975-12-24 23:00:00 - -To reset the fixation, simply call ``setTestNow()`` again with no parameter or -with ``null`` as a parameter. diff --git a/vendor/cakephp/chronos/docs/fr/conf.py b/vendor/cakephp/chronos/docs/fr/conf.py deleted file mode 100644 index b02032e..0000000 --- a/vendor/cakephp/chronos/docs/fr/conf.py +++ /dev/null @@ -1,9 +0,0 @@ -import sys, os - -# Append the top level directory of the docs, so we can import from the config dir. -sys.path.insert(0, os.path.abspath('..')) - -# Pull in all the configuration options defined in the global config file.. -from config.all import * - -language = 'fr' diff --git a/vendor/cakephp/chronos/docs/fr/contents.rst b/vendor/cakephp/chronos/docs/fr/contents.rst deleted file mode 100644 index 10625a2..0000000 --- a/vendor/cakephp/chronos/docs/fr/contents.rst +++ /dev/null @@ -1,7 +0,0 @@ -.. toctree:: - :maxdepth: 2 - :caption: CakePHP Chronos - - /index - - API \ No newline at end of file diff --git a/vendor/cakephp/chronos/docs/fr/index.rst b/vendor/cakephp/chronos/docs/fr/index.rst deleted file mode 100644 index f313d8b..0000000 --- a/vendor/cakephp/chronos/docs/fr/index.rst +++ /dev/null @@ -1,306 +0,0 @@ -Chronos -####### - -Chronos fournit une collection d'extensions sans aucune dépendance pour l'objet -``DateTime``. En plus de méthodes pratiques, Chronos fournit: - -* Des objets ``Date`` pour représenter les dates du calendrier. -* Des objets immutables pour les dates et les datetimes. -* Un système de traduction intégrable. Seules les traductions anglaises sont - inclues dans la librairie. Cependant, ``cakephp/i18n`` peut être utilisé - pour un support complet d'autres langues. - -Installation ------------- - -Pour installer Chronos, vous devez utiliser ``composer``. A partir du répertoire -ROOT de votre application (où le fichier composer.json se trouve) exécutez ce -qui suit:: - - php composer.phar require cakephp/chronos "@stable" - -Vue d'Ensemble --------------- - -Chronos fournit un certain nombre d'extensions pour les objets DateTime fournis -par PHP. Chronos fournit 5 classes qui gèrent les variantes mutables et -immutables de date/time et les extensions de ``DateInterval``. - -* ``Cake\Chronos\Chronos`` est un objet de *date et time* immutable. -* ``Cake\Chronos\Date`` est un objet de *date* immutable. -* ``Cake\Chronos\MutableDateTime`` est un objet de *date et time* mutable. -* ``Cake\Chronos\MutableDate`` est un objet de *date* mutable. -* ``Cake\Chronos\ChronosInterval`` est une extension pour l'objet - ``DateInterval``. - -Enfin si vous voulez typer selon les objets date/time fournis par Chronos, -vous devez utiliser ``Cake\Chronos\ChronosInterface``. Tous les objets date et -time implémentent cette interface. - -Créer des Instances -------------------- - -Il y a plusieurs façons d'obtenir une instance de Chronos ou de Date. Il y a -un certain nombre de méthodes factory qui fonctionnent avec des ensembles -ayant des arguments différents:: - - use Cake\Chronos\Chronos; - - $now = Chronos::now(); - $today = Chronos::today(); - $yesterday = Chronos::yesterday(); - $tomorrow = Chronos::tomorrow(); - - // Parse les expressions relatives - $date = Chronos::parse('+2 days, +3 hours'); - - // Les valeurs d'entier de Date et time. - $date = Chronos::create(2015, 12, 25, 4, 32, 58); - - // Les valeurs d'entier pour Date ou time. - $date = Chronos::createFromDate(2015, 12, 25); - $date = Chronos::createFromTime(11, 45, 10); - - // Parse les valeurs formatées. - $date = Chronos::createFromFormat('m/d/Y', '06/15/2015'); - -Travailler avec les Objets Immutables -------------------------------------- - -Si vous avez utilisé les objets ``DateTime`` de PHP, vous êtes à l'aise avec -les objets *mutable*. Chronos offre des objets mutables, mais elle fournit -également des objets *immutables*. Les objets Immutables créent des copies des -objets à chaque fois qu'un objet est modifié. Puisque les méthodes de -modification autour des datetimes ne sont pas toujours transparentes, les -données peuvent être modifiées accidentellement ou sans que le développeur ne -le sache. Les objets immutables évitent les changements accidentels des -données et permettent de s'affranchir de tout problème lié à l'ordre d'appel -des fonctions ou des dépendances. L'immutabilité signifie que vous devez vous -souvenir de remplacer les variables quand vous utilisez les modificateurs:: - - // Ce code ne fonctionne pas avec les objets immutables - $time->addDay(1); - doSomething($time); - return $time; - - // Ceci fonctionne comme vous le souhaitez - $time = $time->addDay(1); - $time = doSomething($time); - return $time; - -En capturant la valeur de retour pour chaque modification, votre code -fonctionnera comme souhaité. Si vous avez déjà créé un objet immutable, et que -vous souhaitez un objet mutable, vous pouvez utiliser ``toMutable()``:: - - $inplace = $time->toMutable(); - -Objets Date ------------ - -PHP fournit seulement un unique objet DateTime. Représenter les dates de -calendrier peut être un peu gênant avec cette classe puisqu'elle inclut les -timezones, et les composants de time qui n'appartiennent pas vraiment -dans le concept d'un 'jour'. Chronos fournit un objet ``Date`` qui vous permet -de représenter les dates. Les time et timezone pour ces objets sont toujours -fixés à ``00:00:00 UTC`` et toutes les méthodes de formatage/différence -fonctionnent au niveau du jour:: - - use Cake\Chronos\Date; - - $today = Date::today(); - - // Changements selon le time/timezone sont ignorés. - $today->modify('+1 hours'); - - // Affiche '2015-12-20' - echo $today; - -Méthodes de Modification ------------------------- - -Les objets Chronos fournissent des méthodes de modification qui vous laissent -modifier la valeur d'une façon assez précise:: - - // Définit les composants de la valeur du datetime. - $halloween = Chronos::create() - ->year(2015) - ->month(10) - ->day(31) - ->hour(20) - ->minute(30); - -Vous pouvez aussi modifier les parties de la date de façon relative:: - - $future = Chronos::create() - ->addYear(1) - ->subMonth(2) - ->addDays(15) - ->addHours(20) - ->subMinutes(2); - -Il est également possible de faire des sauts vers des points définis dans le -temps:: - - $time = Chronos::create(); - $time->startOfDay(); - $time->endOfDay(); - $time->startOfMonth(); - $time->endOfMonth(); - $time->startOfYear(); - $time->endOfYear(); - $time->startOfWeek(); - $time->endOfWeek(); - -Ou de sauter à un jour spécifique de la semaine:: - - $time->next(ChronosInterface::TUESDAY); - $time->previous(ChronosInterface::MONDAY); - -Méthodes de Comparaison ------------------------ - -Une fois que vous avez 2 instances d'objets date/time de Chronos, vous pouvez -les comparer de plusieurs façons:: - - // Suite complète de comparateurs existante - // ne, gt, lt, lte. - $first->eq($second); - $first->gte($second); - - // Regardez si l'objet courant est entre deux autres. - $now->between($start, $end); - - // Trouver l'argument le plus proche ou le plus éloigné. - $now->closest($june, $november); - $now->farthest($june, $november); - -Vous pouvez aussi vous renseigner sur le moment où une valeur donnée tombe dans -le calendrier:: - - $now->isToday(); - $now->isYesterday(); - $now->isFuture(); - $now->isPast(); - - // Vérifie le jour de la semaine - $now->isWeekend(); - - // Toutes les autres méthodes des jours de la semaine existent aussi. - $now->isMonday(); - -Vous pouvez aussi trouver si une valeur était dans une période de temps relative:: - - $time->wasWithinLast('3 days'); - $time->isWithinNext('3 hours'); - -Générer des Différences ------------------------ - -En plus de comparer les datetimes, calculer les différences ou les deltas entre -des valeurs est une tâche courante:: - - // Récupère un DateInterval représentant la différence - $first->diff($second); - - // Récupère la différence en tant que nombre d'unités spécifiques. - $first->diffInHours($second); - $first->diffInDays($second); - $first->diffInWeeks($second); - $first->diffInYears($second); - -Vous pouvez générer des différences lisibles qui peuvent vous servir pour -l'utilisation d'un feed ou d'une timeline:: - - // Différence à partir de maintenant. - echo $date->diffForHumans(); - - // Différence à partir d'un autre point du temps. - echo $date->diffForHumans($other); // 1 hour ago; - -Formater les Chaînes --------------------- - -Chronos fournit un certain nombre de méthodes pour afficher nos sorties d'objets -datetime:: - - // Utilise le format contrôlé par setToStringFormat() - echo $date; - - // Différents formats standards - echo $time->toAtomString(); // 1975-12-25T14:15:16-05:00 - echo $time->toCookieString(); // Thursday, 25-Dec-1975 14:15:16 EST - echo $time->toIso8601String(); // 1975-12-25T14:15:16-05:00 - echo $time->toRfc822String(); // Thu, 25 Dec 75 14:15:16 -0500 - echo $time->toRfc850String(); // Thursday, 25-Dec-75 14:15:16 EST - echo $time->toRfc1036String(); // Thu, 25 Dec 75 14:15:16 -0500 - echo $time->toRfc1123String(); // Thu, 25 Dec 1975 14:15:16 -0500 - echo $time->toRfc2822String(); // Thu, 25 Dec 1975 14:15:16 -0500 - echo $time->toRfc3339String(); // 1975-12-25T14:15:16-05:00 - echo $time->toRssString(); // Thu, 25 Dec 1975 14:15:16 -0500 - echo $time->toW3cString(); // 1975-12-25T14:15:16-05:00 - - // Récupère le trimestre - echo $time->toQuarter(); // 4; - // Récupère la semaine - echo $time->toWeek(); // 52; - - // Formatage générique - echo $time->toTimeString(); // 14:15:16 - echo $time->toDateString(); // 1975-12-25 - echo $time->toDateTimeString(); // 1975-12-25 14:15:16 - echo $time->toFormattedDateString(); // Dec 25, 1975 - echo $time->toDayDateTimeString(); // Thu, Dec 25, 1975 2:15 PM - -Extraire des Fragments de Date ------------------------------- - -Il est possible de récupérer des parties d'un objet date en accédant directement -à ses propriétés:: - - $time = new Chronos('2015-12-31 23:59:58'); - $time->year; // 2015 - $time->month; // 12 - $time->day; // 31 - $time->hour // 23 - $time->minute // 59 - $time->second // 58 - -Les autres propriétés accessibles sont: - -- timezone -- timezoneName -- micro -- dayOfWeek -- dayOfMonth -- dayOfYear -- daysInMonth -- timestamp -- quarter - -Aides aux Tests ---------------- - -Quand vous écrivez des tests unitaires, il peut être utile de fixer le *time* -courant. Chronos vous permet de fixer le time courant pour chaque classe. -Pour l'intégrer dans votre processus de démarrage (bootstrap) de suite de tests, -vous pouvez inclure ce qui suit:: - - Chronos::setTestNow(Chronos::now()); - MutableDateTime::setTestNow(MutableDateTime::now()); - Date::setTestNow(Date::now()); - MutableDate::setTestNow(MutableDate::now()); - -Ceci va fixer le time courant de tous les objets selon le moment où la suite de -tests a démarré. - -Par exemple, si vous fixez le ``Chronos`` à un moment du passé, chaque nouvelle -instance de ``Chronos`` créée avec ``now`` ou une chaine de temps relative, sera -retournée relativement à la date fixée:: - - Chronos::setTestNow(new Chronos('1975-12-25 00:00:00')); - - $time = new Chronos(); // 1975-12-25 00:00:00 - $time = new Chronos('1 hour ago'); // 1975-12-24 23:00:00 - -Pour réinitialiser la "fixation" du temps, appelez simplement ``setTestNow()`` -sans paramètre ou avec ``null`` comme paramètre. diff --git a/vendor/cakephp/chronos/docs/ja/conf.py b/vendor/cakephp/chronos/docs/ja/conf.py deleted file mode 100644 index 5871da6..0000000 --- a/vendor/cakephp/chronos/docs/ja/conf.py +++ /dev/null @@ -1,9 +0,0 @@ -import sys, os - -# Append the top level directory of the docs, so we can import from the config dir. -sys.path.insert(0, os.path.abspath('..')) - -# Pull in all the configuration options defined in the global config file.. -from config.all import * - -language = 'ja' diff --git a/vendor/cakephp/chronos/docs/ja/contents.rst b/vendor/cakephp/chronos/docs/ja/contents.rst deleted file mode 100644 index 10625a2..0000000 --- a/vendor/cakephp/chronos/docs/ja/contents.rst +++ /dev/null @@ -1,7 +0,0 @@ -.. toctree:: - :maxdepth: 2 - :caption: CakePHP Chronos - - /index - - API \ No newline at end of file diff --git a/vendor/cakephp/chronos/docs/ja/index.rst b/vendor/cakephp/chronos/docs/ja/index.rst deleted file mode 100644 index 9e1db71..0000000 --- a/vendor/cakephp/chronos/docs/ja/index.rst +++ /dev/null @@ -1,304 +0,0 @@ -Chronos -####### - -Chronos (クロノス) は、 ``DateTime`` オブジェクトへの拡張の依存関係の無いコレクションを提供します。 -便利なメソッドに加えて、Chronos は以下を提供します。 - -* カレンダー日付のための ``Date`` オブジェクト -* イミュータブルな日付と日時オブジェクト -* プラグインのような翻訳システム。ライブラリーは英語のみの翻訳を含んでいます。 - しかし、全ての言語サポートのために、 ``cakephp/i18n`` を使うことができます。 - -インストール ------------- - -Chronos をインストールするためには、 ``composer`` を利用することができます。 -アプリケーションの ROOT ディレクトリー(composer.json ファイルのある場所) -で以下のように実行します。 :: - - php composer.phar require cakephp/chronos "@stable" - -概要 ----- - -Chronos は PHP が提供する DateTime オブジェクトのいくつかの拡張を提供します。 -Chronos は ``DateInterval`` の拡張機能および、ミュータブル(変更可能)と -イミュータブル(変更不可)な 日付/時刻 の派生系をカバーする5つのクラスを提供します。 - -* ``Cake\Chronos\Chronos`` はイミュータブルな *日付と時刻* オブジェクト。 -* ``Cake\Chronos\Date`` はイミュータブルな *日付* オブジェクト。 -* ``Cake\Chronos\MutableDateTime`` はミュータブルな *日付と時刻* オブジェクト。 -* ``Cake\Chronos\MutableDate`` はミュータブルな *日付* オブジェクト。 -* ``Cake\Chronos\ChronosInterval`` は ``DateInterval`` の拡張機能。 - -最後に、もしあなたが Chronos が提供する 日付/時刻 のオブジェクトに対して型宣言を行ないたい場合、 -``Cake\Chronos\ChronosInterface`` を使用することができます。 -全ての日付と時間のオブジェクトはこのインターフェイスを実装しています。 - -インスタンスの作成 ------------------- - -Chronos または Date のインスタンスを取得するためには、多くの方法があります。 -異なる引数セットで動作する多くのファクトリーメソッドがあります。 :: - - use Cake\Chronos\Chronos; - - $now = Chronos::now(); - $today = Chronos::today(); - $yesterday = Chronos::yesterday(); - $tomorrow = Chronos::tomorrow(); - - // 相対式のパース - $date = Chronos::parse('+2 days, +3 hours'); - - // 日付と時間の整数値 - $date = Chronos::create(2015, 12, 25, 4, 32, 58); - - // 日付または時間の整数値 - $date = Chronos::createFromDate(2015, 12, 25); - $date = Chronos::createFromTime(11, 45, 10); - - // 整形した値にパース - $date = Chronos::createFromFormat('m/d/Y', '06/15/2015'); - -イミュータブルオブジェクトの動作 --------------------------------- - -もしあなたが、PHP の ``DateTime`` オブジェクトを使用したことがあるなら、 -*ミュータブル* オブジェクトは簡単に使用できます。 -Chronos はミュータブルオブジェクトを提供しますが、これは *イミュータブル* オブジェクトにもなります。 -イミュータブルオブジェクトはオブジェクトが変更されるたびにオブジェクトのコピーを作ります。 -なぜなら、日時周りの変更メソッドは必ずしも透明でないため、データが誤って、 -または開発者が知らない内に変更してしまうからです。 -イミュータブルオブジェクトはデータが誤って変更されることを防止し、 -順序ベースの依存関係の問題の無いコードを作ります。 -不変性は、変更時に忘れずに変数を置き換える必要があることを意味しています。 :: - - // このコードはイミュータブルオブジェクトでは動作しません - $time->addDay(1); - doSomething($time); - return $time - - // このコードは期待通りに動作します - $time = $time->addDay(1); - $time = doSomething($time); - return $time - -各修正の戻り値をキャプチャーすることによって、コードは期待通りに動作します。 -イミュータブルオブジェクトを持っていて、ミュータブルオブジェクトを作りたい場合、 -``toMutable()`` が使用できます。 :: - - $inplace = $time->toMutable(); - -日付オブジェクト ------------------- - -PHP は単純な DateTime オブジェクトだけを提供します。このクラスのカレンダー日付の表現で、 -タイムゾーンおよび、本当に「日」の概念に属していないタイムコンポーネントを含むと、 -少し厄介な可能性があります。 -Chronos は日時表現のための ``Date`` オブジェクトを提供します。 -これらのオブジェクトの時間とタイムゾーンは常に ``00:00:00 UTC`` に固定されており、 -全ての書式/差分のメソッドは一日単位で動作します。 :: - - use Cake\Chronos\Date; - - $today = Date::today(); - - // 時間/タイムゾーンの変更は無視されます - $today->modify('+1 hours'); - - // 出力 '2015-12-20' - echo $today; - -変更メソッド ------------- - -Chronos オブジェクトは細やかに値を変更できるメソッドを提供します。 :: - - // 日時の値のコンポーネントを設定 - $halloween = Chronos::create() - ->year(2015) - ->month(10) - ->day(31) - ->hour(20) - ->minute(30); - -また、日時の部分を相対的に変更することもできます。 :: - - $future = Chronos::create() - ->addYear(1) - ->subMonth(2) - ->addDays(15) - ->addHours(20) - ->subMinutes(2); - -また、ある時間の中で、定義された時点に飛ぶことも可能です。 :: - - $time = Chronos::create(); - $time->startOfDay(); - $time->endOfDay(); - $time->startOfMonth(); - $time->endOfMonth(); - $time->startOfYear(); - $time->endOfYear(); - $time->startOfWeek(); - $time->endOfWeek(); - -また、1週間中の特定の日にも飛べます。 :: - - $time->next(ChronosInterface::TUESDAY); - $time->previous(ChronosInterface::MONDAY); - -:abbr:`DST (夏時間)` の遷移の前後で日付/時間を変更すると、 -あなたの操作で時間が増減するかもしれませんが、その結果、意図しない時間の値になります。 -これらの問題を回避するには、最初にタイムゾーンを ``UTC`` に変更し、時間を変更します。 :: - - // 余分な時間が追加されました - $time = new Chronos('2014-03-30 00:00:00', 'Europe/London'); - debug($time->modify('+24 hours')); // 2014-03-31 01:00:00 - - // 最初に UTC に切り替え、そして更新 - $time = $time->setTimezone('UTC') - ->modify('+24 hours'); - -時間を変更すると、元のタイムゾーンを追加してローカライズされた時間を取得することができます。 - -比較メソッド ------------- - -Chronos の日付/時間オブジェクトの2つのインスタンスを様々な方法で比較することができます。 :: - - // 比較のフルセットが存在します - // ne, gt, lt, lte. - $first->eq($second); - $first->gte($second); - - // カレントオブジェクトが2つのオブジェクトの間にあるかどうかを確認します。 - $now->between($start, $end); - - // どちらの引数が最も近い (closest) か、または最も遠い (farthest) かを見つけます。 - $now->closest($june, $november); - $now->farthest($june, $november); - -また、与えられた値のカレンダーに当たる場所について問い合わせできます。 :: - - $now->isToday(); - $now->isYesterday(); - $now->isFuture(); - $now->isPast(); - - // 曜日をチェック - $now->isWeekend(); - - // 他の曜日のメソッドも全て存在します。 - $now->isMonday(); - -また、値が相対的な期間内にあったかどうかを見つけることができます。 :: - - $time->wasWithinLast('3 days'); - $time->isWithinNext('3 hours'); - -差の生成 --------- - -日時比較に加えて、2つの値の差や変化の計算は一般的なタスクです。 :: - - // 差をあらわす DateInterval を取得 - $first->diff($second); - - // 特定の単位での差を取得 - $first->diffInHours($second); - $first->diffInDays($second); - $first->diffInWeeks($second); - $first->diffInYears($second); - -フィードやタイムラインで使用するのに適した、人が読める形式の差を生成することができます。 :: - - // 現在からの差 - echo $date->diffForHumans(); - - // 別の時点からの差 - echo $date->diffForHumans($other); // 1時間前; - -フォーマットの設定 ------------------- - -Chronos は、出力した日時オブジェクトを表示するための多くのメソッドを提供します。 :: - - // setToStringFormat() が制御するフォーマットを使用します - echo $date; - - // 別の標準フォーマット - echo $time->toAtomString(); // 1975-12-25T14:15:16-05:00 - echo $time->toCookieString(); // Thursday, 25-Dec-1975 14:15:16 EST - echo $time->toIso8601String(); // 1975-12-25T14:15:16-05:00 - echo $time->toRfc822String(); // Thu, 25 Dec 75 14:15:16 -0500 - echo $time->toRfc850String(); // Thursday, 25-Dec-75 14:15:16 EST - echo $time->toRfc1036String(); // Thu, 25 Dec 75 14:15:16 -0500 - echo $time->toRfc1123String(); // Thu, 25 Dec 1975 14:15:16 -0500 - echo $time->toRfc2822String(); // Thu, 25 Dec 1975 14:15:16 -0500 - echo $time->toRfc3339String(); // 1975-12-25T14:15:16-05:00 - echo $time->toRssString(); // Thu, 25 Dec 1975 14:15:16 -0500 - echo $time->toW3cString(); // 1975-12-25T14:15:16-05:00 - - // クォーター/週数を取得 - echo $time->toQuarter(); // 4; - echo $time->toWeek(); // 52 - - // 一般的なフォーマット - echo $time->toTimeString(); // 14:15:16 - echo $time->toDateString(); // 1975-12-25 - echo $time->toDateTimeString(); // 1975-12-25 14:15:16 - echo $time->toFormattedDateString(); // Dec 25, 1975 - echo $time->toDayDateTimeString(); // Thu, Dec 25, 1975 2:15 PM - -日付要素の抽出 --------------- - -日付オブジェクトのプロパティーに直接アクセスして要素を取得することができます。 :: - - $time = new Chronos('2015-12-31 23:59:58'); - $time->year; // 2015 - $time->month; // 12 - $time->day; // 31 - $time->hour // 23 - $time->minute // 59 - $time->second // 58 - -以下のプロパティーにもアクセスできます。 : - -- timezone -- timezoneName -- micro -- dayOfWeek -- dayOfMonth -- dayOfYear -- daysInMonth -- timestamp -- quarter - -テストの支援 ------------- - -単体テストを書いている時、現在時刻を固定すると便利です。Chronos は、 -各クラスの現在時刻を修正することができます。 -テストスイートの bootstrap 処理に以下を含めることができます。 :: - - Chronos::setTestNow(Chronos::now()); - MutableDateTime::setTestNow(MutableDateTime::now()); - Date::setTestNow(Date::now()); - MutableDate::setTestNow(MutableDate::now()); - -これでテストスイートが開始された時点で全てのオブジェクトの現在時刻を修正します。 - -例えば、 ``Chronos`` を過去のある瞬間に固定した場合、新たな ``Chronos`` -のインスタンスが生成する ``now`` または相対時刻の文字列は、 -固定された時刻の相対を返却します。 :: - - Chronos::setTestNow(new Chronos('1975-12-25 00:00:00')); - - $time = new Chronos(); // 1975-12-25 00:00:00 - $time = new Chronos('1 hour ago'); // 1975-12-24 23:00:00 - -固定をリセットするには、 ``setTestNow()`` をパラメーター無し、または ``null`` を設定して -再び呼び出してください。 diff --git a/vendor/cakephp/chronos/docs/pt/conf.py b/vendor/cakephp/chronos/docs/pt/conf.py deleted file mode 100644 index 9e22cb0..0000000 --- a/vendor/cakephp/chronos/docs/pt/conf.py +++ /dev/null @@ -1,9 +0,0 @@ -import sys, os - -# Append the top level directory of the docs, so we can import from the config dir. -sys.path.insert(0, os.path.abspath('..')) - -# Pull in all the configuration options defined in the global config file.. -from config.all import * - -language = 'pt' diff --git a/vendor/cakephp/chronos/docs/pt/contents.rst b/vendor/cakephp/chronos/docs/pt/contents.rst deleted file mode 100644 index 10625a2..0000000 --- a/vendor/cakephp/chronos/docs/pt/contents.rst +++ /dev/null @@ -1,7 +0,0 @@ -.. toctree:: - :maxdepth: 2 - :caption: CakePHP Chronos - - /index - - API \ No newline at end of file diff --git a/vendor/cakephp/chronos/docs/pt/index.rst b/vendor/cakephp/chronos/docs/pt/index.rst deleted file mode 100644 index d4a90af..0000000 --- a/vendor/cakephp/chronos/docs/pt/index.rst +++ /dev/null @@ -1,285 +0,0 @@ -Chronos -####### - -O Chronos oferece uma coleção independente de extensões para lidar com o objeto -``DateTime``. Além de métodos de conveniência, o Chronos oferece: - -* Objetos ``Date`` para representar datas de calendário. -* Objetos *date* e *datetime* imutáveis. -* Um sistema de tradução acoplável. Apenas traduções em inglês estão incluídas - na biblioteca. Todavia, ``cakephp/i18n`` pode ser usado para suporte completo - a idiomas. - -Instalação ----------- - -Para instalar o Chronos, você deve usar o ``composer``. A partir do diretório -*ROOT* de sua aplicação (local onde o arquivo composer.json está localizado) -execute o seguinte comando:: - - php composer.phar require cakephp/chronos "@stable" - -Visão geral ------------ - -Chronos oferece extensões para lidar com objetos *DateTime* do PHP. 5 classes -cobrem variantes de data/hora mutáveis e imutáveis e uma extensão do objeto -``DateInterval``. - -* ``Cake\Chronos\Chronos`` é um objeto *date & time* imutável. -* ``Cake\Chronos\Date`` é um objeto *date* imutável. -* ``Cake\Chronos\MutableDateTime`` é um objeto *date and time* mutável. -* ``Cake\Chronos\MutableDate`` é um objeto *date* mutável. -* ``Cake\Chronos\ChronosInterval`` é uma extensão do objeto ``DateInterval``. - -Por último, se você quiser usar o *typehint* em objetos do Chronos, será preciso -usar a interface ``Cake\Chronos\ChronosInterface``. Todos os objetos de data e -hora implementam essa interface. - -Criando instâncias ------------------- - -Existem várias maneiras de criar instâncias do Chronos ou mesmo, do objeto Date. -Um número considerável de métodos padrão que funcionam com conjuntos diferentes -de argumentos:: - - use Cake\Chronos\Chronos; - - $now = Chronos::now(); - $today = Chronos::today(); - $yesterday = Chronos::yesterday(); - $tomorrow = Chronos::tomorrow(); - - // Interpreta expressões relativas. - $date = Chronos::parse('+2 days, +3 hours'); - - // Valores inteiros de Date e Time. - $date = Chronos::create(2015, 12, 25, 4, 32, 58); - - // Valores inteiros de Date ou Time. - $date = Chronos::createFromDate(2015, 12, 25); - $date = Chronos::createFromTime(11, 45, 10); - - // Interpreta valores formatados. - $date = Chronos::createFromFormat('m/d/Y', '06/15/2015'); - -Trabalhando com objetos imutáveis ---------------------------------- - -Se você é familiarizado com os objetos ``DateTime`` do PHP, você se sentirá -confortável com objetos *mutáveis*. Além de objetos mutáveis o Chronos também -oferece objetos imutáveis que por sua vez criam cópias de objetos toda vez que -um objeto é modificado. Devido ao fato de que metodos modificadores relativos -a data e hora nem sempre serem transparentes, informações podem ser modificadas -acidentalmente ou sem que o desenvolvedor saiba. Objetos imutáveis previnem -essas alterações acidentais nos dados. Imutabilidade significa que você deverá -lembrar de substituir variáveis usando modificadores:: - - // Esse código não funciona com objetos imutáveis - $time->addDay(1); - doSomething($time); - return $time; - - // Esse funciona como o esperado - $time = $time->addDay(1); - $time = doSomething($time); - return $time; - -Ao capturar o valor de retorno de cada modificação, seu código funcionará como o -esperado. Se você tem um objeto imutável e quer criar um mutável a partir do -mesmo, use ``toMutable()``:: - - $inplace = $time->toMutable(); - -Objetos Date ------------- - -O PHP disponibiliza um único objeto DateTime. Representar datas de calendário -pode ser um pouco desconfortável por essa classe, uma vez que ela inclui -*timezones* e componentes de hora que realmente não se encaixam no conceito de -'dia'. O Chronos oferece um objeto ``Date`` para representar datas. A hora e a -zona desse objeto é sempre fixado em ``00:00:00 UTC`` e todos os métodos de -formatação/diferença operam sob a resolução de dia:: - - use Cake\Chronos\Date; - - $today = Date::today(); - - // Mudanças na hora/timezone são ignoradas - $today->modify('+1 hours'); - - // Exibe '2016-08-15' - echo $today; - -Métodos modificadores ---------------------- - -Objetos Chronos disponibilizam métodos que permitem a modificação de valores de -forma granular:: - - // Define componentes do valor datetime - $halloween = Chronos::create() - ->year(2015) - ->month(10) - ->day(31) - ->hour(20) - ->minute(30); - -Você também pode modificar partes da data relativamente:: - - $future = Chronos::create() - ->addYear(1) - ->subMonth(2) - ->addDays(15) - ->addHours(20) - ->subMinutes(2); - -Também é possível realizar grandes saltos para períodos definidos no tempo:: - - $time = Chronos::create(); - $time->startOfDay(); - $time->startOfMonth(); - $time->endOfMonth(); - $time->endOfYear(); - $time->startOfWeek(); - $time->endOfWeek(); - -Ou ainda para dias específicos da semana:: - - $time->next(ChronosInterface::TUESDAY); - $time->previous(ChronosInterface::MONDAY); - -Métodos de comparação ---------------------- - -Uma vez que você possui 2 instâncias de objetos data/hora do Chronos, é possível -compará-los de várias maneiras:: - - // Coleção completa de comparadores - // ne, gt, lt, lte. - $first->eq($second); - $first->gte($second); - - // Veja se o objeto atual está entre outros - $now->between($start, $end); - - // Encontre qual argumento está mais perto ou mais longe - $now->closest($june, $november); - $now->farthest($june, $november); - -Você também pode arguir sobre quando um determinado valor cai no calendário:: - - $now->isToday(); - $now->isYesterday(); - $now->isFuture(); - $now->isPast(); - - // Verifica se o dia é no final de semana - $now->isWeekend(); - - // Todos os métodos para outros dias da semana existem também - $now->isMonday(); - -Você também pode verificar se um determinado valor está dentro de um período de -tempo relativo:: - - $time->wasWithinLast('3 days'); - $time->isWithinNext('3 hours'); - -Gerando diferenças ------------------- - -Em adição à comparação de *datetimes*, calcular diferenças ou deltas entre -valores é uma tarefa simples:: - - // Recebe um DateInterval representando a diferença - $first->diff($second); - - // Recebe a diferença como um contador de unidades específicas - $first->diffInHours($second); - $first->diffInDays($second); - $first->diffInWeeks($second); - $first->diffInYears($second); - -Você pode gerar diferenças de fácil leitura para humanos para usar em um *feed* -ou *timeline*:: - - // Diferença em relação ao momento atual - echo $date->diffForHumans(); - - // Diferença em relação a outro período no tempo - echo $date->diffForHumans($other); // 1 hora atrás; - -Formatando strings ------------------- - -O Chronos disponibiliza métodos para exibir nossos objetos *datetime*:: - - // Usa o formato controlado por setToStringFormat() - echo $date; - - // Diferentes padrões de formato - echo $time->toAtomString(); // 1975-12-25T14:15:16-05:00 - echo $time->toCookieString(); // Thursday, 25-Dec-1975 14:15:16 EST - echo $time->toIso8601String(); // 1975-12-25T14:15:16-05:00 - echo $time->toRfc822String(); // Thu, 25 Dec 75 14:15:16 -0500 - echo $time->toRfc850String(); // Thursday, 25-Dec-75 14:15:16 EST - echo $time->toRfc1036String(); // Thu, 25 Dec 75 14:15:16 -0500 - echo $time->toRfc1123String(); // Thu, 25 Dec 1975 14:15:16 -0500 - echo $time->toRfc2822String(); // Thu, 25 Dec 1975 14:15:16 -0500 - echo $time->toRfc3339String(); // 1975-12-25T14:15:16-05:00 - echo $time->toRssString(); // Thu, 25 Dec 1975 14:15:16 -0500 - echo $time->toW3cString(); // 1975-12-25T14:15:16-05:00 - - // Recebe o trimestre - echo $time->toQuarter(); // 4; - -Extraindo componentes de data ------------------------------ - -Podemos receber partes de um objeto *date* acessando propriedades:: - - $time = new Chronos('2015-12-31 23:59:58'); - $time->year; // 2015 - $time->month; // 12 - $time->day; // 31 - $time->hour // 23 - $time->minute // 59 - $time->second // 58 - -Outras propriedades que podem ser acessadas são: - -- timezone -- timezoneName -- micro -- dayOfWeek -- dayOfMonth -- dayOfYear -- daysInMonth -- timestamp -- quarter - -Auxílio para testes -------------------- - -Ao escrever testes unitários, fixar a hora atual é bastante útil. O Chronos -lhe permite fixar a hora atual para cada classe. Como parte das suas ferramentas -de testes, você pode incluir o seguinte:: - - Chronos::setTestNow(Chronos::now()); - MutableDateTime::setTestNow(MutableDateTime::now()); - Date::setTestNow(Date::now()); - MutableDate::setTestNow(MutableDate::now()); - -Isso irá corrigir a hora atual de todos os objetos para o momento em que o -processo de testes foi iniciado. - -Por exemplo, se você fixar o ``Chronos`` em algum momento no passado, qualquer -nova instância do ``Chronos`` criada com ``now`` ou uma *string* de tempo -relativa, teremos um retorno referente ao tempo fixado:: - - Chronos::setTestNow(new Chronos('1975-12-25 00:00:00')); - - $time = new Chronos(); // 1975-12-25 00:00:00 - $time = new Chronos('1 hour ago'); // 1975-12-24 23:00:00 - diff --git a/vendor/cakephp/chronos/src/Chronos.php b/vendor/cakephp/chronos/src/Chronos.php deleted file mode 100644 index d395563..0000000 --- a/vendor/cakephp/chronos/src/Chronos.php +++ /dev/null @@ -1,202 +0,0 @@ - - * @link http://cakephp.org CakePHP(tm) Project - * @license http://www.opensource.org/licenses/mit-license.php MIT License - */ -namespace Cake\Chronos; - -use DateTimeImmutable; -use DateTimeZone; - -/** - * An Immutable extension on the native DateTime object. - * - * Adds a number of convenience APIs methods and the ability - * to easily convert into a mutable object. - * - * @property-read int $year - * @property-read int $yearIso - * @property-read int $month - * @property-read int $day - * @property-read int $hour - * @property-read int $minute - * @property-read int $second - * @property-read int $timestamp seconds since the Unix Epoch - * @property-read DateTimeZone $timezone the current timezone - * @property-read DateTimeZone $tz alias of timezone - * @property-read int $micro - * @property-read int $dayOfWeek 1 (for Monday) through 7 (for Sunday) - * @property-read int $dayOfYear 0 through 365 - * @property-read int $weekOfMonth 1 through 5 - * @property-read int $weekOfYear ISO-8601 week number of year, weeks starting on Monday - * @property-read int $daysInMonth number of days in the given month - * @property-read int $age does a diffInYears() with default parameters - * @property-read int $quarter the quarter of this instance, 1 - 4 - * @property-read int $offset the timezone offset in seconds from UTC - * @property-read int $offsetHours the timezone offset in hours from UTC - * @property-read bool $dst daylight savings time indicator, true if DST, false otherwise - * @property-read bool $local checks if the timezone is local, true if local, false otherwise - * @property-read bool $utc checks if the timezone is UTC, true if UTC, false otherwise - * @property-read string $timezoneName - * @property-read string $tzName - */ -class Chronos extends DateTimeImmutable implements ChronosInterface -{ - use Traits\ComparisonTrait; - use Traits\DifferenceTrait; - use Traits\FactoryTrait; - use Traits\FormattingTrait; - use Traits\MagicPropertyTrait; - use Traits\ModifierTrait; - use Traits\RelativeKeywordTrait; - use Traits\TimezoneTrait; - - /** - * A test ChronosInterface instance to be returned when now instances are created - * - * There is a single test now for all date/time classes provided by Chronos. - * This aims to emulate stubbing out 'now' which is a single global fact. - * - * @var \Cake\Chronos\ChronosInterface - */ - protected static $testNow; - - /** - * Format to use for __toString method when type juggling occurs. - * - * @var string - */ - protected static $toStringFormat = ChronosInterface::DEFAULT_TO_STRING_FORMAT; - - /** - * Create a new Chronos instance. - * - * Please see the testing aids section (specifically static::setTestNow()) - * for more on the possibility of this constructor returning a test instance. - * - * @param string|null $time Fixed or relative time - * @param \DateTimeZone|string|null $tz The timezone for the instance - */ - public function __construct($time = 'now', $tz = null) - { - if ($tz !== null) { - $tz = $tz instanceof DateTimeZone ? $tz : new DateTimeZone($tz); - } - - static::$_lastErrors = []; - $testNow = static::getTestNow(); - if ($testNow === null) { - parent::__construct($time === null ? 'now' : $time, $tz); - - return; - } - - $relative = static::hasRelativeKeywords($time); - if (!empty($time) && $time !== 'now' && !$relative) { - parent::__construct($time, $tz); - - return; - } - - $testNow = clone $testNow; - if ($relative) { - $testNow = $testNow->modify($time); - } - - $relativeTime = static::isTimeExpression($time); - if (!$relativeTime && $tz !== $testNow->getTimezone()) { - $testNow = $testNow->setTimezone($tz === null ? date_default_timezone_get() : $tz); - } - - $time = $testNow->format('Y-m-d H:i:s.u'); - parent::__construct($time, $tz); - } - - /** - * Create a new mutable instance from current immutable instance. - * - * @return \Cake\Chronos\MutableDateTime - */ - public function toMutable() - { - return MutableDateTime::instance($this); - } - - /** - * Get a copy of the instance - * - * @return $this - */ - public function copy() - { - return $this; - } - - /** - * Set a ChronosInterface instance (real or mock) to be returned when a "now" - * instance is created. The provided instance will be returned - * specifically under the following conditions: - * - A call to the static now() method, ex. ChronosInterface::now() - * - When a null (or blank string) is passed to the constructor or parse(), ex. new Chronos(null) - * - When the string "now" is passed to the constructor or parse(), ex. new Chronos('now') - * - When a string containing the desired time is passed to ChronosInterface::parse() - * - * Note the timezone parameter was left out of the examples above and - * has no affect as the mock value will be returned regardless of its value. - * - * To clear the test instance call this method using the default - * parameter of null. - * - * @param \Cake\Chronos\ChronosInterface|string|null $testNow The instance to use for all future instances. - * @return void - */ - public static function setTestNow($testNow = null) - { - static::$testNow = is_string($testNow) ? static::parse($testNow) : $testNow; - } - - /** - * Get the ChronosInterface instance (real or mock) to be returned when a "now" - * instance is created. - * - * @return \Cake\Chronos\ChronosInterface The current instance used for testing - */ - public static function getTestNow() - { - return static::$testNow; - } - - /** - * Determine if there is a valid test instance set. A valid test instance - * is anything that is not null. - * - * @return bool True if there is a test instance, otherwise false - */ - public static function hasTestNow() - { - return static::$testNow !== null; - } - - /** - * Return properties for debugging. - * - * @return array - */ - public function __debugInfo() - { - $properties = [ - 'hasFixedNow' => static::hasTestNow(), - 'time' => $this->format('Y-m-d H:i:s.u'), - 'timezone' => $this->getTimezone()->getName(), - ]; - - return $properties; - } -} diff --git a/vendor/cakephp/chronos/src/ChronosInterface.php b/vendor/cakephp/chronos/src/ChronosInterface.php deleted file mode 100644 index d73c7a1..0000000 --- a/vendor/cakephp/chronos/src/ChronosInterface.php +++ /dev/null @@ -1,1308 +0,0 @@ - - * @link http://cakephp.org CakePHP(tm) Project - * @license http://www.opensource.org/licenses/mit-license.php MIT License - */ -namespace Cake\Chronos; - -use DateTimeInterface; -use DateTimeZone; - -/** - * An extension to the DateTimeInterface for a friendlier API - * - * @method static modify(string $relative) - */ -interface ChronosInterface extends DateTimeInterface -{ - /** - * The day constants - */ - const MONDAY = 1; - const TUESDAY = 2; - const WEDNESDAY = 3; - const THURSDAY = 4; - const FRIDAY = 5; - const SATURDAY = 6; - const SUNDAY = 7; - - /** - * Number of X in Y - */ - const YEARS_PER_CENTURY = 100; - const YEARS_PER_DECADE = 10; - const MONTHS_PER_YEAR = 12; - const MONTHS_PER_QUARTER = 3; - const WEEKS_PER_YEAR = 52; - const DAYS_PER_WEEK = 7; - const HOURS_PER_DAY = 24; - const MINUTES_PER_HOUR = 60; - const SECONDS_PER_MINUTE = 60; - - /** - * Default format to use for __toString method when type juggling occurs. - * - * @var string - */ - const DEFAULT_TO_STRING_FORMAT = 'Y-m-d H:i:s'; - - /** - * Get a ChronosInterface instance for the current date and time - * - * @param \DateTimeZone|string|null $tz The DateTimeZone object or timezone name. - * @return static - */ - public static function now($tz); - - /** - * Get a copy of the instance - * - * @return static - */ - public function copy(); - - /** - * Set the instance's year - * - * @param int $value The year value. - * @return static - */ - public function year($value); - - /** - * Set the instance's month - * - * @param int $value The month value. - * @return static - */ - public function month($value); - - /** - * Set the instance's day - * - * @param int $value The day value. - * @return static - */ - public function day($value); - - /** - * Set the instance's hour - * - * @param int $value The hour value. - * @return static - */ - public function hour($value); - - /** - * Set the instance's minute - * - * @param int $value The minute value. - * @return static - */ - public function minute($value); - - /** - * Set the instance's second - * - * @param int $value The seconds value. - * @return static - */ - public function second($value); - - /** - * Set the date and time all together - * - * @param int $year The year to set. - * @param int $month The month to set. - * @param int $day The day to set. - * @param int $hour The hour to set. - * @param int $minute The minute to set. - * @param int $second The second to set. - * @return static - */ - public function setDateTime($year, $month, $day, $hour, $minute, $second = 0); - - /** - * Set the time by time string - * - * @param string $time Time as string. - * @return static - */ - public function setTimeFromTimeString($time); - - /** - * Set the instance's timestamp - * - * @param int $value The timestamp value to set. - * @return static - */ - public function timestamp($value); - - /** - * Alias for setTimezone() - * - * @param \DateTimeZone|string $value The DateTimeZone object or timezone name to use. - * @return static - */ - public function timezone($value); - - /** - * Alias for setTimezone() - * - * @param \DateTimeZone|string $value The DateTimeZone object or timezone name to use. - * @return static - */ - public function tz($value); - - /** - * Set the instance's timezone from a string or object - * - * @param \DateTimeZone|string $value The DateTimeZone object or timezone name to use. - * @return static - */ - public function setTimezone($value); - - /** - * Format the instance as date - * - * @return string - */ - public function toDateString(); - - /** - * Format the instance as a readable date - * - * @return string - */ - public function toFormattedDateString(); - - /** - * Format the instance as time - * - * @return string - */ - public function toTimeString(); - - /** - * Format the instance as date and time - * - * @return string - */ - public function toDateTimeString(); - - /** - * Format the instance with day, date and time - * - * @return string - */ - public function toDayDateTimeString(); - - /** - * Format the instance as ATOM - * - * @return string - */ - public function toAtomString(); - - /** - * Format the instance as COOKIE - * - * @return string - */ - public function toCookieString(); - - /** - * Format the instance as ISO8601 - * - * @return string - */ - public function toIso8601String(); - - /** - * Format the instance as RFC822 - * - * @return string - */ - public function toRfc822String(); - - /** - * Format the instance as RFC850 - * - * @return string - */ - public function toRfc850String(); - - /** - * Format the instance as RFC1036 - * - * @return string - */ - public function toRfc1036String(); - - /** - * Format the instance as RFC1123 - * - * @return string - */ - public function toRfc1123String(); - - /** - * Format the instance as RFC2822 - * - * @return string - */ - public function toRfc2822String(); - - /** - * Format the instance as RFC3339 - * - * @return string - */ - public function toRfc3339String(); - - /** - * Format the instance as RSS - * - * @return string - */ - public function toRssString(); - - /** - * Format the instance as W3C - * - * @return string - */ - public function toW3cString(); - - /** - * Determines if the instance is equal to another - * - * @param \Cake\Chronos\ChronosInterface $dt The instance to compare with. - * @return bool - * @see equals - */ - public function eq(ChronosInterface $dt); - - /** - * Determines if the instance is equal to another - * - * @param \Cake\Chronos\ChronosInterface $dt The instance to compare with. - * @return bool - */ - public function equals(ChronosInterface $dt); - - /** - * Determines if the instance is not equal to another - * - * @param \Cake\Chronos\ChronosInterface $dt The instance to compare with. - * @return bool - * @see notEquals - */ - public function ne(ChronosInterface $dt); - - /** - * Determines if the instance is not equal to another - * - * @param \Cake\Chronos\ChronosInterface $dt The instance to compare with. - * @return bool - */ - public function notEquals(ChronosInterface $dt); - - /** - * Determines if the instance is greater (after) than another - * - * @param \Cake\Chronos\ChronosInterface $dt The instance to compare with. - * @return bool - * @see greaterThan - */ - public function gt(ChronosInterface $dt); - - /** - * Determines if the instance is greater (after) than another - * - * @param \Cake\Chronos\ChronosInterface $dt The instance to compare with. - * @return bool - */ - public function greaterThan(ChronosInterface $dt); - - /** - * Determines if the instance is greater (after) than or equal to another - * - * @param \Cake\Chronos\ChronosInterface $dt The instance to compare with. - * @return bool - * @see greaterThanOrEquals - */ - public function gte(ChronosInterface $dt); - - /** - * Determines if the instance is greater (after) than or equal to another - * - * @param \Cake\Chronos\ChronosInterface $dt The instance to compare with. - * @return bool - */ - public function greaterThanOrEquals(ChronosInterface $dt); - - /** - * Determines if the instance is less (before) than another - * - * @param \Cake\Chronos\ChronosInterface $dt The instance to compare with. - * @return bool - * @see lessThan - */ - public function lt(ChronosInterface $dt); - - /** - * Determines if the instance is less (before) than another - * - * @param \Cake\Chronos\ChronosInterface $dt The instance to compare with. - * @return bool - */ - public function lessThan(ChronosInterface $dt); - - /** - * Determines if the instance is less (before) or equal to another - * - * @param \Cake\Chronos\ChronosInterface $dt The instance to compare with. - * @return bool - * @see lessThanOrEquals - */ - public function lte(ChronosInterface $dt); - - /** - * Determines if the instance is less (before) or equal to another - * - * @param \Cake\Chronos\ChronosInterface $dt The instance to compare with. - * @return bool - */ - public function lessThanOrEquals(ChronosInterface $dt); - - /** - * Determines if the instance is between two others - * - * @param \Cake\Chronos\ChronosInterface $dt1 The instance to compare with. - * @param \Cake\Chronos\ChronosInterface $dt2 The instance to compare with. - * @param bool $equal Indicates if a > and < comparison should be used or <= or >= - * @return bool - */ - public function between(ChronosInterface $dt1, ChronosInterface $dt2, $equal = true); - - /** - * Get the closest date from the instance. - * - * @param \Cake\Chronos\ChronosInterface $dt1 The instance to compare with. - * @param \Cake\Chronos\ChronosInterface $dt2 The instance to compare with. - * @return static - */ - public function closest(ChronosInterface $dt1, ChronosInterface $dt2); - - /** - * Get the farthest date from the instance. - * - * @param \Cake\Chronos\ChronosInterface $dt1 The instance to compare with. - * @param \Cake\Chronos\ChronosInterface $dt2 The instance to compare with. - * @return static - */ - public function farthest(ChronosInterface $dt1, ChronosInterface $dt2); - - /** - * Get the minimum instance between a given instance (default now) and the current instance. - * - * @param \Cake\Chronos\ChronosInterface|null $dt The instance to compare with. - * @return static - */ - public function min(ChronosInterface $dt = null); - - /** - * Get the maximum instance between a given instance (default now) and the current instance. - * - * @param \Cake\Chronos\ChronosInterface|null $dt The instance to compare with. - * @return static - */ - public function max(ChronosInterface $dt = null); - - /** - * Determines if the instance is a weekday - * - * @return bool - */ - public function isWeekday(); - - /** - * Determines if the instance is a weekend day - * - * @return bool - */ - public function isWeekend(); - - /** - * Determines if the instance is yesterday - * - * @return bool - */ - public function isYesterday(); - - /** - * Determines if the instance is today - * - * @return bool - */ - public function isToday(); - - /** - * Determines if the instance is tomorrow - * - * @return bool - */ - public function isTomorrow(); - - /** - * Determines if the instance is in the future, ie. greater (after) than now - * - * @return bool - */ - public function isFuture(); - - /** - * Determines if the instance is in the past, ie. less (before) than now - * - * @return bool - */ - public function isPast(); - - /** - * Determines if the instance is a leap year - * - * @return bool - */ - public function isLeapYear(); - - /** - * Checks if the passed in date is the same day as the instance current day. - * - * @param \Cake\Chronos\ChronosInterface $dt The instance to check against. - * @return bool - */ - public function isSameDay(ChronosInterface $dt); - - /** - * Checks if this day is a Sunday. - * - * @return bool - */ - public function isSunday(); - - /** - * Checks if this day is a Monday. - * - * @return bool - */ - public function isMonday(); - - /** - * Checks if this day is a Tuesday. - * - * @return bool - */ - public function isTuesday(); - - /** - * Checks if this day is a Wednesday. - * - * @return bool - */ - public function isWednesday(); - - /** - * Checks if this day is a Thursday. - * - * @return bool - */ - public function isThursday(); - - /** - * Checks if this day is a Friday. - * - * @return bool - */ - public function isFriday(); - - /** - * Checks if this day is a Saturday. - * - * @return bool - */ - public function isSaturday(); - - /** - * Returns true if this object represents a date within the current week - * - * @return bool - */ - public function isThisWeek(); - - /** - * Returns true if this object represents a date within the current month - * - * @return bool - */ - public function isThisMonth(); - - /** - * Returns true if this object represents a date within the current year - * - * @return bool - */ - public function isThisYear(); - - /** - * Add years to the instance. Positive $value travel forward while - * negative $value travel into the past. - * - * @param int $value The number of years to add. - * @return static - */ - public function addYears($value); - - /** - * Add a year to the instance - * - * @param int $value The number of years to add. - * @return static - */ - public function addYear($value = 1); - - /** - * Remove a year from the instance - * - * @param int $value The number of years to remove. - * @return static - */ - public function subYear($value = 1); - - /** - * Remove years from the instance. - * - * @param int $value The number of years to remove. - * @return static - */ - public function subYears($value); - - /** - * Add months to the instance. Positive $value travels forward while - * negative $value travels into the past. - * - * When adding or subtracting months, if the resulting time is a date - * that does not exist, the result of this operation will always be the - * last day of the intended month. - * - * ### Example: - * - * ``` - * (new Chronos('2015-01-03'))->addMonths(1); // Results in 2015-02-03 - * - * (new Chronos('2015-01-31'))->addMonths(1); // Results in 2015-02-28 - * ``` - * - * @param int $value The number of months to add. - * @return static - */ - public function addMonths($value); - - /** - * Add a month to the instance - * - * When adding or subtracting months, if the resulting time is a date - * that does not exist, the result of this operation will always be the - * last day of the intended month. - * - * ### Example: - * - * ``` - * (new Chronos('2015-01-03'))->addMonth(); // Results in 2015-02-03 - * - * (new Chronos('2015-01-31'))->addMonth(); // Results in 2015-02-28 - * ``` - * - * @param int $value The number of months to add. - * @return static - */ - public function addMonth($value = 1); - - /** - * Remove a month from the instance - * - * When adding or subtracting months, if the resulting time is a date - * that does not exist, the result of this operation will always be the - * last day of the intended month. - * - * ### Example: - * - * ``` - * (new Chronos('2015-03-01'))->subMonth(); // Results in 2015-02-01 - * - * (new Chronos('2015-03-31'))->subMonth(); // Results in 2015-02-28 - * ``` - * - * @param int $value The number of months to remove. - * @return static - */ - public function subMonth($value = 1); - - /** - * Remove months from the instance - * - * When adding or subtracting months, if the resulting time is a date - * that does not exist, the result of this operation will always be the - * last day of the intended month. - * - * ### Example: - * - * ``` - * (new Chronos('2015-03-01'))->subMonths(1); // Results in 2015-02-01 - * - * (new Chronos('2015-03-31'))->subMonths(1); // Results in 2015-02-28 - * ``` - * - * @param int $value The number of months to remove. - * @return static - */ - public function subMonths($value); - - /** - * Add months with overflowing to the instance. Positive $value - * travels forward while negative $value travels into the past. - * - * @param int $value The number of months to add. - * @return static - */ - public function addMonthsWithOverflow($value); - - /** - * Add a month with overflow to the instance - * - * @param int $value The number of months to add. - * @return static - */ - public function addMonthWithOverflow($value = 1); - - /** - * Remove a month with overflow from the instance - * - * @param int $value The number of months to remove. - * @return static - */ - public function subMonthWithOverflow($value = 1); - - /** - * Remove months with overflow from the instance - * - * @param int $value The number of months to remove. - * @return static - */ - public function subMonthsWithOverflow($value); - - /** - * Add days to the instance. Positive $value travels forward while - * negative $value travels into the past. - * - * @param int $value The number of days to add. - * @return static - */ - public function addDays($value); - - /** - * Add a day to the instance - * - * @param int $value The number of days to add. - * @return static - */ - public function addDay($value = 1); - - /** - * Remove a day from the instance - * - * @param int $value The number of days to remove. - * @return static - */ - public function subDay($value = 1); - - /** - * Remove days from the instance - * - * @param int $value The number of days to remove. - * @return static - */ - public function subDays($value); - - /** - * Add weekdays to the instance. Positive $value travels forward while - * negative $value travels into the past. - * - * @param int $value The number of weekdays to add. - * @return static - */ - public function addWeekdays($value); - - /** - * Add a weekday to the instance - * - * @param int $value The number of weekdays to add. - * @return static - */ - public function addWeekday($value = 1); - - /** - * Remove a weekday from the instance - * - * @param int $value The number of weekdays to remove. - * @return static - */ - public function subWeekday($value = 1); - - /** - * Remove weekdays from the instance - * - * @param int $value The number of weekdays to remove. - * @return static - */ - public function subWeekdays($value); - - /** - * Add weeks to the instance. Positive $value travels forward while - * negative $value travels into the past. - * - * @param int $value The number of weeks to add. - * @return static - */ - public function addWeeks($value); - - /** - * Add a week to the instance - * - * @param int $value The number of weeks to add. - * @return static - */ - public function addWeek($value = 1); - - /** - * Remove a week from the instance - * - * @param int $value The number of weeks to remove. - * @return static - */ - public function subWeek($value = 1); - - /** - * Remove weeks to the instance - * - * @param int $value The number of weeks to remove. - * @return static - */ - public function subWeeks($value); - - /** - * Add hours to the instance. Positive $value travels forward while - * negative $value travels into the past. - * - * @param int $value The number of hours to add. - * @return static - */ - public function addHours($value); - - /** - * Add an hour to the instance - * - * @param int $value The number of hours to add. - * @return static - */ - public function addHour($value = 1); - - /** - * Remove an hour from the instance - * - * @param int $value The number of hours to remove. - * @return static - */ - public function subHour($value = 1); - - /** - * Remove hours from the instance - * - * @param int $value The number of hours to remove. - * @return static - */ - public function subHours($value); - - /** - * Add minutes to the instance. Positive $value travels forward while - * negative $value travels into the past. - * - * @param int $value The number of minutes to add. - * @return static - */ - public function addMinutes($value); - - /** - * Add a minute to the instance - * - * @param int $value The number of minutes to add. - * @return static - */ - public function addMinute($value = 1); - - /** - * Remove a minute from the instance - * - * @param int $value The number of minutes to remove. - * @return static - */ - public function subMinute($value = 1); - - /** - * Remove minutes from the instance - * - * @param int $value The number of minutes to remove. - * @return static - */ - public function subMinutes($value); - - /** - * Add seconds to the instance. Positive $value travels forward while - * negative $value travels into the past. - * - * @param int $value The number of seconds to add. - * @return static - */ - public function addSeconds($value); - - /** - * Add a second to the instance - * - * @param int $value The number of seconds to add. - * @return static - */ - public function addSecond($value = 1); - - /** - * Remove a second from the instance - * - * @param int $value The number of seconds to remove. - * @return static - */ - public function subSecond($value = 1); - - /** - * Remove seconds from the instance - * - * @param int $value The number of seconds to remove. - * @return static - */ - public function subSeconds($value); - - /** - * Get the difference in a human readable format in the current locale. - * - * When comparing a value in the past to default now: - * 1 hour ago - * 5 months ago - * - * When comparing a value in the future to default now: - * 1 hour from now - * 5 months from now - * - * When comparing a value in the past to another value: - * 1 hour before - * 5 months before - * - * When comparing a value in the future to another value: - * 1 hour after - * 5 months after - * - * @param \Cake\Chronos\ChronosInterface|null $other The datetime to compare with. - * @param bool $absolute Removes time difference modifiers ago, after, etc - * @return string - */ - public function diffForHumans(ChronosInterface $other = null, $absolute = false); - - /** - * Get the difference in years - * - * @param \Cake\Chronos\ChronosInterface|null $dt The instance to difference from. - * @param bool $abs Get the absolute of the difference - * @return int - */ - public function diffInYears(ChronosInterface $dt = null, $abs = true); - - /** - * Get the difference in months - * - * @param \Cake\Chronos\ChronosInterface|null $dt The instance to difference from. - * @param bool $abs Get the absolute of the difference - * @return int - */ - public function diffInMonths(ChronosInterface $dt = null, $abs = true); - - /** - * Get the difference in weeks - * - * @param \Cake\Chronos\ChronosInterface|null $dt The instance to difference from. - * @param bool $abs Get the absolute of the difference - * @return int - */ - public function diffInWeeks(ChronosInterface $dt = null, $abs = true); - - /** - * Get the difference in days - * - * @param \Cake\Chronos\ChronosInterface|null $dt The instance to difference from. - * @param bool $abs Get the absolute of the difference - * @return int - */ - public function diffInDays(ChronosInterface $dt = null, $abs = true); - - /** - * Get the difference in days using a filter callable - * - * @param callable $callback The callback to use for filtering. - * @param \Cake\Chronos\ChronosInterface|null $dt The instance to difference from. - * @param bool $abs Get the absolute of the difference - * @return int - */ - public function diffInDaysFiltered(callable $callback, ChronosInterface $dt = null, $abs = true); - - /** - * Get the difference in hours using a filter callable - * - * @param callable $callback The callback to use for filtering. - * @param \Cake\Chronos\ChronosInterface|null $dt The instance to difference from. - * @param bool $abs Get the absolute of the difference - * @return int - */ - public function diffInHoursFiltered(callable $callback, ChronosInterface $dt = null, $abs = true); - - /** - * Get the difference by the given interval using a filter callable - * - * @param \Cake\Chronos\ChronosInterval $ci An interval to traverse by - * @param callable $callback The callback to use for filtering. - * @param \Cake\Chronos\ChronosInterface|null $dt The instance to difference from. - * @param bool $abs Get the absolute of the difference - * @return int - */ - public function diffFiltered(ChronosInterval $ci, callable $callback, ChronosInterface $dt = null, $abs = true); - - /** - * Get the difference in weekdays - * - * @param \Cake\Chronos\ChronosInterface|null $dt The instance to difference from. - * @param bool $abs Get the absolute of the difference - * @return int - */ - public function diffInWeekdays(ChronosInterface $dt = null, $abs = true); - - /** - * Get the difference in weekend days using a filter - * - * @param \Cake\Chronos\ChronosInterface|null $dt The instance to difference from. - * @param bool $abs Get the absolute of the difference - * @return int - */ - public function diffInWeekendDays(ChronosInterface $dt = null, $abs = true); - - /** - * Get the difference in hours - * - * @param \Cake\Chronos\ChronosInterface|null $dt The instance to difference from. - * @param bool $abs Get the absolute of the difference - * @return int - */ - public function diffInHours(ChronosInterface $dt = null, $abs = true); - - /** - * Get the difference in minutes - * - * @param \Cake\Chronos\ChronosInterface|null $dt The instance to difference from. - * @param bool $abs Get the absolute of the difference - * @return int - */ - public function diffInMinutes(ChronosInterface $dt = null, $abs = true); - - /** - * Get the difference in seconds - * - * @param \Cake\Chronos\ChronosInterface|null $dt The instance to difference from. - * @param bool $abs Get the absolute of the difference - * @return int - */ - public function diffInSeconds(ChronosInterface $dt = null, $abs = true); - - /** - * The number of seconds since midnight. - * - * @return int - */ - public function secondsSinceMidnight(); - - /** - * The number of seconds until 23:59:59. - * - * @return int - */ - public function secondsUntilEndOfDay(); - - /** - * Resets the time to 00:00:00 - * - * @return static - */ - public function startOfDay(); - - /** - * Resets the time to 23:59:59 - * - * @return static - */ - public function endOfDay(); - - /** - * Resets the date to the first day of the month and the time to 00:00:00 - * - * @return static - */ - public function startOfMonth(); - - /** - * Resets the date to end of the month and time to 23:59:59 - * - * @return static - */ - public function endOfMonth(); - - /** - * Resets the date to the first day of the year and the time to 00:00:00 - * - * @return static - */ - public function startOfYear(); - - /** - * Resets the date to end of the year and time to 23:59:59 - * - * @return static - */ - public function endOfYear(); - - /** - * Resets the date to the first day of the decade and the time to 00:00:00 - * - * @return static - */ - public function startOfDecade(); - - /** - * Resets the date to end of the decade and time to 23:59:59 - * - * @return static - */ - public function endOfDecade(); - - /** - * Resets the date to the first day of the century and the time to 00:00:00 - * - * @return static - */ - public function startOfCentury(); - - /** - * Resets the date to end of the century and time to 23:59:59 - * - * @return static - */ - public function endOfCentury(); - - /** - * Resets the date to the first day of week (defined in $weekStartsAt) and the time to 00:00:00 - * - * @return static - */ - public function startOfWeek(); - - /** - * Resets the date to end of week (defined in $weekEndsAt) and time to 23:59:59 - * - * @return static - */ - public function endOfWeek(); - - /** - * Modify to the next occurrence of a given day of the week. - * If no dayOfWeek is provided, modify to the next occurrence - * of the current day of the week. Use the supplied consts - * to indicate the desired dayOfWeek, ex. static::MONDAY. - * - * @param int $dayOfWeek The day of the week to move to. - * @return mixed - */ - public function next($dayOfWeek = null); - - /** - * Modify to the previous occurrence of a given day of the week. - * If no dayOfWeek is provided, modify to the previous occurrence - * of the current day of the week. Use the supplied consts - * to indicate the desired dayOfWeek, ex. static::MONDAY. - * - * @param int $dayOfWeek The day of the week to move to. - * @return mixed - */ - public function previous($dayOfWeek = null); - - /** - * Modify to the first occurrence of a given day of the week - * in the current month. If no dayOfWeek is provided, modify to the - * first day of the current month. Use the supplied consts - * to indicate the desired dayOfWeek, ex. static::MONDAY. - * - * @param int $dayOfWeek The day of the week to move to. - * @return mixed - */ - public function firstOfMonth($dayOfWeek = null); - - /** - * Modify to the last occurrence of a given day of the week - * in the current month. If no dayOfWeek is provided, modify to the - * last day of the current month. Use the supplied consts - * to indicate the desired dayOfWeek, ex. static::MONDAY. - * - * @param int $dayOfWeek The day of the week to move to. - * @return mixed - */ - public function lastOfMonth($dayOfWeek = null); - - /** - * Modify to the given occurrence of a given day of the week - * in the current month. If the calculated occurrence is outside the scope - * of the current month, then return false and no modifications are made. - * Use the supplied consts to indicate the desired dayOfWeek, ex. static::MONDAY. - * - * @param int $nth The offset to use. - * @param int $dayOfWeek The day of the week to move to. - * @return mixed - */ - public function nthOfMonth($nth, $dayOfWeek); - - /** - * Modify to the first occurrence of a given day of the week - * in the current quarter. If no dayOfWeek is provided, modify to the - * first day of the current quarter. Use the supplied consts - * to indicate the desired dayOfWeek, ex. static::MONDAY. - * - * @param int $dayOfWeek The day of the week to move to. - * @return mixed - */ - public function firstOfQuarter($dayOfWeek = null); - - /** - * Modify to the last occurrence of a given day of the week - * in the current quarter. If no dayOfWeek is provided, modify to the - * last day of the current quarter. Use the supplied consts - * to indicate the desired dayOfWeek, ex. static::MONDAY. - * - * @param int $dayOfWeek The day of the week to move to. - * @return mixed - */ - public function lastOfQuarter($dayOfWeek = null); - - /** - * Modify to the given occurrence of a given day of the week - * in the current quarter. If the calculated occurrence is outside the scope - * of the current quarter, then return false and no modifications are made. - * Use the supplied consts to indicate the desired dayOfWeek, ex. static::MONDAY. - * - * @param int $nth The offset to use. - * @param int $dayOfWeek The day of the week to move to. - * @return mixed - */ - public function nthOfQuarter($nth, $dayOfWeek); - - /** - * Modify to the first occurrence of a given day of the week - * in the current year. If no dayOfWeek is provided, modify to the - * first day of the current year. Use the supplied consts - * to indicate the desired dayOfWeek, ex. static::MONDAY. - * - * @param int $dayOfWeek The day of the week to move to. - * @return mixed - */ - public function firstOfYear($dayOfWeek = null); - - /** - * Modify to the last occurrence of a given day of the week - * in the current year. If no dayOfWeek is provided, modify to the - * last day of the current year. Use the supplied consts - * to indicate the desired dayOfWeek, ex. static::MONDAY. - * - * @param int $dayOfWeek The day of the week to move to. - * @return mixed - */ - public function lastOfYear($dayOfWeek = null); - - /** - * Modify to the given occurrence of a given day of the week - * in the current year. If the calculated occurrence is outside the scope - * of the current year, then return false and no modifications are made. - * Use the supplied consts to indicate the desired dayOfWeek, ex. static::MONDAY. - * - * @param int $nth The offset to use. - * @param int $dayOfWeek The day of the week to move to. - * @return mixed - */ - public function nthOfYear($nth, $dayOfWeek); - - /** - * Modify the current instance to the average of a given instance (default now) and the current instance. - * - * @param \Cake\Chronos\ChronosInterface $dt The instance to compare with. - * @return static - */ - public function average(ChronosInterface $dt = null); - - /** - * Check if its the birthday. Compares the date/month values of the two dates. - * - * @param \Cake\Chronos\ChronosInterface $dt The instance to compare with. - * @return bool - */ - public function isBirthday(ChronosInterface $dt); - - /** - * Returns true this instance happened within the specified interval - * - * @param string|int $timeInterval the numeric value with space then time type. - * Example of valid types: 6 hours, 2 days, 1 minute. - * @return bool - */ - public function wasWithinLast($timeInterval); - - /** - * Returns true this instance will happen within the specified interval - * - * @param string|int $timeInterval the numeric value with space then time type. - * Example of valid types: 6 hours, 2 days, 1 minute. - * @return bool - */ - public function isWithinNext($timeInterval); - - /** - * Check if instance of ChronosInterface is mutable. - * - * @return bool - */ - public function isMutable(); -} diff --git a/vendor/cakephp/chronos/src/ChronosInterval.php b/vendor/cakephp/chronos/src/ChronosInterval.php deleted file mode 100644 index a10d934..0000000 --- a/vendor/cakephp/chronos/src/ChronosInterval.php +++ /dev/null @@ -1,514 +0,0 @@ - - * @link http://cakephp.org CakePHP(tm) Project - * @license http://www.opensource.org/licenses/mit-license.php MIT License - */ -namespace Cake\Chronos; - -use DateInterval; -use InvalidArgumentException; - -/** - * A simple API extension for DateInterval. - * The implementation provides helpers to handle weeks but only days are saved. - * Weeks are calculated based on the total days of the current instance. - * - * @property int $years Total years of the current interval. - * @property int $months Total months of the current interval. - * @property int $weeks Total weeks of the current interval calculated from the days. - * @property int $dayz Total days of the current interval (weeks * 7 + days). - * @property int $hours Total hours of the current interval. - * @property int $minutes Total minutes of the current interval. - * @property int $seconds Total seconds of the current interval. - * - * @property-read int $dayzExcludeWeeks Total days remaining in the final week of the current instance (days % 7). - * @property-read int $daysExcludeWeeks alias of dayzExcludeWeeks - * - * @method static ChronosInterval years($years = 1) Create instance specifying a number of years. - * @method static ChronosInterval year($years = 1) Alias for years - * @method static ChronosInterval months($months = 1) Create instance specifying a number of months. - * @method static ChronosInterval month($months = 1) Alias for months - * @method static ChronosInterval weeks($weeks = 1) Create instance specifying a number of weeks. - * @method static ChronosInterval week($weeks = 1) Alias for weeks - * @method static ChronosInterval days($days = 1) Create instance specifying a number of days. - * @method static ChronosInterval dayz($days = 1) Alias for days - * @method static ChronosInterval day($days = 1) Alias for days - * @method static ChronosInterval hours($hours = 1) Create instance specifying a number of hours. - * @method static ChronosInterval hour($hours = 1) Alias for hours - * @method static ChronosInterval minutes($minutes = 1) Create instance specifying a number of minutes. - * @method static ChronosInterval minute($minutes = 1) Alias for minutes - * @method static ChronosInterval seconds($seconds = 1) Create instance specifying a number of seconds. - * @method static ChronosInterval second($seconds = 1) Alias for seconds - * - * @method ChronosInterval years() years($years = 1) Set the years portion of the current interval. - * @method ChronosInterval year() year($years = 1) Alias for years. - * @method ChronosInterval months() months($months = 1) Set the months portion of the current interval. - * @method ChronosInterval month() month($months = 1) Alias for months. - * @method ChronosInterval weeks() weeks($weeks = 1) Set the weeks portion of the current interval. Will overwrite dayz value. - * @method ChronosInterval week() week($weeks = 1) Alias for weeks. - * @method ChronosInterval days() days($days = 1) Set the days portion of the current interval. - * @method ChronosInterval dayz() dayz($days = 1) Alias for days. - * @method ChronosInterval day() day($days = 1) Alias for days. - * @method ChronosInterval hours() hours($hours = 1) Set the hours portion of the current interval. - * @method ChronosInterval hour() hour($hours = 1) Alias for hours. - * @method ChronosInterval minutes() minutes($minutes = 1) Set the minutes portion of the current interval. - * @method ChronosInterval minute() minute($minutes = 1) Alias for minutes. - * @method ChronosInterval seconds() seconds($seconds = 1) Set the seconds portion of the current interval. - * @method ChronosInterval second() second($seconds = 1) Alias for seconds. - */ -class ChronosInterval extends DateInterval -{ - /** - * Interval spec period designators - */ - const PERIOD_PREFIX = 'P'; - const PERIOD_YEARS = 'Y'; - const PERIOD_MONTHS = 'M'; - const PERIOD_DAYS = 'D'; - const PERIOD_TIME_PREFIX = 'T'; - const PERIOD_HOURS = 'H'; - const PERIOD_MINUTES = 'M'; - const PERIOD_SECONDS = 'S'; - - /** - * Before PHP 5.4.20/5.5.4 instead of `false` days will be set to -99999 when the interval instance - * was created by DateTime:diff(). - */ - const PHP_DAYS_FALSE = -99999; - - /** - * Determine if the interval was created via DateTime:diff() or not. - * - * @param \DateInterval $interval The interval to check. - * @return bool - */ - protected static function wasCreatedFromDiff(DateInterval $interval) - { - return ($interval->days !== false && $interval->days !== static::PHP_DAYS_FALSE); - } - - /** - * Create a new ChronosInterval instance. - * - * @param int|null $years The year to use. - * @param int|null $months The month to use. - * @param int|null $weeks The week to use. - * @param int|null $days The day to use. - * @param int|null $hours The hours to use. - * @param int|null $minutes The minutes to use. - * @param int|null $seconds The seconds to use. - */ - public function __construct($years = 1, $months = null, $weeks = null, $days = null, $hours = null, $minutes = null, $seconds = null) - { - $spec = static::PERIOD_PREFIX; - - $spec .= $years > 0 ? $years . static::PERIOD_YEARS : ''; - $spec .= $months > 0 ? $months . static::PERIOD_MONTHS : ''; - - $specDays = 0; - $specDays += $weeks > 0 ? $weeks * ChronosInterface::DAYS_PER_WEEK : 0; - $specDays += $days > 0 ? $days : 0; - - $spec .= ($specDays > 0) ? $specDays . static::PERIOD_DAYS : ''; - - if ($spec === static::PERIOD_PREFIX) { - $spec .= '0' . static::PERIOD_YEARS; - } - - if ($hours > 0 || $minutes > 0 || $seconds > 0) { - $spec .= static::PERIOD_TIME_PREFIX; - $spec .= $hours > 0 ? $hours . static::PERIOD_HOURS : ''; - $spec .= $minutes > 0 ? $minutes . static::PERIOD_MINUTES : ''; - $spec .= $seconds > 0 ? $seconds . static::PERIOD_SECONDS : ''; - } - - parent::__construct($spec); - } - - /** - * Create a new ChronosInterval instance from specific values. - * This is an alias for the constructor that allows better fluent - * syntax as it allows you to do ChronosInterval::create(1)->fn() rather than - * (new ChronosInterval(1))->fn(). - * - * @param int|null $years The year to use. - * @param int|null $months The month to use. - * @param int|null $weeks The week to use. - * @param int|null $days The day to use. - * @param int|null $hours The hours to use. - * @param int|null $minutes The minutes to use. - * @param int|null $seconds The seconds to use. - * @return static - */ - public static function create($years = 1, $months = null, $weeks = null, $days = null, $hours = null, $minutes = null, $seconds = null) - { - return new static($years, $months, $weeks, $days, $hours, $minutes, $seconds); - } - - /** - * Provide static helpers to create instances. Allows: - * - * ``` - * ChronosInterval::years(3) - * // or - * ChronosInterval::month(1); - * ``` - * - * Note: This is done using the magic method to allow static and instance methods to - * have the same names. - * - * @param string $name The property to configure. Accepts singular and plural forms. - * @param array $args Contains the value to use. - * @return static - */ - public static function __callStatic($name, $args) - { - $arg = count($args) === 0 ? 1 : $args[0]; - - switch ($name) { - case 'years': - case 'year': - return new static($arg); - - case 'months': - case 'month': - return new static(null, $arg); - - case 'weeks': - case 'week': - return new static(null, null, $arg); - - case 'days': - case 'dayz': - case 'day': - return new static(null, null, null, $arg); - - case 'hours': - case 'hour': - return new static(null, null, null, null, $arg); - - case 'minutes': - case 'minute': - return new static(null, null, null, null, null, $arg); - - case 'seconds': - case 'second': - return new static(null, null, null, null, null, null, $arg); - } - } - - /** - * Create a ChronosInterval instance from a DateInterval one. Can not instance - * DateInterval objects created from DateTime::diff() as you can't externally - * set the $days field. - * - * @param \DateInterval $di The DateInterval instance to copy. - * @throws \InvalidArgumentException - * @return static - */ - public static function instance(DateInterval $di) - { - if (static::wasCreatedFromDiff($di)) { - throw new InvalidArgumentException( - "Can not instance a DateInterval object created from DateTime::diff()." - ); - } - - $instance = new static($di->y, $di->m, 0, $di->d, $di->h, $di->i, $di->s); - $instance->invert = $di->invert; - $instance->days = $di->days; - - return $instance; - } - - /** - * Get a part of the ChronosInterval object - * - * @param string $name The property to read. - * @throws \InvalidArgumentException - * @return int - */ - public function __get($name) - { - switch ($name) { - case 'years': - return $this->y; - - case 'months': - return $this->m; - - case 'dayz': - return $this->d; - - case 'hours': - return $this->h; - - case 'minutes': - return $this->i; - - case 'seconds': - return $this->s; - - case 'weeks': - return (int)floor($this->d / ChronosInterface::DAYS_PER_WEEK); - - case 'daysExcludeWeeks': - case 'dayzExcludeWeeks': - return $this->dayz % ChronosInterface::DAYS_PER_WEEK; - case 'days': - return $this->days; - case 'y': - case 'm': - case 'd': - case 'h': - case 'i': - case 's': - case 'invert': - return parent::__get($name); - default: - throw new InvalidArgumentException(sprintf("Unknown getter '%s'", $name)); - } - } - - /** - * Set a part of the ChronosInterval object - * - * @param string $name The property to augment. - * @param int $val The value to change. - * @return void - * @throws \InvalidArgumentException - */ - public function __set($name, $val) - { - switch ($name) { - case 'years': - $this->y = $val; - break; - - case 'months': - $this->m = $val; - break; - - case 'weeks': - $val = $val * ChronosInterface::DAYS_PER_WEEK; - $this->d = $val; - break; - - case 'dayz': - $this->d = $val; - break; - - case 'hours': - $this->h = $val; - break; - - case 'minutes': - $this->i = $val; - break; - - case 'seconds': - $this->s = $val; - break; - - case 'invert': - $this->invert = $val; - break; - } - } - - /** - * Allow setting of weeks and days to be cumulative. - * - * @param int $weeks Number of weeks to set - * @param int $days Number of days to set - * @return static - */ - public function weeksAndDays($weeks, $days) - { - $this->dayz = ($weeks * ChronosInterface::DAYS_PER_WEEK) + $days; - - return $this; - } - - /** - * Allow fluent calls on the setters... ChronosInterval::years(3)->months(5)->day(). - * - * Note: This is done using the magic method to allow static and instance methods to - * have the same names. - * - * @param string $name The property name to augment. Accepts plural forms in addition - * to singular ones. - * @param array $args The value to set. - * @return static - */ - public function __call($name, $args) - { - $arg = count($args) === 0 ? 1 : $args[0]; - - switch ($name) { - case 'years': - case 'year': - $this->years = $arg; - break; - - case 'months': - case 'month': - $this->months = $arg; - break; - - case 'weeks': - case 'week': - $this->dayz = $arg * ChronosInterface::DAYS_PER_WEEK; - break; - - case 'days': - case 'dayz': - case 'day': - $this->dayz = $arg; - break; - - case 'hours': - case 'hour': - $this->hours = $arg; - break; - - case 'minutes': - case 'minute': - $this->minutes = $arg; - break; - - case 'seconds': - case 'second': - $this->seconds = $arg; - break; - } - - return $this; - } - - /** - * Add the passed interval to the current instance - * - * @param \DateInterval $interval The interval to add. - * @return static - */ - public function add(DateInterval $interval) - { - $sign = ($interval->invert === 1) ? -1 : 1; - - if (static::wasCreatedFromDiff($interval)) { - $this->dayz = $this->dayz + ($interval->days * $sign); - } else { - $this->years = $this->years + ($interval->y * $sign); - $this->months = $this->months + ($interval->m * $sign); - $this->dayz = $this->dayz + ($interval->d * $sign); - $this->hours = $this->hours + ($interval->h * $sign); - $this->minutes = $this->minutes + ($interval->i * $sign); - $this->seconds = $this->seconds + ($interval->s * $sign); - } - - return $this; - } - - /** - * Returns the ISO 8601 interval string. - * - * @return string Interval as string representation - */ - public function __toString() - { - // equivalence - $oneMinuteInSeconds = 60; - $oneHourInSeconds = $oneMinuteInSeconds * 60; - $oneDayInSeconds = $oneHourInSeconds * 24; - $oneMonthInDays = 365 / 12; - $oneMonthInSeconds = $oneDayInSeconds * $oneMonthInDays; - $oneYearInSeconds = 12 * $oneMonthInSeconds; - - // convert - $ySecs = $this->y * $oneYearInSeconds; - $mSecs = $this->m * $oneMonthInSeconds; - $dSecs = $this->d * $oneDayInSeconds; - $hSecs = $this->h * $oneHourInSeconds; - $iSecs = $this->i * $oneMinuteInSeconds; - $sSecs = $this->s; - - $totalSecs = $ySecs + $mSecs + $dSecs + $hSecs + $iSecs + $sSecs; - - $y = null; - $m = null; - $d = null; - $h = null; - $i = null; - - // years - if ($totalSecs >= $oneYearInSeconds) { - $y = floor($totalSecs / $oneYearInSeconds); - $totalSecs = $totalSecs - $y * $oneYearInSeconds; - } - - // months - if ($totalSecs >= $oneMonthInSeconds) { - $m = floor($totalSecs / $oneMonthInSeconds); - $totalSecs = $totalSecs - $m * $oneMonthInSeconds; - } - - // days - if ($totalSecs >= $oneDayInSeconds) { - $d = floor($totalSecs / $oneDayInSeconds); - $totalSecs = $totalSecs - $d * $oneDayInSeconds; - } - - // hours - if ($totalSecs >= $oneHourInSeconds) { - $h = floor($totalSecs / $oneHourInSeconds); - $totalSecs = $totalSecs - $h * $oneHourInSeconds; - } - - // minutes - if ($totalSecs >= $oneMinuteInSeconds) { - $i = floor($totalSecs / $oneMinuteInSeconds); - $totalSecs = $totalSecs - $i * $oneMinuteInSeconds; - } - - $s = $totalSecs; - - $date = array_filter([ - static::PERIOD_YEARS => $y, - static::PERIOD_MONTHS => $m, - static::PERIOD_DAYS => $d, - ]); - - $time = array_filter([ - static::PERIOD_HOURS => $h, - static::PERIOD_MINUTES => $i, - static::PERIOD_SECONDS => $s, - ]); - - $specString = static::PERIOD_PREFIX; - - foreach ($date as $key => $value) { - $specString .= $value . $key; - } - - if (count($time) > 0) { - $specString .= static::PERIOD_TIME_PREFIX; - foreach ($time as $key => $value) { - $specString .= $value . $key; - } - } - - if ($specString === static::PERIOD_PREFIX) { - return 'PT0S'; - } - - return $this->invert === 1 ? '-' . $specString : $specString; - } -} diff --git a/vendor/cakephp/chronos/src/Date.php b/vendor/cakephp/chronos/src/Date.php deleted file mode 100644 index 711d452..0000000 --- a/vendor/cakephp/chronos/src/Date.php +++ /dev/null @@ -1,143 +0,0 @@ -stripTime($time); - - parent::__construct($time, $tz); - - return; - } - - $relative = static::hasRelativeKeywords($time); - if (!empty($time) && $time !== 'now' && !$relative) { - $time = $this->stripTime($time); - - parent::__construct($time, $tz); - - return; - } - - $testNow = clone $testNow; - if ($relative) { - $time = $this->stripRelativeTime($time); - if (strlen($time) > 0) { - $testNow = $testNow->modify($time); - } - } - - if ($tz !== $testNow->getTimezone()) { - $testNow = $testNow->setTimezone($tz === null ? date_default_timezone_get() : $tz); - } - - $time = $testNow->format('Y-m-d 00:00:00'); - parent::__construct($time, $tz); - } - - /** - * Create a new mutable instance from current immutable instance. - * - * @return \Cake\Chronos\MutableDate - */ - public function toMutable() - { - return MutableDate::instance($this); - } - - /** - * Return properties for debugging. - * - * @return array - */ - public function __debugInfo() - { - $properties = [ - 'hasFixedNow' => static::hasTestNow(), - 'date' => $this->format('Y-m-d'), - ]; - - return $properties; - } -} diff --git a/vendor/cakephp/chronos/src/DifferenceFormatter.php b/vendor/cakephp/chronos/src/DifferenceFormatter.php deleted file mode 100644 index d64db63..0000000 --- a/vendor/cakephp/chronos/src/DifferenceFormatter.php +++ /dev/null @@ -1,103 +0,0 @@ - - * @link http://cakephp.org CakePHP(tm) Project - * @license http://www.opensource.org/licenses/mit-license.php MIT License - */ -namespace Cake\Chronos; - -/** - * Handles formatting differences in text. - * - * Provides a swappable component for other libraries to leverage. - * when localizing or customizing the difference output. - */ -class DifferenceFormatter -{ - - /** - * The text translator object - * - * @var \Cake\Chronos\Translator - */ - protected $translate; - - /** - * Constructor. - * - * @param \Cake\Chronos\Translator|null $translate The text translator object. - */ - public function __construct($translate = null) - { - $this->translate = $translate ?: new Translator(); - } - - /** - * Get the difference in a human readable format. - * - * @param \Cake\Chronos\ChronosInterface $date The datetime to start with. - * @param \Cake\Chronos\ChronosInterface|null $other The datetime to compare against. - * @param bool $absolute removes time difference modifiers ago, after, etc - * @return string The difference between the two days in a human readable format - * @see \Cake\Chronos\ChronosInterface::diffForHumans - */ - public function diffForHumans(ChronosInterface $date, ChronosInterface $other = null, $absolute = false) - { - $isNow = $other === null; - if ($isNow) { - $other = $date->now($date->tz); - } - $diffInterval = $date->diff($other); - - switch (true) { - case ($diffInterval->y > 0): - $unit = 'year'; - $count = $diffInterval->y; - break; - case ($diffInterval->m > 0): - $unit = 'month'; - $count = $diffInterval->m; - break; - case ($diffInterval->d > 0): - $unit = 'day'; - $count = $diffInterval->d; - if ($count >= ChronosInterface::DAYS_PER_WEEK) { - $unit = 'week'; - $count = (int)($count / ChronosInterface::DAYS_PER_WEEK); - } - break; - case ($diffInterval->h > 0): - $unit = 'hour'; - $count = $diffInterval->h; - break; - case ($diffInterval->i > 0): - $unit = 'minute'; - $count = $diffInterval->i; - break; - default: - $count = $diffInterval->s; - $unit = 'second'; - break; - } - $time = $this->translate->plural($unit, $count, ['count' => $count]); - if ($absolute) { - return $time; - } - $isFuture = $diffInterval->invert === 1; - $transId = $isNow ? ($isFuture ? 'from_now' : 'ago') : ($isFuture ? 'after' : 'before'); - - // Some langs have special pluralization for past and future tense. - $tryKeyExists = $unit . '_' . $transId; - if ($this->translate->exists($tryKeyExists)) { - $time = $this->translate->plural($tryKeyExists, $count, ['count' => $count]); - } - - return $this->translate->singular($transId, ['time' => $time]); - } -} diff --git a/vendor/cakephp/chronos/src/MutableDate.php b/vendor/cakephp/chronos/src/MutableDate.php deleted file mode 100644 index 3efaf73..0000000 --- a/vendor/cakephp/chronos/src/MutableDate.php +++ /dev/null @@ -1,142 +0,0 @@ -stripTime($time); - parent::__construct($time, $tz); - - return; - } - - $relative = static::hasRelativeKeywords($time); - if (!empty($time) && $time !== 'now' && !$relative) { - $time = $this->stripTime($time); - - parent::__construct($time, $tz); - - return; - } - - $testNow = clone $testNow; - if ($relative) { - $time = $this->stripRelativeTime($time); - if (strlen($time) > 0) { - $testNow = $testNow->modify($time); - } - } - - if ($tz !== $testNow->getTimezone()) { - $testNow = $testNow->setTimezone($tz === null ? date_default_timezone_get() : $tz); - } - - $time = $testNow->format('Y-m-d 00:00:00'); - parent::__construct($time, $tz); - } - - /** - * Create a new immutable instance from current mutable instance. - * - * @return \Cake\Chronos\Date - */ - public function toImmutable() - { - return Date::instance($this); - } - - /** - * Return properties for debugging. - * - * @return array - */ - public function __debugInfo() - { - $properties = [ - 'hasFixedNow' => static::hasTestNow(), - 'date' => $this->format('Y-m-d'), - ]; - - return $properties; - } -} diff --git a/vendor/cakephp/chronos/src/MutableDateTime.php b/vendor/cakephp/chronos/src/MutableDateTime.php deleted file mode 100644 index 4afa460..0000000 --- a/vendor/cakephp/chronos/src/MutableDateTime.php +++ /dev/null @@ -1,186 +0,0 @@ - - * @link http://cakephp.org CakePHP(tm) Project - * @license http://www.opensource.org/licenses/mit-license.php MIT License - */ -namespace Cake\Chronos; - -use DateTime; -use DateTimeZone; -use InvalidArgumentException; - -/** - * A mutable datetime instance that implements the ChronosInterface. - * - * This object can be mutated in place using any setter method, - * or __set(). - * - * @property int $year - * @property int $yearIso - * @property int $month - * @property int $day - * @property int $hour - * @property int $minute - * @property int $second - * @property int $timestamp seconds since the Unix Epoch - * @property DateTimeZone|string $timezone the current timezone - * @property DateTimeZone|string $tz alias of timezone - * @property int $micro - * @property-read int $dayOfWeek 1 (for Monday) through 7 (for Sunday) - * @property-read int $dayOfYear 0 through 365 - * @property-read int $weekOfMonth 1 through 5 - * @property-read int $weekOfYear ISO-8601 week number of year, weeks starting on Monday - * @property-read int $daysInMonth number of days in the given month - * @property-read int $age does a diffInYears() with default parameters - * @property-read int $quarter the quarter of this instance, 1 - 4 - * @property-read int $offset the timezone offset in seconds from UTC - * @property-read int $offsetHours the timezone offset in hours from UTC - * @property-read bool $dst daylight savings time indicator, true if DST, false otherwise - * @property-read bool $local checks if the timezone is local, true if local, false otherwise - * @property-read bool $utc checks if the timezone is UTC, true if UTC, false otherwise - * @property-read string $timezoneName - * @property-read string $tzName - */ -class MutableDateTime extends DateTime implements ChronosInterface -{ - use Traits\ComparisonTrait; - use Traits\DifferenceTrait; - use Traits\FactoryTrait; - use Traits\FormattingTrait; - use Traits\MagicPropertyTrait; - use Traits\ModifierTrait; - use Traits\RelativeKeywordTrait; - use Traits\TestingAidTrait; - use Traits\TimezoneTrait; - - /** - * Format to use for __toString method when type juggling occurs. - * - * @var string - */ - protected static $toStringFormat = ChronosInterface::DEFAULT_TO_STRING_FORMAT; - - /** - * Create a new MutableDateTime instance. - * - * Please see the testing aids section (specifically static::setTestNow()) - * for more on the possibility of this constructor returning a test instance. - * - * @param string|null $time Fixed or relative time - * @param \DateTimeZone|string|null $tz The timezone for the instance - */ - public function __construct($time = 'now', $tz = null) - { - if ($tz !== null) { - $tz = $tz instanceof DateTimeZone ? $tz : new DateTimeZone($tz); - } - - $testNow = Chronos::getTestNow(); - if ($testNow === null) { - parent::__construct($time === null ? 'now' : $time, $tz); - - return; - } - - $relative = static::hasRelativeKeywords($time); - if (!empty($time) && $time !== 'now' && !$relative) { - parent::__construct($time, $tz); - - return; - } - - $testNow = clone $testNow; - if ($relative) { - $testNow = $testNow->modify($time); - } - - $relativetime = static::isTimeExpression($time); - if (!$relativetime && $tz !== $testNow->getTimezone()) { - $testNow = $testNow->setTimezone($tz === null ? date_default_timezone_get() : $tz); - } - $time = $testNow->format('Y-m-d H:i:s.u'); - parent::__construct($time, $tz); - } - - /** - * Create a new immutable instance from current mutable instance. - * - * @return Chronos - */ - public function toImmutable() - { - return Chronos::instance($this); - } - - /** - * Set a part of the ChronosInterface object - * - * @param string $name The property to set. - * @param string|int|\DateTimeZone $value The value to set. - * @throws \InvalidArgumentException - * @return void - */ - public function __set($name, $value) - { - switch ($name) { - case 'year': - $this->year($value); - break; - - case 'month': - $this->month($value); - break; - - case 'day': - $this->day($value); - break; - - case 'hour': - $this->hour($value); - break; - - case 'minute': - $this->minute($value); - break; - - case 'second': - $this->second($value); - break; - - case 'timestamp': - $this->timestamp($value); - break; - - case 'timezone': - case 'tz': - $this->timezone($value); - break; - - default: - throw new InvalidArgumentException(sprintf("Unknown setter '%s'", $name)); - } - } - - /** - * Return properties for debugging. - * - * @return array - */ - public function __debugInfo() - { - $properties = [ - 'hasFixedNow' => static::hasTestNow(), - 'time' => $this->format('Y-m-d H:i:s.u'), - 'timezone' => $this->getTimezone()->getName(), - ]; - - return $properties; - } -} diff --git a/vendor/cakephp/chronos/src/Traits/ComparisonTrait.php b/vendor/cakephp/chronos/src/Traits/ComparisonTrait.php deleted file mode 100644 index eeeb98b..0000000 --- a/vendor/cakephp/chronos/src/Traits/ComparisonTrait.php +++ /dev/null @@ -1,565 +0,0 @@ - - * @link http://cakephp.org CakePHP(tm) Project - * @license http://www.opensource.org/licenses/mit-license.php MIT License - */ -namespace Cake\Chronos\Traits; - -use Cake\Chronos\ChronosInterface; -use DateTime; - -/** - * Provides various comparison operator methods for datetime objects. - */ -trait ComparisonTrait -{ - use CopyTrait; - - /** - * Days of weekend - * - * @var array - */ - protected static $weekendDays = [ChronosInterface::SATURDAY, ChronosInterface::SUNDAY]; - - /** - * Get weekend days - * - * @return array - */ - public static function getWeekendDays() - { - return static::$weekendDays; - } - - /** - * Set weekend days - * - * @param array $days Which days are 'weekends'. - * @return void - */ - public static function setWeekendDays($days) - { - static::$weekendDays = $days; - } - - /** - * Determines if the instance is equal to another - * - * @param \Cake\Chronos\ChronosInterface $dt The instance to compare with. - * @return bool - */ - public function eq(ChronosInterface $dt) - { - return $this == $dt; - } - - /** - * Determines if the instance is equal to another - * - * @param \Cake\Chronos\ChronosInterface $dt The instance to compare with. - * @return bool - */ - public function equals(ChronosInterface $dt) - { - return $this->eq($dt); - } - - /** - * Determines if the instance is not equal to another - * - * @param \Cake\Chronos\ChronosInterface $dt The instance to compare with. - * @return bool - */ - public function ne(ChronosInterface $dt) - { - return !$this->eq($dt); - } - - /** - * Determines if the instance is not equal to another - * - * @param \Cake\Chronos\ChronosInterface $dt The instance to compare with. - * @return bool - */ - public function notEquals(ChronosInterface $dt) - { - return $this->ne($dt); - } - - /** - * Determines if the instance is greater (after) than another - * - * @param \Cake\Chronos\ChronosInterface $dt The instance to compare with. - * @return bool - */ - public function gt(ChronosInterface $dt) - { - return $this > $dt; - } - - /** - * Determines if the instance is greater (after) than another - * - * @param \Cake\Chronos\ChronosInterface $dt The instance to compare with. - * @return bool - */ - public function greaterThan(ChronosInterface $dt) - { - return $this->gt($dt); - } - - /** - * Determines if the instance is greater (after) than or equal to another - * - * @param \Cake\Chronos\ChronosInterface $dt The instance to compare with. - * @return bool - */ - public function gte(ChronosInterface $dt) - { - return $this >= $dt; - } - - /** - * Determines if the instance is greater (after) than or equal to another - * - * @param \Cake\Chronos\ChronosInterface $dt The instance to compare with. - * @return bool - */ - public function greaterThanOrEquals(ChronosInterface $dt) - { - return $this->gte($dt); - } - - /** - * Determines if the instance is less (before) than another - * - * @param \Cake\Chronos\ChronosInterface $dt The instance to compare with. - * @return bool - */ - public function lt(ChronosInterface $dt) - { - return $this < $dt; - } - - /** - * Determines if the instance is less (before) than another - * - * @param \Cake\Chronos\ChronosInterface $dt The instance to compare with. - * @return bool - */ - public function lessThan(ChronosInterface $dt) - { - return $this->lt($dt); - } - - /** - * Determines if the instance is less (before) or equal to another - * - * @param \Cake\Chronos\ChronosInterface $dt The instance to compare with. - * @return bool - */ - public function lte(ChronosInterface $dt) - { - return $this <= $dt; - } - - /** - * Determines if the instance is less (before) or equal to another - * - * @param \Cake\Chronos\ChronosInterface $dt The instance to compare with. - * @return bool - */ - public function lessThanOrEquals(ChronosInterface $dt) - { - return $this->lte($dt); - } - - /** - * Determines if the instance is between two others - * - * @param \Cake\Chronos\ChronosInterface $dt1 The instance to compare with. - * @param \Cake\Chronos\ChronosInterface $dt2 The instance to compare with. - * @param bool $equal Indicates if a > and < comparison should be used or <= or >= - * @return bool - */ - public function between(ChronosInterface $dt1, ChronosInterface $dt2, $equal = true) - { - if ($dt1->gt($dt2)) { - $temp = $dt1; - $dt1 = $dt2; - $dt2 = $temp; - } - - if ($equal) { - return $this->gte($dt1) && $this->lte($dt2); - } - - return $this->gt($dt1) && $this->lt($dt2); - } - - /** - * Get the closest date from the instance. - * - * @param \Cake\Chronos\ChronosInterface $dt1 The instance to compare with. - * @param \Cake\Chronos\ChronosInterface $dt2 The instance to compare with. - * @return \Cake\Chronos\ChronosInterface - */ - public function closest(ChronosInterface $dt1, ChronosInterface $dt2) - { - return $this->diffInSeconds($dt1) < $this->diffInSeconds($dt2) ? $dt1 : $dt2; - } - - /** - * Get the farthest date from the instance. - * - * @param \Cake\Chronos\ChronosInterface $dt1 The instance to compare with. - * @param \Cake\Chronos\ChronosInterface $dt2 The instance to compare with. - * @return \Cake\Chronos\ChronosInterface - */ - public function farthest(ChronosInterface $dt1, ChronosInterface $dt2) - { - return $this->diffInSeconds($dt1) > $this->diffInSeconds($dt2) ? $dt1 : $dt2; - } - - /** - * Get the minimum instance between a given instance (default now) and the current instance. - * - * @param \Cake\Chronos\ChronosInterface|null $dt The instance to compare with. - * @return \Cake\Chronos\ChronosInterface - */ - public function min(ChronosInterface $dt = null) - { - $dt = ($dt === null) ? static::now($this->tz) : $dt; - - return $this->lt($dt) ? $this : $dt; - } - - /** - * Get the maximum instance between a given instance (default now) and the current instance. - * - * @param \Cake\Chronos\ChronosInterface|null $dt The instance to compare with. - * @return \Cake\Chronos\ChronosInterface - */ - public function max(ChronosInterface $dt = null) - { - $dt = ($dt === null) ? static::now($this->tz) : $dt; - - return $this->gt($dt) ? $this : $dt; - } - - /** - * Determines if the instance is a weekday - * - * @return bool - */ - public function isWeekday() - { - return !$this->isWeekend(); - } - - /** - * Determines if the instance is a weekend day - * - * @return bool - */ - public function isWeekend() - { - return in_array($this->dayOfWeek, self::$weekendDays, true); - } - - /** - * Determines if the instance is yesterday - * - * @return bool - */ - public function isYesterday() - { - return $this->toDateString() === static::yesterday($this->tz)->toDateString(); - } - - /** - * Determines if the instance is today - * - * @return bool - */ - public function isToday() - { - return $this->toDateString() === static::now($this->tz)->toDateString(); - } - - /** - * Determines if the instance is tomorrow - * - * @return bool - */ - public function isTomorrow() - { - return $this->toDateString() === static::tomorrow($this->tz)->toDateString(); - } - - /** - * Determines if the instance is within the next week - * - * @return bool - */ - public function isNextWeek() - { - return $this->format('W o') === static::now($this->tz)->addWeek()->format('W o'); - } - - /** - * Determines if the instance is within the last week - * - * @return bool - */ - public function isLastWeek() - { - return $this->format('W o') === static::now($this->tz)->subWeek()->format('W o'); - } - - /** - * Determines if the instance is within the next month - * - * @return bool - */ - public function isNextMonth() - { - return $this->format('m Y') === static::now($this->tz)->addMonth()->format('m Y'); - } - - /** - * Determines if the instance is within the last month - * - * @return bool - */ - public function isLastMonth() - { - return $this->format('m Y') === static::now($this->tz)->subMonth()->format('m Y'); - } - - /** - * Determines if the instance is within the next year - * - * @return bool - */ - public function isNextYear() - { - return $this->year === static::now($this->tz)->addYear()->year; - } - - /** - * Determines if the instance is within the last year - * - * @return bool - */ - public function isLastYear() - { - return $this->year === static::now($this->tz)->subYear()->year; - } - - /** - * Determines if the instance is in the future, ie. greater (after) than now - * - * @return bool - */ - public function isFuture() - { - return $this->gt(static::now($this->tz)); - } - - /** - * Determines if the instance is in the past, ie. less (before) than now - * - * @return bool - */ - public function isPast() - { - return $this->lt(static::now($this->tz)); - } - - /** - * Determines if the instance is a leap year - * - * @return bool - */ - public function isLeapYear() - { - return $this->format('L') === '1'; - } - - /** - * Checks if the passed in date is the same day as the instance current day. - * - * @param \Cake\Chronos\ChronosInterface $dt The instance to check against. - * @return bool - */ - public function isSameDay(ChronosInterface $dt) - { - return $this->toDateString() === $dt->toDateString(); - } - - /** - * Checks if this day is a Sunday. - * - * @return bool - */ - public function isSunday() - { - return $this->dayOfWeek === ChronosInterface::SUNDAY; - } - - /** - * Checks if this day is a Monday. - * - * @return bool - */ - public function isMonday() - { - return $this->dayOfWeek === ChronosInterface::MONDAY; - } - - /** - * Checks if this day is a Tuesday. - * - * @return bool - */ - public function isTuesday() - { - return $this->dayOfWeek === ChronosInterface::TUESDAY; - } - - /** - * Checks if this day is a Wednesday. - * - * @return bool - */ - public function isWednesday() - { - return $this->dayOfWeek === ChronosInterface::WEDNESDAY; - } - - /** - * Checks if this day is a Thursday. - * - * @return bool - */ - public function isThursday() - { - return $this->dayOfWeek === ChronosInterface::THURSDAY; - } - - /** - * Checks if this day is a Friday. - * - * @return bool - */ - public function isFriday() - { - return $this->dayOfWeek === ChronosInterface::FRIDAY; - } - - /** - * Checks if this day is a Saturday. - * - * @return bool - */ - public function isSaturday() - { - return $this->dayOfWeek === ChronosInterface::SATURDAY; - } - - /** - * Returns true if this object represents a date within the current week - * - * @return bool - */ - public function isThisWeek() - { - return static::now($this->getTimezone())->format('W o') === $this->format('W o'); - } - - /** - * Returns true if this object represents a date within the current month - * - * @return bool - */ - public function isThisMonth() - { - return static::now($this->getTimezone())->format('m Y') === $this->format('m Y'); - } - - /** - * Returns true if this object represents a date within the current year - * - * @return bool - */ - public function isThisYear() - { - return static::now($this->getTimezone())->format('Y') === $this->format('Y'); - } - - /** - * Check if its the birthday. Compares the date/month values of the two dates. - * - * @param \Cake\Chronos\ChronosInterface|null $dt The instance to compare with or null to use current day. - * @return bool - */ - public function isBirthday(ChronosInterface $dt = null) - { - if ($dt === null) { - $dt = static::now($this->tz); - } - - return $this->format('md') === $dt->format('md'); - } - - /** - * Returns true this instance happened within the specified interval - * - * @param string|int $timeInterval the numeric value with space then time type. - * Example of valid types: 6 hours, 2 days, 1 minute. - * @return bool - */ - public function wasWithinLast($timeInterval) - { - $now = new static(); - $interval = $now->copy()->modify('-' . $timeInterval); - $thisTime = $this->format('U'); - - return $thisTime >= $interval->format('U') && $thisTime <= $now->format('U'); - } - - /** - * Returns true this instance will happen within the specified interval - * - * @param string|int $timeInterval the numeric value with space then time type. - * Example of valid types: 6 hours, 2 days, 1 minute. - * @return bool - */ - public function isWithinNext($timeInterval) - { - $now = new static(); - $interval = $now->copy()->modify('+' . $timeInterval); - $thisTime = $this->format('U'); - - return $thisTime <= $interval->format('U') && $thisTime >= $now->format('U'); - } - - /** - * Check if instance of ChronosInterface is mutable. - * - * @return bool - */ - public function isMutable() - { - return $this instanceof DateTime; - } -} diff --git a/vendor/cakephp/chronos/src/Traits/CopyTrait.php b/vendor/cakephp/chronos/src/Traits/CopyTrait.php deleted file mode 100644 index bed0daa..0000000 --- a/vendor/cakephp/chronos/src/Traits/CopyTrait.php +++ /dev/null @@ -1,31 +0,0 @@ - - * @link http://cakephp.org CakePHP(tm) Project - * @license http://www.opensource.org/licenses/mit-license.php MIT License - */ -namespace Cake\Chronos\Traits; - -/** - * Provides methods for copying datetime objects. - * - * Expects that implementing classes provide a static `instance()` method. - */ -trait CopyTrait -{ - /** - * Get a copy of the instance - * - * @return static - */ - public function copy() - { - return static::instance($this); - } -} diff --git a/vendor/cakephp/chronos/src/Traits/DifferenceTrait.php b/vendor/cakephp/chronos/src/Traits/DifferenceTrait.php deleted file mode 100644 index f25fdcb..0000000 --- a/vendor/cakephp/chronos/src/Traits/DifferenceTrait.php +++ /dev/null @@ -1,302 +0,0 @@ - - * @link http://cakephp.org CakePHP(tm) Project - * @license http://www.opensource.org/licenses/mit-license.php MIT License - */ -namespace Cake\Chronos\Traits; - -use Cake\Chronos\ChronosInterface; -use Cake\Chronos\ChronosInterval; -use Cake\Chronos\DifferenceFormatter; -use DatePeriod; -use DateTimeImmutable; -use DateTimeInterface; - -/** - * Provides methods for getting differences between datetime objects. - * - * Expects that the implementing class implements: - * - * - static::now() - * - static::instance() - * - copy() - */ -trait DifferenceTrait -{ - /** - * Instance of the diff formatting object. - * - * @var \Cake\Chronos\DifferenceFormatter - */ - protected static $diffFormatter; - - /** - * Get the difference in years - * - * @param \Cake\Chronos\ChronosInterface|null $dt The instance to difference from. - * @param bool $abs Get the absolute of the difference - * @return int - */ - public function diffInYears(ChronosInterface $dt = null, $abs = true) - { - $dt = $dt === null ? static::now($this->tz) : $dt; - - return (int)$this->diff($dt, $abs)->format('%r%y'); - } - - /** - * Get the difference in months - * - * @param \Cake\Chronos\ChronosInterface|null $dt The instance to difference from. - * @param bool $abs Get the absolute of the difference - * @return int - */ - public function diffInMonths(ChronosInterface $dt = null, $abs = true) - { - $dt = $dt === null ? static::now($this->tz) : $dt; - - return $this->diffInYears($dt, $abs) * ChronosInterface::MONTHS_PER_YEAR + (int)$this->diff($dt, $abs)->format('%r%m'); - } - - /** - * Get the difference in weeks - * - * @param \Cake\Chronos\ChronosInterface|null $dt The instance to difference from. - * @param bool $abs Get the absolute of the difference - * @return int - */ - public function diffInWeeks(ChronosInterface $dt = null, $abs = true) - { - return (int)($this->diffInDays($dt, $abs) / ChronosInterface::DAYS_PER_WEEK); - } - - /** - * Get the difference in days - * - * @param \Cake\Chronos\ChronosInterface|null $dt The instance to difference from. - * @param bool $abs Get the absolute of the difference - * @return int - */ - public function diffInDays(ChronosInterface $dt = null, $abs = true) - { - $dt = $dt === null ? static::now($this->tz) : $dt; - - return (int)$this->diff($dt, $abs)->format('%r%a'); - } - - /** - * Get the difference in days using a filter callable - * - * @param callable $callback The callback to use for filtering. - * @param \Cake\Chronos\ChronosInterface|null $dt The instance to difference from. - * @param bool $abs Get the absolute of the difference - * @return int - */ - public function diffInDaysFiltered(callable $callback, ChronosInterface $dt = null, $abs = true) - { - return $this->diffFiltered(ChronosInterval::day(), $callback, $dt, $abs); - } - - /** - * Get the difference in hours using a filter callable - * - * @param callable $callback The callback to use for filtering. - * @param \Cake\Chronos\ChronosInterface|null $dt The instance to difference from. - * @param bool $abs Get the absolute of the difference - * @return int - */ - public function diffInHoursFiltered(callable $callback, ChronosInterface $dt = null, $abs = true) - { - return $this->diffFiltered(ChronosInterval::hour(), $callback, $dt, $abs); - } - - /** - * Get the difference by the given interval using a filter callable - * - * @param \Cake\Chronos\ChronosInterval $ci An interval to traverse by - * @param callable $callback The callback to use for filtering. - * @param \Cake\Chronos\ChronosInterface|null $dt The instance to difference from. - * @param bool $abs Get the absolute of the difference - * @return int - */ - public function diffFiltered(ChronosInterval $ci, callable $callback, ChronosInterface $dt = null, $abs = true) - { - $start = $this; - $end = $dt === null ? static::now($this->tz) : $dt; - $inverse = false; - - if (defined('HHVM_VERSION')) { - $start = new DateTimeImmutable($this->toIso8601String()); - $end = new DateTimeImmutable($end->toIso8601String()); - } - - if ($end < $start) { - $start = $end; - $end = $this; - $inverse = true; - } - - $period = new DatePeriod($start, $ci, $end); - $vals = array_filter(iterator_to_array($period), function (DateTimeInterface $date) use ($callback) { - return $callback(static::instance($date)); - }); - - $diff = count($vals); - - return $inverse && !$abs ? -$diff : $diff; - } - - /** - * Get the difference in weekdays - * - * @param \Cake\Chronos\ChronosInterface|null $dt The instance to difference from. - * @param bool $abs Get the absolute of the difference - * @return int - */ - public function diffInWeekdays(ChronosInterface $dt = null, $abs = true) - { - return $this->diffInDaysFiltered(function (ChronosInterface $date) { - return $date->isWeekday(); - }, $dt, $abs); - } - - /** - * Get the difference in weekend days using a filter - * - * @param \Cake\Chronos\ChronosInterface|null $dt The instance to difference from. - * @param bool $abs Get the absolute of the difference - * @return int - */ - public function diffInWeekendDays(ChronosInterface $dt = null, $abs = true) - { - return $this->diffInDaysFiltered(function (ChronosInterface $date) { - return $date->isWeekend(); - }, $dt, $abs); - } - - /** - * Get the difference in hours - * - * @param \Cake\Chronos\ChronosInterface|null $dt The instance to difference from. - * @param bool $abs Get the absolute of the difference - * @return int - */ - public function diffInHours(ChronosInterface $dt = null, $abs = true) - { - return (int)($this->diffInSeconds($dt, $abs) / ChronosInterface::SECONDS_PER_MINUTE / ChronosInterface::MINUTES_PER_HOUR); - } - - /** - * Get the difference in minutes - * - * @param \Cake\Chronos\ChronosInterface|null $dt The instance to difference from. - * @param bool $abs Get the absolute of the difference - * @return int - */ - public function diffInMinutes(ChronosInterface $dt = null, $abs = true) - { - return (int)($this->diffInSeconds($dt, $abs) / ChronosInterface::SECONDS_PER_MINUTE); - } - - /** - * Get the difference in seconds - * - * @param \Cake\Chronos\ChronosInterface|null $dt The instance to difference from. - * @param bool $abs Get the absolute of the difference - * @return int - */ - public function diffInSeconds(ChronosInterface $dt = null, $abs = true) - { - $dt = ($dt === null) ? static::now($this->tz) : $dt; - $value = $dt->getTimestamp() - $this->getTimestamp(); - - return $abs ? abs($value) : $value; - } - - /** - * The number of seconds since midnight. - * - * @return int - */ - public function secondsSinceMidnight() - { - return $this->diffInSeconds($this->copy()->startOfDay()); - } - - /** - * The number of seconds until 23:59:59. - * - * @return int - */ - public function secondsUntilEndOfDay() - { - return $this->diffInSeconds($this->copy()->endOfDay()); - } - - /** - * Convenience method for getting the remaining time from a given time. - * - * @param \DateTime|\DateTimeImmutable $datetime The date to get the remaining time from. - * @return \DateInterval|bool The DateInterval object representing the difference between the two dates or FALSE on failure. - */ - public static function fromNow($datetime) - { - $timeNow = new static(); - - return $timeNow->diff($datetime); - } - - /** - * Get the difference in a human readable format. - * - * When comparing a value in the past to default now: - * 1 hour ago - * 5 months ago - * - * When comparing a value in the future to default now: - * 1 hour from now - * 5 months from now - * - * When comparing a value in the past to another value: - * 1 hour before - * 5 months before - * - * When comparing a value in the future to another value: - * 1 hour after - * 5 months after - * - * @param \Cake\Chronos\ChronosInterface|null $other The datetime to compare with. - * @param bool $absolute removes time difference modifiers ago, after, etc - * @return string - */ - public function diffForHumans(ChronosInterface $other = null, $absolute = false) - { - return static::diffFormatter()->diffForHumans($this, $other, $absolute); - } - - /** - * Get the difference formatter instance or overwrite the current one. - * - * @param \Cake\Chronos\DifferenceFormatter|null $formatter The formatter instance when setting. - * @return \Cake\Chronos\DifferenceFormatter The formatter instance. - */ - public static function diffFormatter($formatter = null) - { - if ($formatter === null) { - if (static::$diffFormatter === null) { - static::$diffFormatter = new DifferenceFormatter(); - } - - return static::$diffFormatter; - } - - return static::$diffFormatter = $formatter; - } -} diff --git a/vendor/cakephp/chronos/src/Traits/FactoryTrait.php b/vendor/cakephp/chronos/src/Traits/FactoryTrait.php deleted file mode 100644 index c9b1c33..0000000 --- a/vendor/cakephp/chronos/src/Traits/FactoryTrait.php +++ /dev/null @@ -1,335 +0,0 @@ - - * @link http://cakephp.org CakePHP(tm) Project - * @license http://www.opensource.org/licenses/mit-license.php MIT License - */ -namespace Cake\Chronos\Traits; - -use DateTimeInterface; -use DateTimeZone; -use InvalidArgumentException; - -/** - * Provides a number of datetime related factory methods. - */ -trait FactoryTrait -{ - /** - * Holds the last error generated by createFromFormat - * - * @var array - */ - protected static $_lastErrors = []; - - /** - * Create a ChronosInterface instance from a DateTimeInterface one - * - * @param \DateTimeInterface $dt The datetime instance to convert. - * @return static - */ - public static function instance(DateTimeInterface $dt) - { - if ($dt instanceof static) { - return clone $dt; - } - - return new static($dt->format('Y-m-d H:i:s.u'), $dt->getTimezone()); - } - - /** - * Create a ChronosInterface instance from a string. This is an alias for the - * constructor that allows better fluent syntax as it allows you to do - * ChronosInterface::parse('Monday next week')->fn() rather than - * (new Chronos('Monday next week'))->fn() - * - * @param \DateTimeInterface|string $time The strtotime compatible string to parse - * @param \DateTimeZone|string|null $tz The DateTimeZone object or timezone name. - * @return static - */ - public static function parse($time = 'now', $tz = null) - { - return new static($time, $tz); - } - - /** - * Get a ChronosInterface instance for the current date and time - * - * @param \DateTimeZone|string|null $tz The DateTimeZone object or timezone name. - * @return static - */ - public static function now($tz = null) - { - return new static('now', $tz); - } - - /** - * Create a ChronosInterface instance for today - * - * @param \DateTimeZone|string|null $tz The timezone to use. - * @return static - */ - public static function today($tz = null) - { - return new static('midnight', $tz); - } - - /** - * Create a ChronosInterface instance for tomorrow - * - * @param \DateTimeZone|string|null $tz The DateTimeZone object or timezone name the new instance should use. - * @return static - */ - public static function tomorrow($tz = null) - { - return new static('tomorrow, midnight', $tz); - } - - /** - * Create a ChronosInterface instance for yesterday - * - * @param \DateTimeZone|string|null $tz The DateTimeZone object or timezone name the new instance should use. - * @return static - */ - public static function yesterday($tz = null) - { - return new static('yesterday, midnight', $tz); - } - - /** - * Create a ChronosInterface instance for the greatest supported date. - * - * @return \Cake\Chronos\ChronosInterface - */ - public static function maxValue() - { - return static::createFromTimestampUTC(PHP_INT_MAX); - } - - /** - * Create a ChronosInterface instance for the lowest supported date. - * - * @return \Cake\Chronos\ChronosInterface - */ - public static function minValue() - { - $max = PHP_INT_SIZE === 4 ? PHP_INT_MAX : PHP_INT_MAX / 10; - - return static::createFromTimestampUTC(~$max); - } - - /** - * Create a new ChronosInterface instance from a specific date and time. - * - * If any of $year, $month or $day are set to null their now() values - * will be used. - * - * If $hour is null it will be set to its now() value and the default values - * for $minute and $second will be their now() values. - * If $hour is not null then the default values for $minute and $second - * will be 0. - * - * @param int|null $year The year to create an instance with. - * @param int|null $month The month to create an instance with. - * @param int|null $day The day to create an instance with. - * @param int|null $hour The hour to create an instance with. - * @param int|null $minute The minute to create an instance with. - * @param int|null $second The second to create an instance with. - * @param \DateTimeZone|string|null $tz The DateTimeZone object or timezone name the new instance should use. - * @return static - */ - public static function create($year = null, $month = null, $day = null, $hour = null, $minute = null, $second = null, $tz = null) - { - $year = ($year === null) ? date('Y') : $year; - $month = ($month === null) ? date('n') : $month; - $day = ($day === null) ? date('j') : $day; - - if ($hour === null) { - $hour = date('G'); - $minute = ($minute === null) ? date('i') : $minute; - $second = ($second === null) ? date('s') : $second; - } else { - $minute = ($minute === null) ? 0 : $minute; - $second = ($second === null) ? 0 : $second; - } - - $instance = static::createFromFormat('Y-n-j G:i:s', sprintf('%s-%s-%s %s:%02s:%02s', 0, $month, $day, $hour, $minute, $second), $tz); - - return $instance->addYears($year); - } - - /** - * Create a ChronosInterface instance from just a date. The time portion is set to now. - * - * @param int $year The year to create an instance with. - * @param int $month The month to create an instance with. - * @param int $day The day to create an instance with. - * @param \DateTimeZone|string|null $tz The DateTimeZone object or timezone name the new instance should use. - * @return static - */ - public static function createFromDate($year = null, $month = null, $day = null, $tz = null) - { - return static::create($year, $month, $day, null, null, null, $tz); - } - - /** - * Create a ChronosInterface instance from just a time. The date portion is set to today. - * - * @param int|null $hour The hour to create an instance with. - * @param int|null $minute The minute to create an instance with. - * @param int|null $second The second to create an instance with. - * @param \DateTimeZone|string|null $tz The DateTimeZone object or timezone name the new instance should use. - * @return static - */ - public static function createFromTime($hour = null, $minute = null, $second = null, $tz = null) - { - return static::create(null, null, null, $hour, $minute, $second, $tz); - } - - /** - * Create a ChronosInterface instance from a specific format - * - * @param string $format The date() compatible format string. - * @param string $time The formatted date string to interpret. - * @param \DateTimeZone|string|null $tz The DateTimeZone object or timezone name the new instance should use. - * @return static - * @throws \InvalidArgumentException - */ - public static function createFromFormat($format, $time, $tz = null) - { - if ($tz !== null) { - $dt = parent::createFromFormat($format, $time, static::safeCreateDateTimeZone($tz)); - } else { - $dt = parent::createFromFormat($format, $time); - } - - $errors = parent::getLastErrors(); - if ($dt == false) { - throw new InvalidArgumentException(implode(PHP_EOL, $errors['errors'])); - } - - $dt = static::instance($dt); - static::$_lastErrors = $errors; - - return $dt; - } - - /** - * Creates a ChronosInterface instance from an array of date and time values. - * - * The 'year', 'month' and 'day' values must all be set for a date. The time - * values all default to 0. - * - * The 'timezone' value can be any format supported by `\DateTimeZone`. - * - * Allowed values: - * - year - * - month - * - day - * - hour - * - minute - * - second - * - microsecond - * - meridian ('am' or 'pm') - * - timezone - * - * @param (int|string)[] $values Array of date and time values. - * @return static - */ - public static function createFromArray($values) - { - $values += ['hour' => 0, 'minute' => 0, 'second' => 0, 'microsecond' => 0, 'timezone' => null]; - - $formatted = ''; - if ( - isset($values['year'], $values['month'], $values['day']) && - ( - is_numeric($values['year']) && - is_numeric($values['month']) && - is_numeric($values['day']) - ) - ) { - $formatted .= sprintf('%04d-%02d-%02d ', $values['year'], $values['month'], $values['day']); - } - - if (isset($values['meridian']) && (int)$values['hour'] === 12) { - $values['hour'] = 0; - } - if (isset($values['meridian'])) { - $values['hour'] = strtolower($values['meridian']) === 'am' ? $values['hour'] : $values['hour'] + 12; - } - $formatted .= sprintf( - '%02d:%02d:%02d.%06d', - $values['hour'], - $values['minute'], - $values['second'], - $values['microsecond'] - ); - - return static::parse($formatted, $values['timezone']); - } - - /** - * Create a ChronosInterface instance from a timestamp - * - * @param int $timestamp The timestamp to create an instance from. - * @param \DateTimeZone|string|null $tz The DateTimeZone object or timezone name the new instance should use. - * @return static - */ - public static function createFromTimestamp($timestamp, $tz = null) - { - return static::now($tz)->setTimestamp($timestamp); - } - - /** - * Create a ChronosInterface instance from an UTC timestamp - * - * @param int $timestamp The UTC timestamp to create an instance from. - * @return static - */ - public static function createFromTimestampUTC($timestamp) - { - return new static('@' . $timestamp); - } - - /** - * Creates a DateTimeZone from a string or a DateTimeZone - * - * @param \DateTimeZone|string|null $object The value to convert. - * @return \DateTimeZone - * @throws \InvalidArgumentException - */ - protected static function safeCreateDateTimeZone($object) - { - if ($object === null) { - return new DateTimeZone(date_default_timezone_get()); - } - - if ($object instanceof DateTimeZone) { - return $object; - } - - return new DateTimeZone($object); - } - - /** - * Returns any errors or warnings that were found during the parsing - * of the last object created by this class. - * - * @return array - */ - public static function getLastErrors() - { - if (empty(static::$_lastErrors)) { - return parent::getLastErrors(); - } - - return static::$_lastErrors; - } -} diff --git a/vendor/cakephp/chronos/src/Traits/FormattingTrait.php b/vendor/cakephp/chronos/src/Traits/FormattingTrait.php deleted file mode 100644 index 1af15c5..0000000 --- a/vendor/cakephp/chronos/src/Traits/FormattingTrait.php +++ /dev/null @@ -1,259 +0,0 @@ - - * @link http://cakephp.org CakePHP(tm) Project - * @license http://www.opensource.org/licenses/mit-license.php MIT License - */ -namespace Cake\Chronos\Traits; - -use Cake\Chronos\ChronosInterface; -use DateTime; - -/** - * Provides string formatting methods for datetime instances. - * - * Expects implementing classes to define static::$toStringFormat - */ -trait FormattingTrait -{ - /** - * Reset the format used to the default when type juggling a ChronosInterface instance to a string - * - * @return void - */ - public static function resetToStringFormat() - { - static::setToStringFormat(ChronosInterface::DEFAULT_TO_STRING_FORMAT); - } - - /** - * Set the default format used when type juggling a ChronosInterface instance to a string - * - * @param string $format The format to use in future __toString() calls. - * @return void - */ - public static function setToStringFormat($format) - { - static::$toStringFormat = $format; - } - - /** - * Format the instance as a string using the set format - * - * @return string - */ - public function __toString() - { - return $this->format(static::$toStringFormat); - } - - /** - * Format the instance as date - * - * @return string - */ - public function toDateString() - { - return $this->format('Y-m-d'); - } - - /** - * Format the instance as a readable date - * - * @return string - */ - public function toFormattedDateString() - { - return $this->format('M j, Y'); - } - - /** - * Format the instance as time - * - * @return string - */ - public function toTimeString() - { - return $this->format('H:i:s'); - } - - /** - * Format the instance as date and time - * - * @return string - */ - public function toDateTimeString() - { - return $this->format('Y-m-d H:i:s'); - } - - /** - * Format the instance with day, date and time - * - * @return string - */ - public function toDayDateTimeString() - { - return $this->format('D, M j, Y g:i A'); - } - - /** - * Format the instance as ATOM - * - * @return string - */ - public function toAtomString() - { - return $this->format(DateTime::ATOM); - } - - /** - * Format the instance as COOKIE - * - * @return string - */ - public function toCookieString() - { - return $this->format(DateTime::COOKIE); - } - - /** - * Format the instance as ISO8601 - * - * @return string - */ - public function toIso8601String() - { - return $this->format(DateTime::ATOM); - } - - /** - * Format the instance as RFC822 - * - * @return string - */ - public function toRfc822String() - { - return $this->format(DateTime::RFC822); - } - - /** - * Format the instance as RFC850 - * - * @return string - */ - public function toRfc850String() - { - return $this->format(DateTime::RFC850); - } - - /** - * Format the instance as RFC1036 - * - * @return string - */ - public function toRfc1036String() - { - return $this->format(DateTime::RFC1036); - } - - /** - * Format the instance as RFC1123 - * - * @return string - */ - public function toRfc1123String() - { - return $this->format(DateTime::RFC1123); - } - - /** - * Format the instance as RFC2822 - * - * @return string - */ - public function toRfc2822String() - { - return $this->format(DateTime::RFC2822); - } - - /** - * Format the instance as RFC3339 - * - * @return string - */ - public function toRfc3339String() - { - return $this->format(DateTime::RFC3339); - } - - /** - * Format the instance as RSS - * - * @return string - */ - public function toRssString() - { - return $this->format(DateTime::RSS); - } - - /** - * Format the instance as W3C - * - * @return string - */ - public function toW3cString() - { - return $this->format(DateTime::W3C); - } - - /** - * Returns a UNIX timestamp. - * - * @return string UNIX timestamp - */ - public function toUnixString() - { - return $this->format('U'); - } - - /** - * Returns the quarter - * - * @param bool $range Range. - * @return int|array 1, 2, 3, or 4 quarter of year or array if $range true - */ - public function toQuarter($range = false) - { - $quarter = ceil($this->format('m') / 3); - if ($range === false) { - return $quarter; - } - - $year = $this->format('Y'); - switch ($quarter) { - case 1: - return [$year . '-01-01', $year . '-03-31']; - case 2: - return [$year . '-04-01', $year . '-06-30']; - case 3: - return [$year . '-07-01', $year . '-09-30']; - case 4: - return [$year . '-10-01', $year . '-12-31']; - } - } - - /** - * @return int - */ - public function toWeek() - { - return (int)$this->format('W'); - } -} diff --git a/vendor/cakephp/chronos/src/Traits/FrozenTimeTrait.php b/vendor/cakephp/chronos/src/Traits/FrozenTimeTrait.php deleted file mode 100644 index eaa611b..0000000 --- a/vendor/cakephp/chronos/src/Traits/FrozenTimeTrait.php +++ /dev/null @@ -1,186 +0,0 @@ -format('Y-m-d 00:00:00'); - } - if (substr($time, 0, 1) === '@') { - return gmdate('Y-m-d 00:00:00', substr($time, 1)); - } - if ($time === null || $time === 'now' || $time === '') { - return date('Y-m-d 00:00:00'); - } - if ($this->hasRelativeKeywords($time)) { - return date('Y-m-d 00:00:00', strtotime($time)); - } - - return preg_replace('/\d{1,2}:\d{1,2}:\d{1,2}(?:\.\d+)?/', '00:00:00', $time); - } - - /** - * Remove time components from strtotime relative strings. - * - * @param string $time The input expression - * @return string The output expression with no time modifiers. - */ - protected function stripRelativeTime($time) - { - return preg_replace('/([-+]\s*\d+\s(?:minutes|seconds|hours|microseconds))/', '', $time); - } - - /** - * Modify the time on the Date. - * - * This method ignores all inputs and forces all inputs to 0. - * - * @param int $hours The hours to set (ignored) - * @param int $minutes The minutes to set (ignored) - * @param int $seconds The seconds to set (ignored) - * @param int $microseconds The microseconds to set (ignored) - * @return static A modified Date instance. - */ - public function setTime($hours, $minutes, $seconds = null, $microseconds = null) - { - if (CHRONOS_SUPPORTS_MICROSECONDS) { - return parent::setTime(0, 0, 0, 0); - } - - return parent::setTime(0, 0, 0); - } - - /** - * Add an Interval to a Date - * - * Any changes to the time will be ignored and reset to 00:00:00 - * - * @param \DateInterval $interval The interval to modify this date by. - * @return static A modified Date instance - */ - public function add($interval) - { - return parent::add($interval)->setTime(0, 0, 0); - } - - /** - * Subtract an Interval from a Date. - * - * Any changes to the time will be ignored and reset to 00:00:00 - * - * @param \DateInterval $interval The interval to modify this date by. - * @return static A modified Date instance - */ - public function sub($interval) - { - return parent::sub($interval)->setTime(0, 0, 0); - } - - /** - * No-op method. - * - * Timezones have no effect on calendar dates. - * - * @param \DateTimeZone|string $value The DateTimeZone object or timezone name to use. - * @return $this - */ - public function timezone($value) - { - return $this; - } - - /** - * No-op method. - * - * Timezones have no effect on calendar dates. - * - * @param \DateTimeZone|string $value The DateTimeZone object or timezone name to use. - * @return $this - */ - public function tz($value) - { - return $this; - } - - /** - * No-op method. - * - * Timezones have no effect on calendar dates. - * - * @param \DateTimeZone|string $value The DateTimeZone object or timezone name to use. - * @return $this - */ - public function setTimezone($value) - { - return $this; - } - - /** - * Set the timestamp value and get a new object back. - * - * This method will discard the time aspects of the timestamp - * and only apply the date portions - * - * @param int $value The timestamp value to set. - * @return static - */ - public function setTimestamp($value) - { - return parent::setTimestamp($value)->setTime(0, 0, 0); - } - - /** - * Overloaded to ignore time changes. - * - * Changing any aspect of the time will be ignored, and the resulting object - * will have its time frozen to 00:00:00. - * - * @param string $relative The relative change to make. - * @return static A new date with the applied date changes. - */ - public function modify($relative) - { - if (preg_match('/hour|minute|second/', $relative)) { - return $this; - } - $new = parent::modify($relative); - if ($new->format('H:i:s') !== '00:00:00') { - return $new->setTime(0, 0, 0); - } - - return $new; - } -} diff --git a/vendor/cakephp/chronos/src/Traits/MagicPropertyTrait.php b/vendor/cakephp/chronos/src/Traits/MagicPropertyTrait.php deleted file mode 100644 index 5556880..0000000 --- a/vendor/cakephp/chronos/src/Traits/MagicPropertyTrait.php +++ /dev/null @@ -1,132 +0,0 @@ - - * @link http://cakephp.org CakePHP(tm) Project - * @license http://www.opensource.org/licenses/mit-license.php MIT License - */ -namespace Cake\Chronos\Traits; - -use Cake\Chronos\ChronosInterface; -use InvalidArgumentException; - -/** - * Provides the magic methods that allow read access - * to magic properties. - * - * @property-read int $year - * @property-read int $yearIso - * @property-read int $month - * @property-read int $day - * @property-read int $hour - * @property-read int $minute - * @property-read int $second - * @property-read int $micro - * @property-read int $dayOfWeek - * @property-read int $dayOfYear - * @property-read int $weekOfYear - * @property-read int $daysInMonth - * @property-read int $timestamp - * @property-read int $weekOfMonth - * @property-read int $age - * @property-read int $quarter - * @property-read int $offset - * @property-read int $offsetHours - * @property-read boolean $dst - * @property-read boolean $local - * @property-read boolean $utc - * @property-read \DateTimeZone $timezone - * @property-read \DateTimeZone $tz - * @property-read string $timezoneName - * @property-read string $tzName - */ -trait MagicPropertyTrait -{ - /** - * Get a part of the ChronosInterface object - * - * @param string $name The property name to read. - * @return mixed The property value. - * @throws \InvalidArgumentException - */ - public function __get($name) - { - static $formats = [ - 'year' => 'Y', - 'yearIso' => 'o', - 'month' => 'n', - 'day' => 'j', - 'hour' => 'G', - 'minute' => 'i', - 'second' => 's', - 'micro' => 'u', - 'microsecond' => 'u', - 'dayOfWeek' => 'N', - 'dayOfYear' => 'z', - 'weekOfYear' => 'W', - 'daysInMonth' => 't', - 'timestamp' => 'U', - ]; - - switch (true) { - case isset($formats[$name]): - return (int)$this->format($formats[$name]); - - case $name === 'weekOfMonth': - return (int)ceil($this->day / ChronosInterface::DAYS_PER_WEEK); - - case $name === 'age': - return $this->diffInYears(); - - case $name === 'quarter': - return (int)ceil($this->month / 3); - - case $name === 'offset': - return $this->getOffset(); - - case $name === 'offsetHours': - return $this->getOffset() / ChronosInterface::SECONDS_PER_MINUTE / ChronosInterface::MINUTES_PER_HOUR; - - case $name === 'dst': - return $this->format('I') === '1'; - - case $name === 'local': - return $this->offset === $this->copy()->setTimezone(date_default_timezone_get())->offset; - - case $name === 'utc': - return $this->offset === 0; - - case $name === 'timezone' || $name === 'tz': - return $this->getTimezone(); - - case $name === 'timezoneName' || $name === 'tzName': - return $this->getTimezone()->getName(); - - default: - throw new InvalidArgumentException(sprintf("Unknown getter '%s'", $name)); - } - } - - /** - * Check if an attribute exists on the object - * - * @param string $name The property name to check. - * @return bool Whether or not the property exists. - */ - public function __isset($name) - { - try { - $this->__get($name); - } catch (InvalidArgumentException $e) { - return false; - } - - return true; - } -} diff --git a/vendor/cakephp/chronos/src/Traits/ModifierTrait.php b/vendor/cakephp/chronos/src/Traits/ModifierTrait.php deleted file mode 100644 index 95bda30..0000000 --- a/vendor/cakephp/chronos/src/Traits/ModifierTrait.php +++ /dev/null @@ -1,1082 +0,0 @@ - - * @link http://cakephp.org CakePHP(tm) Project - * @license http://www.opensource.org/licenses/mit-license.php MIT License - */ -namespace Cake\Chronos\Traits; - -use Cake\Chronos\ChronosInterface; -use DateTime; -use DateTimeImmutable; - -/** - * Provides a suite of modifier methods. - * - * These methods let you modify the various aspects - * of a DateTime with a series of fluent methods. - * - * This trait expects that the implementing class - * also implements a copy() method. This method can be obtained - * using the CopyTrait. - */ -trait ModifierTrait -{ - - /** - * Names of days of the week. - * - * @var array - */ - protected static $days = [ - ChronosInterface::MONDAY => 'Monday', - ChronosInterface::TUESDAY => 'Tuesday', - ChronosInterface::WEDNESDAY => 'Wednesday', - ChronosInterface::THURSDAY => 'Thursday', - ChronosInterface::FRIDAY => 'Friday', - ChronosInterface::SATURDAY => 'Saturday', - ChronosInterface::SUNDAY => 'Sunday', - ]; - - /** - * First day of week - * - * @var int - */ - protected static $weekStartsAt = ChronosInterface::MONDAY; - - /** - * Last day of week - * - * @var int - */ - protected static $weekEndsAt = ChronosInterface::SUNDAY; - - /** - * Get the first day of week - * - * @return int - */ - public static function getWeekStartsAt() - { - return static::$weekStartsAt; - } - - /** - * Set the first day of week - * - * @param int $day The day the week starts with. - * @return void - */ - public static function setWeekStartsAt($day) - { - static::$weekStartsAt = $day; - } - - /** - * Get the last day of week - * - * @return int - */ - public static function getWeekEndsAt() - { - return static::$weekEndsAt; - } - - /** - * Set the last day of week - * - * @param int $day The day the week ends with. - * @return void - */ - public static function setWeekEndsAt($day) - { - static::$weekEndsAt = $day; - } - - /** - * Set the date to a different date. - * - * Workaround for a PHP bug related to the first day of a month - * - * @param int $year The year to set. - * @param int $month The month to set. - * @param int $day The day to set. - * @return static - * @see https://bugs.php.net/bug.php?id=63863 - */ - public function setDate($year, $month, $day) - { - return $this->modify('+0 day')->setDateParent($year, $month, $day); - } - - /** - * Just calling to parent setDate - * It used in overwritten setDate - * - * @param int $year The year to set. - * @param int $month The month to set. - * @param int $day The day to set. - * @return static - */ - private function setDateParent($year, $month, $day) - { - return parent::setDate($year, $month, $day); - } - - /** - * Set the date and time all together - * - * @param int $year The year to set. - * @param int $month The month to set. - * @param int $day The day to set. - * @param int $hour The hour to set. - * @param int $minute The minute to set. - * @param int $second The second to set. - * @return static - */ - public function setDateTime($year, $month, $day, $hour, $minute, $second = 0) - { - return $this->setDate($year, $month, $day)->setTime($hour, $minute, $second); - } - - /** - * Set the time by time string - * - * @param string $time Time as string. - * @return static - */ - public function setTimeFromTimeString($time) - { - $time = explode(":", $time); - $hour = (int)$time[0]; - $minute = isset($time[1]) ? (int)$time[1] : 0; - $second = isset($time[2]) ? (int)$time[2] : 0; - - return $this->setTime($hour, $minute, $second); - } - - /** - * Set the instance's timestamp - * - * @param int $value The timestamp value to set. - * @return static - */ - public function timestamp($value) - { - return $this->setTimestamp($value); - } - - /** - * Set the instance's year - * - * @param int $value The year value. - * @return static - */ - public function year($value) - { - return $this->setDate($value, $this->month, $this->day); - } - - /** - * Set the instance's month - * - * @param int $value The month value. - * @return static - */ - public function month($value) - { - return $this->setDate($this->year, $value, $this->day); - } - - /** - * Set the instance's day - * - * @param int $value The day value. - * @return static - */ - public function day($value) - { - return $this->setDate($this->year, $this->month, $value); - } - - /** - * Set the instance's hour - * - * @param int $value The hour value. - * @return static - */ - public function hour($value) - { - return $this->setTime($value, $this->minute, $this->second); - } - - /** - * Set the instance's minute - * - * @param int $value The minute value. - * @return static - */ - public function minute($value) - { - return $this->setTime($this->hour, $value, $this->second); - } - - /** - * Set the instance's second - * - * @param int $value The seconds value. - * @return static - */ - public function second($value) - { - return $this->setTime($this->hour, $this->minute, $value); - } - - /** - * Add years to the instance. Positive $value travel forward while - * negative $value travel into the past. - * - * @param int $value The number of years to add. - * @return static - */ - public function addYears($value) - { - return $this->modify((int)$value . ' year'); - } - - /** - * Add a year to the instance - * - * @param int $value The number of years to add. - * @return static - */ - public function addYear($value = 1) - { - return $this->addYears($value); - } - - /** - * Remove a year from the instance - * - * @param int $value The number of years to remove. - * @return static - */ - public function subYear($value = 1) - { - return $this->subYears($value); - } - - /** - * Remove years from the instance. - * - * @param int $value The number of years to remove. - * @return static - */ - public function subYears($value) - { - return $this->addYears(-1 * $value); - } - - /** - * Add months to the instance. Positive $value travels forward while - * negative $value travels into the past. - * - * When adding or subtracting months, if the resulting time is a date - * that does not exist, the result of this operation will always be the - * last day of the intended month. - * - * ### Example: - * - * ``` - * (new Chronos('2015-01-03'))->addMonths(1); // Results in 2015-02-03 - * - * (new Chronos('2015-01-31'))->addMonths(1); // Results in 2015-02-28 - * ``` - * - * @param int $value The number of months to add. - * @return static - */ - public function addMonths($value) - { - $day = $this->day; - $date = $this->modify((int)$value . ' month'); - - if ($date->day !== $day) { - return $date->modify('last day of previous month'); - } - - return $date; - } - - /** - * Add a month to the instance - * - * When adding or subtracting months, if the resulting time is a date - * that does not exist, the result of this operation will always be the - * last day of the intended month. - * - * ### Example: - * - * ``` - * (new Chronos('2015-01-03'))->addMonth(); // Results in 2015-02-03 - * - * (new Chronos('2015-01-31'))->addMonth(); // Results in 2015-02-28 - * ``` - * - * @param int $value The number of months to add. - * @return static - */ - public function addMonth($value = 1) - { - return $this->addMonths($value); - } - - /** - * Remove a month from the instance - * - * When adding or subtracting months, if the resulting time is a date - * that does not exist, the result of this operation will always be the - * last day of the intended month. - * - * ### Example: - * - * ``` - * (new Chronos('2015-03-01'))->subMonth(); // Results in 2015-02-01 - * - * (new Chronos('2015-03-31'))->subMonth(); // Results in 2015-02-28 - * ``` - * - * @param int $value The number of months to remove. - * @return static - */ - public function subMonth($value = 1) - { - return $this->subMonths($value); - } - - /** - * Remove months from the instance - * - * When adding or subtracting months, if the resulting time is a date - * that does not exist, the result of this operation will always be the - * last day of the intended month. - * - * ### Example: - * - * ``` - * (new Chronos('2015-03-01'))->subMonths(1); // Results in 2015-02-01 - * - * (new Chronos('2015-03-31'))->subMonths(1); // Results in 2015-02-28 - * ``` - * - * @param int $value The number of months to remove. - * @return static - */ - public function subMonths($value) - { - return $this->addMonths(-1 * $value); - } - - /** - * Add months with overflowing to the instance. Positive $value - * travels forward while negative $value travels into the past. - * - * @param int $value The number of months to add. - * @return static - */ - public function addMonthsWithOverflow($value) - { - return $this->modify((int)$value . ' month'); - } - - /** - * Add a month with overflow to the instance - * - * @param int $value The number of months to add. - * @return static - */ - public function addMonthWithOverflow($value = 1) - { - return $this->modify((int)$value . ' month'); - } - - /** - * Remove a month with overflow from the instance - * - * @param int $value The number of months to remove. - * @return static - */ - public function subMonthWithOverflow($value = 1) - { - return $this->subMonthsWithOverflow($value); - } - - /** - * Remove months with overflow from the instance - * - * @param int $value The number of months to remove. - * @return static - */ - public function subMonthsWithOverflow($value) - { - return $this->addMonthsWithOverflow(-1 * $value); - } - - /** - * Add days to the instance. Positive $value travels forward while - * negative $value travels into the past. - * - * @param int $value The number of days to add. - * @return static - */ - public function addDays($value) - { - $value = (int)$value; - - return $this->modify("$value day"); - } - - /** - * Add a day to the instance - * - * @param int $value The number of days to add. - * @return static - */ - public function addDay($value = 1) - { - $value = (int)$value; - - return $this->modify("$value day"); - } - - /** - * Remove a day from the instance - * - * @param int $value The number of days to remove. - * @return static - */ - public function subDay($value = 1) - { - $value = (int)$value; - - return $this->modify("-$value day"); - } - - /** - * Remove days from the instance - * - * @param int $value The number of days to remove. - * @return static - */ - public function subDays($value) - { - $value = (int)$value; - - return $this->modify("-$value day"); - } - - /** - * Add weekdays to the instance. Positive $value travels forward while - * negative $value travels into the past. - * - * @param int $value The number of weekdays to add. - * @return static - */ - public function addWeekdays($value) - { - return $this->modify((int)$value . ' weekdays ' . $this->format('H:i:s')); - } - - /** - * Add a weekday to the instance - * - * @param int $value The number of weekdays to add. - * @return static - */ - public function addWeekday($value = 1) - { - return $this->addWeekdays($value); - } - - /** - * Remove weekdays from the instance - * - * @param int $value The number of weekdays to remove. - * @return static - */ - public function subWeekdays($value) - { - $value = (int)$value; - - return $this->modify("$value weekdays ago, " . $this->format('H:i:s')); - } - - /** - * Remove a weekday from the instance - * - * @param int $value The number of weekdays to remove. - * @return static - */ - public function subWeekday($value = 1) - { - return $this->subWeekdays($value); - } - - /** - * Add weeks to the instance. Positive $value travels forward while - * negative $value travels into the past. - * - * @param int $value The number of weeks to add. - * @return static - */ - public function addWeeks($value) - { - $value = (int)$value; - - return $this->modify("$value week"); - } - - /** - * Add a week to the instance - * - * @param int $value The number of weeks to add. - * @return static - */ - public function addWeek($value = 1) - { - $value = (int)$value; - - return $this->modify("$value week"); - } - - /** - * Remove a week from the instance - * - * @param int $value The number of weeks to remove. - * @return static - */ - public function subWeek($value = 1) - { - $value = (int)$value; - - return $this->modify("-$value week"); - } - - /** - * Remove weeks to the instance - * - * @param int $value The number of weeks to remove. - * @return static - */ - public function subWeeks($value) - { - $value = (int)$value; - - return $this->modify("-$value week"); - } - - /** - * Add hours to the instance. Positive $value travels forward while - * negative $value travels into the past. - * - * @param int $value The number of hours to add. - * @return static - */ - public function addHours($value) - { - $value = (int)$value; - - return $this->modify("$value hour"); - } - - /** - * Add an hour to the instance - * - * @param int $value The number of hours to add. - * @return static - */ - public function addHour($value = 1) - { - $value = (int)$value; - - return $this->modify("$value hour"); - } - - /** - * Remove an hour from the instance - * - * @param int $value The number of hours to remove. - * @return static - */ - public function subHour($value = 1) - { - $value = (int)$value; - - return $this->modify("-$value hour"); - } - - /** - * Remove hours from the instance - * - * @param int $value The number of hours to remove. - * @return static - */ - public function subHours($value) - { - $value = (int)$value; - - return $this->modify("-$value hour"); - } - - /** - * Add minutes to the instance. Positive $value travels forward while - * negative $value travels into the past. - * - * @param int $value The number of minutes to add. - * @return static - */ - public function addMinutes($value) - { - $value = (int)$value; - - return $this->modify("$value minute"); - } - - /** - * Add a minute to the instance - * - * @param int $value The number of minutes to add. - * @return static - */ - public function addMinute($value = 1) - { - $value = (int)$value; - - return $this->modify("$value minute"); - } - - /** - * Remove a minute from the instance - * - * @param int $value The number of minutes to remove. - * @return static - */ - public function subMinute($value = 1) - { - $value = (int)$value; - - return $this->modify("-$value minute"); - } - - /** - * Remove minutes from the instance - * - * @param int $value The number of minutes to remove. - * @return static - */ - public function subMinutes($value) - { - $value = (int)$value; - - return $this->modify("-$value minute"); - } - - /** - * Add seconds to the instance. Positive $value travels forward while - * negative $value travels into the past. - * - * @param int $value The number of seconds to add. - * @return static - */ - public function addSeconds($value) - { - $value = (int)$value; - - return $this->modify("$value second"); - } - - /** - * Add a second to the instance - * - * @param int $value The number of seconds to add. - * @return static - */ - public function addSecond($value = 1) - { - $value = (int)$value; - - return $this->modify("$value second"); - } - - /** - * Remove a second from the instance - * - * @param int $value The number of seconds to remove. - * @return static - */ - public function subSecond($value = 1) - { - $value = (int)$value; - - return $this->modify("-$value second"); - } - - /** - * Remove seconds from the instance - * - * @param int $value The number of seconds to remove. - * @return static - */ - public function subSeconds($value) - { - $value = (int)$value; - - return $this->modify("-$value second"); - } - - /** - * Resets the time to 00:00:00 - * - * @return static - */ - public function startOfDay() - { - return $this->modify('midnight'); - } - - /** - * Resets the time to 23:59:59 - * - * @return static - */ - public function endOfDay() - { - return $this->modify('23:59:59'); - } - - /** - * Resets the date to the first day of the month and the time to 00:00:00 - * - * @return static - */ - public function startOfMonth() - { - return $this->modify('first day of this month midnight'); - } - - /** - * Resets the date to end of the month and time to 23:59:59 - * - * @return static - */ - public function endOfMonth() - { - return $this->modify('last day of this month, 23:59:59'); - } - - /** - * Resets the date to the first day of the year and the time to 00:00:00 - * - * @return static - */ - public function startOfYear() - { - return $this->modify('first day of january midnight'); - } - - /** - * Resets the date to end of the year and time to 23:59:59 - * - * @return static - */ - public function endOfYear() - { - return $this->modify('last day of december, 23:59:59'); - } - - /** - * Resets the date to the first day of the decade and the time to 00:00:00 - * - * @return static - */ - public function startOfDecade() - { - $year = $this->year - $this->year % ChronosInterface::YEARS_PER_DECADE; - - return $this->modify("first day of january $year, midnight"); - } - - /** - * Resets the date to end of the decade and time to 23:59:59 - * - * @return static - */ - public function endOfDecade() - { - $year = $this->year - $this->year % ChronosInterface::YEARS_PER_DECADE + ChronosInterface::YEARS_PER_DECADE - 1; - - return $this->modify("last day of december $year, 23:59:59"); - } - - /** - * Resets the date to the first day of the century and the time to 00:00:00 - * - * @return static - */ - public function startOfCentury() - { - $year = $this->startOfYear()->year(($this->year - 1) - ($this->year - 1) % ChronosInterface::YEARS_PER_CENTURY + 1)->year; - - return $this->modify("first day of january $year, midnight"); - } - - /** - * Resets the date to end of the century and time to 23:59:59 - * - * @return static - */ - public function endOfCentury() - { - $year = $this->endOfYear()->year(($this->year - 1) - ($this->year - 1) % ChronosInterface::YEARS_PER_CENTURY + ChronosInterface::YEARS_PER_CENTURY)->year; - - return $this->modify("last day of december $year, 23:59:59"); - } - - /** - * Resets the date to the first day of week (defined in $weekStartsAt) and the time to 00:00:00 - * - * @return static - */ - public function startOfWeek() - { - $dt = $this; - if ($dt->dayOfWeek !== static::$weekStartsAt) { - $dt = $dt->previous(static::$weekStartsAt); - } - - return $dt->startOfDay(); - } - - /** - * Resets the date to end of week (defined in $weekEndsAt) and time to 23:59:59 - * - * @return static - */ - public function endOfWeek() - { - $dt = $this; - if ($dt->dayOfWeek !== static::$weekEndsAt) { - $dt = $dt->next(static::$weekEndsAt); - } - - return $dt->endOfDay(); - } - - /** - * Modify to the next occurrence of a given day of the week. - * If no dayOfWeek is provided, modify to the next occurrence - * of the current day of the week. Use the supplied consts - * to indicate the desired dayOfWeek, ex. ChronosInterface::MONDAY. - * - * @param int|null $dayOfWeek The day of the week to move to. - * @return mixed - */ - public function next($dayOfWeek = null) - { - if ($dayOfWeek === null) { - $dayOfWeek = $this->dayOfWeek; - } - - $day = static::$days[$dayOfWeek]; - - return $this->modify("next $day, midnight"); - } - - /** - * Modify to the previous occurrence of a given day of the week. - * If no dayOfWeek is provided, modify to the previous occurrence - * of the current day of the week. Use the supplied consts - * to indicate the desired dayOfWeek, ex. ChronosInterface::MONDAY. - * - * @param int|null $dayOfWeek The day of the week to move to. - * @return mixed - */ - public function previous($dayOfWeek = null) - { - if ($dayOfWeek === null) { - $dayOfWeek = $this->dayOfWeek; - } - - $day = static::$days[$dayOfWeek]; - - return $this->modify("last $day, midnight"); - } - - /** - * Modify to the first occurrence of a given day of the week - * in the current month. If no dayOfWeek is provided, modify to the - * first day of the current month. Use the supplied consts - * to indicate the desired dayOfWeek, ex. ChronosInterface::MONDAY. - * - * @param int|null $dayOfWeek The day of the week to move to. - * @return mixed - */ - public function firstOfMonth($dayOfWeek = null) - { - $day = $dayOfWeek === null ? 'day' : static::$days[$dayOfWeek]; - - return $this->modify("first $day of this month, midnight"); - } - - /** - * Modify to the last occurrence of a given day of the week - * in the current month. If no dayOfWeek is provided, modify to the - * last day of the current month. Use the supplied consts - * to indicate the desired dayOfWeek, ex. ChronosInterface::MONDAY. - * - * @param int|null $dayOfWeek The day of the week to move to. - * @return mixed - */ - public function lastOfMonth($dayOfWeek = null) - { - $day = $dayOfWeek === null ? 'day' : static::$days[$dayOfWeek]; - - return $this->modify("last $day of this month, midnight"); - } - - /** - * Modify to the given occurrence of a given day of the week - * in the current month. If the calculated occurrence is outside the scope - * of the current month, then return false and no modifications are made. - * Use the supplied consts to indicate the desired dayOfWeek, ex. ChronosInterface::MONDAY. - * - * @param int $nth The offset to use. - * @param int $dayOfWeek The day of the week to move to. - * @return mixed - */ - public function nthOfMonth($nth, $dayOfWeek) - { - $dt = $this->copy()->firstOfMonth(); - $check = $dt->format('Y-m'); - $dt = $dt->modify("+$nth " . static::$days[$dayOfWeek]); - - return ($dt->format('Y-m') === $check) ? $dt : false; - } - - /** - * Modify to the first occurrence of a given day of the week - * in the current quarter. If no dayOfWeek is provided, modify to the - * first day of the current quarter. Use the supplied consts - * to indicate the desired dayOfWeek, ex. ChronosInterface::MONDAY. - * - * @param int|null $dayOfWeek The day of the week to move to. - * @return mixed - */ - public function firstOfQuarter($dayOfWeek = null) - { - return $this->day(1)->month($this->quarter * ChronosInterface::MONTHS_PER_QUARTER - 2)->firstOfMonth($dayOfWeek); - } - - /** - * Modify to the last occurrence of a given day of the week - * in the current quarter. If no dayOfWeek is provided, modify to the - * last day of the current quarter. Use the supplied consts - * to indicate the desired dayOfWeek, ex. ChronosInterface::MONDAY. - * - * @param int|null $dayOfWeek The day of the week to move to. - * @return mixed - */ - public function lastOfQuarter($dayOfWeek = null) - { - return $this->day(1)->month($this->quarter * ChronosInterface::MONTHS_PER_QUARTER)->lastOfMonth($dayOfWeek); - } - - /** - * Modify to the given occurrence of a given day of the week - * in the current quarter. If the calculated occurrence is outside the scope - * of the current quarter, then return false and no modifications are made. - * Use the supplied consts to indicate the desired dayOfWeek, ex. ChronosInterface::MONDAY. - * - * @param int $nth The offset to use. - * @param int $dayOfWeek The day of the week to move to. - * @return mixed - */ - public function nthOfQuarter($nth, $dayOfWeek) - { - $dt = $this->copy()->day(1)->month($this->quarter * ChronosInterface::MONTHS_PER_QUARTER); - $lastMonth = $dt->month; - $year = $dt->year; - $dt = $dt->firstOfQuarter()->modify("+$nth" . static::$days[$dayOfWeek]); - - return ($lastMonth < $dt->month || $year !== $dt->year) ? false : $dt; - } - - /** - * Modify to the first occurrence of a given day of the week - * in the current year. If no dayOfWeek is provided, modify to the - * first day of the current year. Use the supplied consts - * to indicate the desired dayOfWeek, ex. ChronosInterface::MONDAY. - * - * @param int|null $dayOfWeek The day of the week to move to. - * @return mixed - */ - public function firstOfYear($dayOfWeek = null) - { - $day = $dayOfWeek === null ? 'day' : static::$days[$dayOfWeek]; - - return $this->modify("first $day of january, midnight"); - } - - /** - * Modify to the last occurrence of a given day of the week - * in the current year. If no dayOfWeek is provided, modify to the - * last day of the current year. Use the supplied consts - * to indicate the desired dayOfWeek, ex. ChronosInterface::MONDAY. - * - * @param int|null $dayOfWeek The day of the week to move to. - * @return mixed - */ - public function lastOfYear($dayOfWeek = null) - { - $day = $dayOfWeek === null ? 'day' : static::$days[$dayOfWeek]; - - return $this->modify("last $day of december, midnight"); - } - - /** - * Modify to the given occurrence of a given day of the week - * in the current year. If the calculated occurrence is outside the scope - * of the current year, then return false and no modifications are made. - * Use the supplied consts to indicate the desired dayOfWeek, ex. ChronosInterface::MONDAY. - * - * @param int $nth The offset to use. - * @param int $dayOfWeek The day of the week to move to. - * @return mixed - */ - public function nthOfYear($nth, $dayOfWeek) - { - $dt = $this->copy()->firstOfYear()->modify("+$nth " . static::$days[$dayOfWeek]); - - return $this->year === $dt->year ? $dt : false; - } - - /** - * Modify the current instance to the average of a given instance (default now) and the current instance. - * - * @param \Cake\Chronos\ChronosInterface|null $dt The instance to compare with. - * @return static - */ - public function average(ChronosInterface $dt = null) - { - $dt = ($dt === null) ? static::now($this->tz) : $dt; - - return $this->addSeconds((int)($this->diffInSeconds($dt, false) / 2)); - } -} diff --git a/vendor/cakephp/chronos/src/Traits/RelativeKeywordTrait.php b/vendor/cakephp/chronos/src/Traits/RelativeKeywordTrait.php deleted file mode 100644 index 69c6cd6..0000000 --- a/vendor/cakephp/chronos/src/Traits/RelativeKeywordTrait.php +++ /dev/null @@ -1,58 +0,0 @@ - - * @link http://cakephp.org CakePHP(tm) Project - * @license http://www.opensource.org/licenses/mit-license.php MIT License - */ -namespace Cake\Chronos\Traits; - -/** - * Provides methods for testing if strings contain relative keywords. - */ -trait RelativeKeywordTrait -{ - protected static $relativePattern = '/this|next|last|tomorrow|yesterday|midnight|today|[+-]|first|last|ago/i'; - - /** - * Determine if there is just a time in the time string - * - * @param string $time The time string to check. - * @return bool true if there is a keyword, otherwise false - */ - private static function isTimeExpression($time) - { - // Just a time - if (preg_match('/^[0-2]?[0-9]:[0-5][0-9](?::[0-5][0-9])?$/', $time)) { - return true; - } - - return false; - } - - /** - * Determine if there is a relative keyword in the time string, this is to - * create dates relative to now for test instances. e.g.: next tuesday - * - * @param string $time The time string to check. - * @return bool true if there is a keyword, otherwise false - */ - public static function hasRelativeKeywords($time) - { - if (self::isTimeExpression($time)) { - return true; - } - // skip common format with a '-' in it - if (preg_match('/[0-9]{4}-[0-9]{1,2}-[0-9]{1,2}/', $time) !== 1) { - return preg_match(static::$relativePattern, $time) > 0; - } - - return false; - } -} diff --git a/vendor/cakephp/chronos/src/Traits/TestingAidTrait.php b/vendor/cakephp/chronos/src/Traits/TestingAidTrait.php deleted file mode 100644 index 19f8732..0000000 --- a/vendor/cakephp/chronos/src/Traits/TestingAidTrait.php +++ /dev/null @@ -1,59 +0,0 @@ - - * @link http://cakephp.org CakePHP(tm) Project - * @license http://www.opensource.org/licenses/mit-license.php MIT License - */ -namespace Cake\Chronos\Traits; - -use Cake\Chronos\Chronos; -use Cake\Chronos\ChronosInterface; - -/** - * Provides methods for setting a 'test' now. This lets you - * retrieve pre-determined times with now(). - */ -trait TestingAidTrait -{ - - /** - * Set the test now used by Date and Time classes provided by Chronos - * - * @see \Cake\Chronos\Chronos::setTestNow() - * @param \Cake\Chronos\ChronosInterface|string|null $testNow The instance to use for all future instances. - * @return void - */ - public static function setTestNow($testNow = null) - { - Chronos::setTestNow($testNow); - } - - /** - * Get the test instance stored in Chronos - * - * @see \Cake\Chronos\Chronos::getTestNow() - * @return \Cake\Chronos\ChronosInterface|null the current instance used for testing or null. - */ - public static function getTestNow() - { - return Chronos::getTestNow(); - } - - /** - * Get whether or not Chronos has a test instance set. - * - * @see \Cake\Chronos\Chronos::hasTestNow() - * @return bool True if there is a test instance, otherwise false - */ - public static function hasTestNow() - { - return Chronos::hasTestNow(); - } -} diff --git a/vendor/cakephp/chronos/src/Traits/TimezoneTrait.php b/vendor/cakephp/chronos/src/Traits/TimezoneTrait.php deleted file mode 100644 index 97816ba..0000000 --- a/vendor/cakephp/chronos/src/Traits/TimezoneTrait.php +++ /dev/null @@ -1,60 +0,0 @@ - - * @link http://cakephp.org CakePHP(tm) Project - * @license http://www.opensource.org/licenses/mit-license.php MIT License - */ -namespace Cake\Chronos\Traits; - -/** - * Methods for modifying/reading timezone data. - */ -trait TimezoneTrait -{ - /** - * Alias for setTimezone() - * - * @param \DateTimeZone|string $value The DateTimeZone object or timezone name to use. - * @return static - */ - public function timezone($value) - { - return $this->setTimezone($value); - } - - /** - * Alias for setTimezone() - * - * @param \DateTimeZone|string $value The DateTimeZone object or timezone name to use. - * @return static - */ - public function tz($value) - { - return $this->setTimezone($value); - } - - /** - * Set the instance's timezone from a string or object - * - * @param \DateTimeZone|string $value The DateTimeZone object or timezone name to use. - * @return static - */ - public function setTimezone($value) - { - $date = parent::setTimezone(static::safeCreateDateTimeZone($value)); - - // https://bugs.php.net/bug.php?id=72338 - // this is workaround for this bug - // Needed for PHP below 7.0 version - $date->getTimestamp(); - - return $date; - } -} diff --git a/vendor/cakephp/chronos/src/Translator.php b/vendor/cakephp/chronos/src/Translator.php deleted file mode 100644 index e5f9788..0000000 --- a/vendor/cakephp/chronos/src/Translator.php +++ /dev/null @@ -1,93 +0,0 @@ - '1 year', - 'year_plural' => '{count} years', - 'month' => '1 month', - 'month_plural' => '{count} months', - 'week' => '1 week', - 'week_plural' => '{count} weeks', - 'day' => '1 day', - 'day_plural' => '{count} days', - 'hour' => '1 hour', - 'hour_plural' => '{count} hours', - 'minute' => '1 minute', - 'minute_plural' => '{count} minutes', - 'second' => '1 second', - 'second_plural' => '{count} seconds', - 'ago' => '{time} ago', - 'from_now' => '{time} from now', - 'after' => '{time} after', - 'before' => '{time} before', - ]; - - /** - * Check if a translation key exists. - * - * @param string $key The key to check. - * @return bool Whether or not the key exists. - */ - public function exists($key) - { - return isset(static::$strings[$key]); - } - - /** - * Get a plural message. - * - * @param string $key The key to use. - * @param int $count The number of items in the translation. - * @param array $vars Additional context variables. - * @return string The translated message or ''. - */ - public function plural($key, $count, array $vars = []) - { - if ($count === 1) { - return $this->singular($key, $vars); - } - - return $this->singular($key . '_plural', ['count' => $count] + $vars); - } - - /** - * Get a singular message. - * - * @param string $key The key to use. - * @param array $vars Additional context variables. - * @return string The translated message or ''. - */ - public function singular($key, array $vars = []) - { - if (isset(static::$strings[$key])) { - $varKeys = array_keys($vars); - foreach ($varKeys as $i => $k) { - $varKeys[$i] = '{' . $k . '}'; - } - - return str_replace($varKeys, $vars, static::$strings[$key]); - } - - return ''; - } -} diff --git a/vendor/cakephp/chronos/src/carbon_compat.php b/vendor/cakephp/chronos/src/carbon_compat.php deleted file mode 100644 index f947cb7..0000000 --- a/vendor/cakephp/chronos/src/carbon_compat.php +++ /dev/null @@ -1,20 +0,0 @@ - - * @link http://cakephp.org CakePHP(tm) Project - * @license http://www.opensource.org/licenses/mit-license.php MIT License - */ -define('CHRONOS_SUPPORTS_MICROSECONDS', version_compare(PHP_VERSION, '7.1.0', '>=')); - -if (!class_exists('Carbon\Carbon')) { - // Create class aliases for Carbon so applications - // can upgrade more easily. - class_alias('Cake\Chronos\Chronos', 'Carbon\MutableDateTime'); - class_alias('Cake\Chronos\ChronosInterface', 'Carbon\CarbonInterface'); -} diff --git a/vendor/cakephp/debug_kit/Dockerfile b/vendor/cakephp/debug_kit/Dockerfile deleted file mode 100644 index 2966139..0000000 --- a/vendor/cakephp/debug_kit/Dockerfile +++ /dev/null @@ -1,24 +0,0 @@ -# Basic docker based environment -# Necessary to trick dokku into building the documentation -# using dockerfile instead of herokuish -FROM ubuntu:17.04 - -# Add basic tools -RUN apt-get update && \ - apt-get install -y build-essential \ - software-properties-common \ - curl \ - git \ - libxml2 \ - libffi-dev \ - libssl-dev - -RUN LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php && \ - apt-get update && \ - apt-get install -y php7.2-cli php7.2-mbstring php7.2-xml php7.2-zip php7.2-intl php7.2-opcache php7.2-sqlite - -WORKDIR /code - -VOLUME ["/code"] - -CMD [ '/bin/bash' ] diff --git a/vendor/cakephp/debug_kit/LICENSE.txt b/vendor/cakephp/debug_kit/LICENSE.txt deleted file mode 100644 index 0a0a98c..0000000 --- a/vendor/cakephp/debug_kit/LICENSE.txt +++ /dev/null @@ -1,28 +0,0 @@ -The MIT License - -CakePHP(tm) : The Rapid Development PHP Framework (http://cakephp.org) -Copyright (c) 2005-present, Cake Software Foundation, Inc. - -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. - -Cake Software Foundation, Inc. -1785 E. Sahara Avenue, -Suite 490-204 -Las Vegas, Nevada 89104, -United States of America. diff --git a/vendor/cakephp/debug_kit/README.md b/vendor/cakephp/debug_kit/README.md deleted file mode 100644 index 5cb12fc..0000000 --- a/vendor/cakephp/debug_kit/README.md +++ /dev/null @@ -1,79 +0,0 @@ -# CakePHP DebugKit -[![Build Status](https://secure.travis-ci.org/cakephp/debug_kit.png?branch=master)](http://travis-ci.org/cakephp/debug_kit) -[![Coverage Status](https://img.shields.io/codecov/c/github/cakephp/debug_kit.svg?style=flat-square)](https://codecov.io/github/cakephp/debug_kit) -[![License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.txt) -[![Total Downloads](https://img.shields.io/packagist/dt/cakephp/cakephp.svg?style=flat-square)](https://packagist.org/packages/cakephp/debug_kit) - -DebugKit provides a debugging toolbar and enhanced debugging tools for CakePHP -applications. It lets you quickly see configuration data, log messages, SQL -queries, and timing data for your application. - -:warning: DebugKit is only intended for use in single-user local development -environments. You should avoid using DebugKit in shared development -environments, staging environments, or any environment where you need to keep -configuration data and environment variables hidden. :warning: - -## Requirements - -The `master` branch has the following requirements: - -* SQLite (pdo_sqlite) or another database driver that CakePHP can talk to. By - default DebugKit will use SQLite, if you need to use a different database see - the Database Configuration section below. - -## DebugKit for CakePHP 2.x - -If you want DebugKit for your 2.x application, you can use the latest `2.2.y` tag or the [2.2 branch](https://github.com/cakephp/debug_kit/tree/2.2). - -## Installation - -* Install the plugin with [Composer](https://getcomposer.org/) from your CakePHP Project's ROOT directory (where the **composer.json** file is located) -```sh -php composer.phar require --dev cakephp/debug_kit:"~3.0" -``` - -* [Load the plugin](http://book.cakephp.org/3.0/en/plugins.html#loading-a-plugin) -```php -// src/Application.php -$this->addPlugin('DebugKit'); -``` -Prior to 3.6.0 -```php -Plugin::load('DebugKit', ['bootstrap' => true, 'routes' => true]); -``` -* Set `'debug' => true,` in `config/app.php`. - -## Reporting Issues - -If you have a problem with DebugKit please open an issue on [GitHub](https://github.com/cakephp/debug_kit/issues). - -## Contributing - -If you'd like to contribute to DebugKit, check out the -[roadmap](https://github.com/cakephp/debug_kit/wiki/roadmap) for any -planned features. You can [fork](https://help.github.com/articles/fork-a-repo) -the project, add features, and send [pull -requests](https://help.github.com/articles/using-pull-requests) or open -[issues](https://github.com/cakephp/debug_kit/issues). - -## Versions - -DebugKit has several releases, each compatible with different releases of -CakePHP. Use the appropriate version by downloading a tag, or checking out the -correct branch. - -* `1.0, 1.1, 1.2` are compatible with CakePHP 1.2.x. These releases of DebugKit - will not work with CakePHP 1.3. You can also use the `1.2-branch` for the mos - recent updates and bugfixes. -* `1.3.0` is compatible with CakePHP 1.3.x only. It will not work with CakePHP - 1.2. You can also use the `1.3` branch to get the most recent updates and - bugfixes. -* `2.2.x` are compatible with CakePHP 2.2.0 and greater. It is a necessary - upgrade for people using CakePHP 2.4 as the naming conventions around loggers - changed in that release. 2.2.x is not actively being developed. -* `3.x` is compatible with CakePHP 3.x and is still under active development. - -# Documentation - -Documentation for DebugKit can be found in the -[CakePHP documentation](https://book.cakephp.org/debugkit/3.x/en/index.html). diff --git a/vendor/cakephp/debug_kit/composer.json b/vendor/cakephp/debug_kit/composer.json deleted file mode 100644 index 0e75b69..0000000 --- a/vendor/cakephp/debug_kit/composer.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "name": "cakephp/debug_kit", - "description": "CakePHP Debug Kit", - "type": "cakephp-plugin", - "keywords": ["cakephp", "debug", "kit"], - "homepage": "https://github.com/cakephp/debug_kit", - "license": "MIT", - "authors": [ - { - "name": "Mark Story", - "homepage": "https://mark-story.com", - "role": "Author" - }, - { - "name": "CakePHP Community", - "homepage": "https://github.com/cakephp/debug_kit/graphs/contributors" - } - ], - "support": { - "issues": "https://github.com/cakephp/debug_kit/issues", - "forum": "http://stackoverflow.com/tags/cakephp", - "irc": "irc://irc.freenode.org/cakephp", - "source": "https://github.com/cakephp/debug_kit" - }, - "require": { - "php": ">=5.6.0", - "cakephp/cakephp": "^3.7.0", - "cakephp/chronos": "^1.0.0", - "cakephp/plugin-installer": "^1.0.0", - "composer/composer": "^1.3.0", - "jdorn/sql-formatter": "^1.2.0" - }, - "require-dev": { - "cakephp/authorization": "^1.3.2", - "cakephp/cakephp-codesniffer": "^3.0", - "phpunit/phpunit": "^5.7.14|^6.0" - }, - "autoload": { - "psr-4": { - "DebugKit\\": "src/", - "DebugKit\\Test\\Fixture\\": "tests/Fixture/" - } - }, - "autoload-dev": { - "psr-4": { - "Cake\\Test\\": "vendor/cakephp/cakephp/tests/", - "DebugKit\\Test\\": "tests/", - "DebugKit\\TestApp\\": "tests/test_app/", - "DebugkitTestPlugin\\": "tests/test_app/Plugin/DebugkitTestPlugin/src/" - } - }, - "suggest": { - "ext-pdo_sqlite": "DebugKit needs to store panel data in a database. SQLite is simple and easy to use." - }, - "scripts": { - "check": [ - "@cs-check", - "@test" - ], - "cs-check": "phpcs --colors -p src/ tests/", - "cs-fix": "phpcbf --colors -p src/ tests/" - } -} diff --git a/vendor/cakephp/debug_kit/config/bootstrap.php b/vendor/cakephp/debug_kit/config/bootstrap.php deleted file mode 100644 index 5b36808..0000000 --- a/vendor/cakephp/debug_kit/config/bootstrap.php +++ /dev/null @@ -1,123 +0,0 @@ -isEnabled() || php_sapi_name() === 'cli' || php_sapi_name() === 'phpdbg') { - return; -} - -if (!empty($service->getConfig('panels')['DebugKit.Deprecations'])) { - $errorLevel = Configure::read('Error.errorLevel', E_ALL | E_STRICT); - $previousHandler = set_error_handler( - function ($code, $message, $file, $line, $context = null) use (&$previousHandler) { - if ($code == E_USER_DEPRECATED || $code == E_DEPRECATED) { - DeprecationsPanel::addDeprecatedError(compact('code', 'message', 'file', 'line', 'context')); - - return; - } - if ($previousHandler) { - $context['_trace_frame_offset'] = 1; - return $previousHandler($code, $message, $file, $line, $context); - } - }, - $errorLevel | E_USER_DEPRECATED | E_DEPRECATED - ); -} - -$hasDebugKitConfig = ConnectionManager::getConfig('debug_kit'); -if (!$hasDebugKitConfig && !in_array('sqlite', PDO::getAvailableDrivers())) { - $msg = 'DebugKit not enabled. You need to either install pdo_sqlite, ' . - 'or define the "debug_kit" connection name.'; - Log::warning($msg); - - return; -} - -if (!$hasDebugKitConfig) { - ConnectionManager::setConfig('debug_kit', [ - 'className' => 'Cake\Database\Connection', - 'driver' => 'Cake\Database\Driver\Sqlite', - 'database' => TMP . 'debug_kit.sqlite', - 'encoding' => 'utf8', - 'cacheMetadata' => true, - 'quoteIdentifiers' => false, - ]); -} - -if (!CorePlugin::getCollection()->get('DebugKit')->isEnabled('routes')) { - include dirname(__FILE__) . DIRECTORY_SEPARATOR . 'routes.php'; -} - -$appClass = Configure::read('App.namespace') . '\Application'; -if (class_exists($appClass)) { - EventManager::instance()->on('Server.buildMiddleware', function ($event, $queue) use ($service) { - $middleware = new DebugKitMiddleware($service); - $queue->insertAt(0, $middleware); - }); -} else { - // Setup dispatch filter - $debugBar = new DebugBarFilter(EventManager::instance(), (array)Configure::read('DebugKit')); - $debugBar->setup(); - DispatcherFactory::add($debugBar); -} - -if (!function_exists('sql')) { - /** - * Prints out the SQL statements generated by a Query object. - * - * This function returns the same variable that was passed. - * Only runs if debug mode is enabled. - * - * @param Query $query Query to show SQL statements for. - * @param bool $showValues Renders the SQL statement with bound variables. - * @param bool|null $showHtml If set to true, the method prints the debug - * data in a browser-friendly way. - * @return Query - */ - function sql(Query $query, $showValues = true, $showHtml = null) - { - return DebugSql::sql($query, $showValues, $showHtml, 1); - } -} - -if (!function_exists('sqld')) { - /** - * Prints out the SQL statements generated by a Query object and dies. - * - * Only runs if debug mode is enabled. - * It will otherwise just continue code execution and ignore this function. - * - * @param Query $query Query to show SQL statements for. - * @param bool $showValues Renders the SQL statement with bound variables. - * @param bool|null $showHtml If set to true, the method prints the debug - * data in a browser-friendly way. - * @return void - */ - function sqld(Query $query, $showValues = true, $showHtml = null) - { - DebugSql::sqld($query, $showValues, $showHtml, 2); - } -} diff --git a/vendor/cakephp/debug_kit/config/routes.php b/vendor/cakephp/debug_kit/config/routes.php deleted file mode 100644 index 4645f19..0000000 --- a/vendor/cakephp/debug_kit/config/routes.php +++ /dev/null @@ -1,46 +0,0 @@ - '/debug-kit'], function (RouteBuilder $routes) { - $routes->setExtensions('json'); - $routes->setRouteClass(DashedRoute::class); - - $routes->connect( - '/toolbar/clear-cache', - ['controller' => 'Toolbar', 'action' => 'clearCache'] - ); - $routes->connect( - '/toolbar/*', - ['controller' => 'Requests', 'action' => 'view'] - ); - $routes->connect( - '/panels/view/*', - ['controller' => 'Panels', 'action' => 'view'] - ); - $routes->connect( - '/panels/*', - ['controller' => 'Panels', 'action' => 'index'] - ); - - $routes->connect( - '/composer/check-dependencies', - ['controller' => 'Composer', 'action' => 'checkDependencies'] - ); - - $routes->scope( - '/mail-preview', - ['controller' => 'MailPreview'], - function (RouteBuilder $routes) { - $routes->connect('/', ['action' => 'index']); - $routes->connect('/preview', ['action' => 'email']); - $routes->connect('/preview/*', ['action' => 'email']); - $routes->connect('/sent/:panel/:id', ['action' => 'sent'], ['pass' => ['panel', 'id']]); - } - ); - - $routes->get('/', ['controller' => 'Dashboard', 'action' => 'index']); - $routes->get('/dashboard', ['controller' => 'Dashboard', 'action' => 'index']); - $routes->post('/dashboard/reset', ['controller' => 'Dashboard', 'action' => 'reset']); -}); diff --git a/vendor/cakephp/debug_kit/docs.Dockerfile b/vendor/cakephp/debug_kit/docs.Dockerfile deleted file mode 100644 index 88f2c02..0000000 --- a/vendor/cakephp/debug_kit/docs.Dockerfile +++ /dev/null @@ -1,24 +0,0 @@ -# Generate the HTML output. -FROM markstory/cakephp-docs-builder as builder - -RUN pip install git+https://github.com/sphinx-contrib/video.git@master - -# Copy entire repo in with .git so we can build all versions in one image. -COPY docs /data/src - -# Make docs -RUN cd /data/docs-builder \ - && make website LANGS="en fr ja pt" SOURCE=/data/src DEST=/data/website \ - # Move media files into the output directory so video elements work. - && mkdir -p /data/website/html/_static \ - && cp /data/src/static/* /data/website/html/_static/ - -# Build a small nginx container with just the static site in it. -FROM nginx:1.15-alpine - -COPY --from=builder /data/website /data/website -COPY --from=builder /data/docs-builder/nginx.conf /etc/nginx/conf.d/default.conf - -# Move files into final location -RUN cp -R /data/website/html/* /usr/share/nginx/html \ - && rm -rf /data/website/ diff --git a/vendor/cakephp/debug_kit/docs/config/__init__.py b/vendor/cakephp/debug_kit/docs/config/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/vendor/cakephp/debug_kit/docs/config/all.py b/vendor/cakephp/debug_kit/docs/config/all.py deleted file mode 100644 index fcc02a3..0000000 --- a/vendor/cakephp/debug_kit/docs/config/all.py +++ /dev/null @@ -1,52 +0,0 @@ -# Global configuration information used across all the -# translations of documentation. -# -# Import the base theme configuration -from cakephpsphinx.config.all import * - -# The version info for the project you're documenting, acts as replacement for -# |version| and |release|, also used in various other places throughout the -# built documents. -# - -# The full version, including alpha/beta/rc tags. -release = '3.x' - -# The search index version. -search_version = 'debugkit-3' - -# The marketing display name for the book. -version_name = '' - -# Project name shown in the black header bar -project = 'CakePHP DebugKit' - -# Other versions that display in the version picker menu. -version_list = [ - {'name': '3.x', 'number': '/debugkit/3', 'title': '3.x', 'current': True}, - {'name': '4.x', 'number': '/debugkit/4', 'title': '4.x'}, -] - -# Languages available. -languages = ['en', 'fr', 'ja', 'pt'] - -# The GitHub branch name for this version of the docs -# for edit links to point at. -branch = '3.x' - -# Current version being built -version = '3.x' - -# Language in use for this directory. -language = 'en' - -show_root_link = True - -repository = 'cakephp/debug_kit' - -source_path = 'docs/' - -hide_page_contents = ('search', '404', 'contents') - -# DebugKit docs use mp4 videos to show the UI -extensions.append('sphinxcontrib.video') diff --git a/vendor/cakephp/debug_kit/docs/en/conf.py b/vendor/cakephp/debug_kit/docs/en/conf.py deleted file mode 100644 index f638bda..0000000 --- a/vendor/cakephp/debug_kit/docs/en/conf.py +++ /dev/null @@ -1,9 +0,0 @@ -import sys, os - -# Append the top level directory of the docs, so we can import from the config dir. -sys.path.insert(0, os.path.abspath('..')) - -# Pull in all the configuration options defined in the global config file.. -from config.all import * - -language = 'en' diff --git a/vendor/cakephp/debug_kit/docs/en/contents.rst b/vendor/cakephp/debug_kit/docs/en/contents.rst deleted file mode 100644 index 423e20a..0000000 --- a/vendor/cakephp/debug_kit/docs/en/contents.rst +++ /dev/null @@ -1,5 +0,0 @@ -.. toctree:: - :maxdepth: 2 - :caption: CakePHP DebugKit - - /index diff --git a/vendor/cakephp/debug_kit/docs/en/index.rst b/vendor/cakephp/debug_kit/docs/en/index.rst deleted file mode 100644 index d7b8677..0000000 --- a/vendor/cakephp/debug_kit/docs/en/index.rst +++ /dev/null @@ -1,286 +0,0 @@ -Debug Kit -######### - -DebugKit provides a debugging toolbar and enhanced debugging tools for CakePHP -applications. It lets you quickly see configuration data, log messages, SQL -queries, and timing data for your application. - -.. warning:: - - DebugKit is only intended for use in single-user local development - environments. You should avoid using DebugKit in shared development - environments, staging environments, or any environment where you need to - keep configuration data and environment variables hidden. - -Installation -============ - -By default DebugKit is installed with the default application skeleton. If -you've removed it and want to re-install it, you can do so by running the -following from your application's ROOT directory (where composer.json file is -located):: - - php composer.phar require --dev cakephp/debug_kit "~3.0" - -Then, you need to enable the plugin by executing the following line:: - - bin/cake plugin load DebugKit - -Configuration -============= - -* ``DebugKit.panels`` - Enable or disable panels for DebugKit. You can disable any of the - standard panels by:: - - // Before loading DebugKit - Configure::write('DebugKit.panels', ['DebugKit.Packages' => false]); - -* ``DebugKit.includeSchemaReflection`` - Set to true to enable logging of schema - reflection queries. Disabled by default. - -* ``DebugKit.safeTld`` - Set an array of whitelisted TLDs for local development. - This can be used to make sure DebugKit displays on hosts it otherwise determines unsafe. :: - - // Allow e.g. http://foo.bar.dev or http://my-shop.local domains locally - Configure::write('DebugKit.safeTld', ['dev', 'local', 'example']); - -* ``DebugKit.forceEnable`` - Force DebugKit to display. Careful with this, it is usually - safer to simply whitelist your local TLDs. Example usage:: - - // Before loading DebugKit - Configure::write('DebugKit.forceEnable', true); - -* ``DebugKit.ignoreAuthorization`` - Set to true to ignore Cake Authorization plugin for DebugKit requests. Disabled by default. - -Database Configuration ----------------------- - -By default DebugKit will store panel data into a SQLite database in your -application's ``tmp`` directory. If you cannot install pdo_sqlite, you can -configure DebugKit to use a different database by defining a ``debug_kit`` -connection in your **config/app.php** file. For example:: - - /** - * The debug_kit connection stores DebugKit meta-data. - */ - 'debug_kit' => [ - 'className' => 'Cake\Database\Connection', - 'driver' => 'Cake\Database\Driver\Mysql', - 'persistent' => false, - 'host' => 'localhost', - //'port' => 'nonstandard_port_number', - 'username' => 'dbusername', // Your DB username here - 'password' => 'dbpassword', // Your DB password here - 'database' => 'debug_kit', - 'encoding' => 'utf8', - 'timezone' => 'UTC', - 'cacheMetadata' => true, - 'quoteIdentifiers' => false, - //'init' => ['SET GLOBAL innodb_stats_on_metadata = 0'], - ], - -You can safely remove the **tmp/debug_kit.sqlite** file at any point. -DebugKit will regenerate it when necessary. - -Toolbar Usage -============= - -The DebugKit Toolbar is comprised of several panels, which are shown by clicking -the CakePHP icon in the bottom right-hand corner of your browser after DebugKit -has been installed and loaded. Each panel is comprised of a panel class and view -element. Typically, a panel handles the collection and display of a single type -of information such as Logs or Request information. You can choose to view panels -from the toolbar or add your own custom panels. - -Each panel lets you look at a different aspect of your application: - -* **Cache** See cache usage during a request and clear caches. -* **Environment** Display environment variables related to PHP + CakePHP. -* **History** Displays a list of previous requests, and allows you to load - and view toolbar data from previous requests. -* **Include** View the included files grouped by type. -* **Log** Display any entries made to the log files this request. -* **Packages** Display the list of packages dependencies with their actual - version and allow you to check for outdated packages. -* **Mail** Display all emails sent during the request and allow to preview - emails during development without sending them. -* **Request** Displays information about the current request, GET, POST, Cake - Parameters, Current Route information and Cookies. -* **Session** Display the information currently in the Session. -* **Sql Logs** Displays SQL logs for each database connection. -* **Timer** Display any timers that were set during the request with - ``DebugKit\DebugTimer``, and memory usage collected with - ``DebugKit\DebugMemory``. -* **Variables** Display View variables set in controller. -* **Deprecations** Display deprecation warnings in a more readable and less - disruptive format. - -Using the History Panel -======================= - -The history panel is one of the most frequently misunderstood features of -DebugKit. It provides a way to view toolbar data from previous requests, -including errors and redirects. - -.. figure:: ../_static/history-panel.png - :alt: Screenshot of the history panel in debug kit. - -As you can see, the panel contains a list of requests. On the left you can see -a dot marking the active request. Clicking any request data will load the panel -data for that request. When historical data is loaded the panel titles will -transition to indicate that alternative data has been loaded. - -.. only:: html or epub - - .. video:: ../_static/history-panel-use.mp4 - :alt: Video of history panel in action. - -Using The Mail Panel -==================== - -The mail panel allow you to track all emails sent during a request. - -.. only:: html or epub - - .. video:: ../_static/mail-panel.mp4 - :alt: Video of Mail panel in action. - -The mailer preview allows you to easily check emails during development. - -.. only:: html or epub - - .. video:: ../_static/mail-previewer.mp4 - :alt: Video of Mail panel in action. - -Creating Preview Classes ------------------------- - -In order to preview emails before sending them, you need to create a preview -class that defines the receipient and required template variables for your -mailer methods:: - - // in src/Mailer/MailPreview/WelcomePreview.php - namespace App\Mailer\Preview; - - use DebugKit\Mailer\MailPreview; - - class WelcomePreview extends MailPreview - { - public function welcome() - { - $mailer = $this->getMailer('Welcome'); - // set any template variables receipients for the mailer. - - return $mailer; - } - } - -MailPreview classes should live in the ``Mailer\Preview`` namespace of your -application or plugin, and use the ``Preview`` class suffix. - -Developing Your Own Panels -========================== - -You can create your own custom panels for DebugKit to help in debugging your -applications. - -Creating a Panel Class ----------------------- - -Panel Classes simply need to be placed in the **src/Panel** directory. The -filename should match the classname, so the class ``MyCustomPanel`` would be -expected to have a filename of **src/Panel/MyCustomPanel.php**:: - - namespace App\Panel; - - use DebugKit\DebugPanel; - - /** - * My Custom Panel - */ - class MyCustomPanel extends DebugPanel - { - ... - } - -Notice that custom panels are required to extend the ``DebugPanel`` class. - -Callbacks ---------- - -By default Panel objects have two callbacks, allowing them to hook into the -current request. Panels subscribe to the ``Controller.initialize`` and -``Controller.shutdown`` events. If your panel needs to subscribe to additional -events, you can use the ``implementedEvents()`` method to define all of the events -your panel is interested in. - -You should refer to the built-in panels for some examples on how you can build -panels. - -Panel Elements --------------- - -Each Panel is expected to have a view element that renders the content from the -panel. The element name must be the underscored inflection of the class name. -For example ``SessionPanel`` has an element named **session_panel.ctp**, and -SqllogPanel has an element named **sqllog_panel.ctp**. These elements should be -located in the root of your **src/Template/Element** directory. - -Custom Titles and Elements --------------------------- - -Panels should pick up their title and element name by convention. However, if -you need to choose a custom element name or title, you can define methods to -customize your panel's behavior: - -- ``title()`` - Configure the title that is displayed in the toolbar. -- ``elementName()`` - Configure which element should be used for a given panel. - -Panel Hook Methods ------------------- - -You can also implement the following hook methods to customize how your panel -behaves and appears: - -* ``shutdown(Event $event)`` This method typically collects and prepares the - data for the panel. Data is generally stored in ``$this->_data``. -* ``summary()`` Can return a string of summary data to be displayed in the - toolbar even when a panel is collapsed. Often this is a counter, or short - summary information. -* ``data()`` Returns the panel's data to be used as element context. This hook - method lets you further manipulate the data collected in the ``shutdown()`` - method. This method **must** return data that can be serialized. - -Panels in Other Plugins ------------------------ - -Panels provided by `plugins `_ work -almost entirely the same as other plugins, with one minor difference: You must -set ``public $plugin`` to be the name of the plugin directory, so that the -panel's Elements can be located at render time:: - - namespace MyPlugin\Panel; - - use DebugKit\DebugPanel; - - class MyCustomPanel extends DebugPanel - { - public $plugin = 'MyPlugin'; - ... - } - -To use a plugin or app panel, update your application's DebugKit configuration -to include the panel:: - - // in src/Application.php bootstrap() method add - Configure::write('DebugKit.panels', ['App', 'MyPlugin.MyCustom']); - $this->addPlugin('DebugKit', ['bootstrap' => true]); - -The above would load all the default panels as well as the ``AppPanel``, and -``MyCustomPanel`` panel from ``MyPlugin``. - -Helper Functions -================ - -* ``sql()`` Dumps out the SQL from an ORM query. -* ``sqld()`` Dumps out the SQL from an ORM query, and exits. diff --git a/vendor/cakephp/debug_kit/docs/fr/conf.py b/vendor/cakephp/debug_kit/docs/fr/conf.py deleted file mode 100644 index b02032e..0000000 --- a/vendor/cakephp/debug_kit/docs/fr/conf.py +++ /dev/null @@ -1,9 +0,0 @@ -import sys, os - -# Append the top level directory of the docs, so we can import from the config dir. -sys.path.insert(0, os.path.abspath('..')) - -# Pull in all the configuration options defined in the global config file.. -from config.all import * - -language = 'fr' diff --git a/vendor/cakephp/debug_kit/docs/fr/contents.rst b/vendor/cakephp/debug_kit/docs/fr/contents.rst deleted file mode 100644 index 423e20a..0000000 --- a/vendor/cakephp/debug_kit/docs/fr/contents.rst +++ /dev/null @@ -1,5 +0,0 @@ -.. toctree:: - :maxdepth: 2 - :caption: CakePHP DebugKit - - /index diff --git a/vendor/cakephp/debug_kit/docs/fr/index.rst b/vendor/cakephp/debug_kit/docs/fr/index.rst deleted file mode 100644 index 209477f..0000000 --- a/vendor/cakephp/debug_kit/docs/fr/index.rst +++ /dev/null @@ -1,239 +0,0 @@ -Debug Kit -######### - -DebugKit est un plugin supporté par la core team qui fournit une toolbar pour -vous aider à debugger les applications CakePHP plus facilement. -DebugKit fournit une barre d'outils de débuggage et des outils de débuggage -améliorés pour les applications CakePHP. Il vous permet de voir rapidement les -données de configuration, les messages de logs, les requêtes SQL et des données -de temps d'exécution pour votre application. - -.. warning:: - - DebugKit est uniquement destiné à être utilisé dans des environnements de - développement local à un seul utilisateur. Vous devez éviter d'utiliser - DebugKit dans les environnements de développement partagés, les - environnements de stagging où vous devez garder les données de configuration - et les variables d'environnement cachées. - -Installation -============ - -Par défaut DebugKit est installé avec le squelette d'application. Si vous -le retirez et voulez le réinstaller, vous pouvez le faire en lançant ce qui -suit à partir du répertoire ROOT de votre application (où le fichier -composer.json est localisé):: - - php composer.phar require --dev cakephp/debug_kit "~3.0" - -Ensuite, vous devez activer le plugin en exécutant la ligne suivante:: - - bin/cake plugin load DebugKit - -Configuration -============= - -* ``DebugKit.ignoreAuthorization`` - Définie à true pour ignorer le plugin Cake Authorization uniquement pour les requêtes DebugKit. Par défaut à false. - -Stockage de DebugKit -==================== - -Par défaut, DebugKit utilise une petite base de données SQLite dans le -répertoire ``/tmp`` de votre application pour stocker les données du panneau. -Si vous voulez que DebugKit stocke ses données ailleurs, vous pouvez définir -une connexion ``debug_kit``. - -Configuration de Base de Données --------------------------------- - -Par défaut DebugKit va stocker les données du panneau dans une base de données -SQLite dans le répertoire ``tmp`` de votre application. Si vous ne pouvez pas -installer pdo_sqlite, vous pouvez configurer DebugKit pour utiliser une base -de données différente en définissant une connexion ``debug_kit`` dans votre -fichier **config/app.php**. - -Utilisation de la Toolbar -========================= - -La Toolbar de DebugKit comprend plusieurs panneaux, qui apparaissent en -cliquant sur l'icone CakePHP dans le coin en bas à droite de la fenêtre de -votre navigateur. Une fois que la toolbar est ouverte, vous devriez voir une -série de boutons. Chacun de ces boutons s'agrandit en un panneau avec des -informations liées. - -Chaque panneau vous permet d'inspecter plusieurs aspects de votre application: - -* **Cache** Voir l'utilisation du cache pendant une requête et nettoyer les - caches. -* **Environment** Affiche les variables d'environnement liées à PHP + CakePHP. -* **History** Affiche une liste des requêtes précédentes, et vous permet de - charger et de voir les données de la toolbar des requêtes précédentes. -* **Include** Voir les fichiers inclus groupés par type. -* **Log** Affiche toute entrée faite dans les fichiers de log par cette requête. -* **Packages** Affiche la liste des dépendances avec leur version courante et - vous permet de vérifier les packages qui ne sont pas à jour. -* **Mail** Affiche tous les emails envoyés pendant la requête et permet de - prévisualiser les emails pendant le développement sans les envoyer. -* **Request** Affiche les informations sur la requête courante, GET, POST, les - paramètre de Cake, sur la Route Courante et les Cookies. -* **Session** Affiche les informations actuellement dans la Session. -* **Sql Logs** Affiche les logs SQL pour chaque connexion à la base de données. -* **Timer** Affiche tout timers qui a été défini pendant la requête avec - ``DebugKit\DebugTimer``, et l'utilisation de la mémoire collectée avec - ``DebugKit\DebugMemory``. -* **Variables** Affiche les variables de View définies dans le controller. - -Typiquement, un panneau gère la collection et affiche un type unique -d'information comme les Logs ou les informations de la Requête. Vous pouvez -choisir de voir les panneaux de la toolbar ou ajouter vos panneaux -personnalisés. - -Utiliser le Panneau d'Historique -================================ - -Le panneau d'historique est l'une des fonctionnalités les plus souvent mal -comprise de DebugKit. Elle est un moyen de voir les données de la toolbar des -requêtes précédentes, d'inclure les erreurs et les redirects. - -.. figure:: ../_static/history-panel.png - :alt: Capture d'écran du panneau historique dans debug kit. - -Comme vous pouvez le voir, le panneau contient une liste des requêtes. Sur la -gauche, vous pouvez voir un point marquant la requête actuelle. Cliquer -sur n'importe quelles données de requête va charger les données du panneau -pour cette requête. Quand les données historiques sont chargées, les titres -du panneau seront colorés pour indiquer que des données alternatives ont été -chargées. - -.. only:: html or epub - - .. video:: ../_static/history-panel-use.mp4 - :alt: Video du panneau historique en action. - -Utiliser le Panneau Mail -======================== - -Le panneau de mail vous permet de pister tous les emails envoyés pendant une -requête. - -.. only:: html or epub - - .. video:: ../_static//mail-panel.mp4 - :alt: Video du panneau Mail en action. - -La prévisualisation de mail vous permet de facilement vérifier les emails -pendant le développement. - -.. only:: html or epub - - .. video:: ../_static/img/mail-previewer.gif - :alt: Video du panneau Mail en action. - -Développer vos Propres Panneaux -=============================== - -Vous pouvez créer vos propres panneaux personnalisés pour DebugKit pour -améliorer le debug de vos applications. - -Créer une Classe Panel ----------------------- - -Les Classes Panel doivent simplement être placées dans le répertoire -**src/Panel**. Le nom de fichier doit correspondre au nom de la classe, pour -que la classe ``MyCustomPanel`` s'attende à avoir un fichier au nom -**src/Panel/MyCustomPanel.php**:: - - namespace App\Panel; - - use DebugKit\DebugPanel; - - /** - * Mon panneau Personnalisé - */ - class MyCustomPanel extends DebugPanel - { - ... - } - -Remarquez que les panneaux personnalisés doivent étendre la classe -``DebugPanel``. - -Callbacks ---------- - -Par défaut, les objets Panel ont deux callbacks, leur permettant de s'insérer -dans la requête actuelle. Les panneaux s'inscrivent aux events -``Controller.initialize`` et ``Controller.shutdown``. Si votre panneau doit -s'inscrire à des events supplémentaires, vous pouvez utiliser la méthode -``implementedEvents()`` pour définir tous les events auxquels votre panneau -doit s'intéresser. - -Vous devez vous référer aux panneaux intégrés pour avoir quelques exemples sur -la façon de construire des panneaux. - -Elements de Panneau -------------------- - -Chaque panneau s'attend à avoir un element de view qui rend le contenu du -panneau. Le nom de l'element doit être avec une inflection en underscore du -nom de la classe. -Par exemple ``SessionPanel`` a un element nommé **session_panel.ctp**, et -SqllogPanel a un element nommé **sqllog_panel.ctp**. Ces elements doivent être -localisés à la racine de votre répertoire **src/Template/Element**. - -Titres Personnalisés et Elements --------------------------------- - -Les panneaux doivent choisir leur titre et leur nom d'element par convention. -Cependant, si vous avez besoin de choisir un nom ou un titre d'element -personnalisé, vous pouvez définir des méthodes pour personnaliser le -comportement de votre panneau: - -- ``title()`` - Configure le titre qui est affiché dans la toolbar. -- ``elementName()`` Configure l'element qui doit être utilisé pour un panneau - donné. - -Méthodes de Hook pour Panneaux ------------------------------- - -Vous pouvez également implémenter les méthodes suivantes pour personnaliser -la manière dont votre panneau se comporte et s'affiche: - -* ``shutdown(Event $event)`` Cette méthode collecte et prépare les données pour - panneau. Les données sont généralement stockées dans ``$this->_data``. -* ``summary()`` Peut retourner une chaine de caractères contenu un résumé de - données qui sera affiché dans la barre lorsque le panneau est replié. C'est - souvent un compteur ou un court résumé. -* ``data()`` Retourne les données du panneau pour être utilisées dans un - element. Cette méthode vous laisse manipuler les données collectées dans - la méthode ``shutdown()``. cette méthode **doit** retourner des données - sérializables. - -Panneaux dans d'autres Plugins ------------------------------- - -Les panneaux fournis par les `plugins -`_ fonctionnent presque entièrement de -la même façon que les autres plugins, avec quelques différences mineures: Vous -devez définir ``public $plugin`` comme nom de répertoire de plugin, pour -que les elements du panneau puissent être localisés au moment de les afficher:: - - namespace MyPlugin\Panel; - - use DebugKit\DebugPanel; - - class MyCustomPanel extends DebugPanel - { - public $plugin = 'MyPlugin'; - ... - } - -Pour utiliser un panneau de plugin ou de l'application, mettez à jour -la configuration du DebugKit de votre application pour ajouter le panneau:: - - // dans config/bootstrap.php - Configure::write('DebugKit.panels', ['App', 'MyPlugin.MyCustom']); - Plugin::load('DebugKit', ['bootstrap' => true]); - -Ce qui est au-dessus charge tous les panneaux par défaut ainsi que le panneau -``AppPanel``et le panneau ``MyCustomPanel`` depuis ``MyPlugin``. diff --git a/vendor/cakephp/debug_kit/docs/ja/conf.py b/vendor/cakephp/debug_kit/docs/ja/conf.py deleted file mode 100644 index 5871da6..0000000 --- a/vendor/cakephp/debug_kit/docs/ja/conf.py +++ /dev/null @@ -1,9 +0,0 @@ -import sys, os - -# Append the top level directory of the docs, so we can import from the config dir. -sys.path.insert(0, os.path.abspath('..')) - -# Pull in all the configuration options defined in the global config file.. -from config.all import * - -language = 'ja' diff --git a/vendor/cakephp/debug_kit/docs/ja/contents.rst b/vendor/cakephp/debug_kit/docs/ja/contents.rst deleted file mode 100644 index 423e20a..0000000 --- a/vendor/cakephp/debug_kit/docs/ja/contents.rst +++ /dev/null @@ -1,5 +0,0 @@ -.. toctree:: - :maxdepth: 2 - :caption: CakePHP DebugKit - - /index diff --git a/vendor/cakephp/debug_kit/docs/ja/index.rst b/vendor/cakephp/debug_kit/docs/ja/index.rst deleted file mode 100644 index a6f0277..0000000 --- a/vendor/cakephp/debug_kit/docs/ja/index.rst +++ /dev/null @@ -1,267 +0,0 @@ -Debug Kit -######### - -DebugKit は、CakePHP アプリケーション用のデバッグツールバーと拡張デバッグツールを提供します。 -アプリケーションの設定データ、ログメッセージ、SQL クエリー、およびタイミングデータをすばやく -確認できます。 - -.. warning:: - - DebugKit は、シングルユーザーのローカル開発環境での使用を目的としています。 - 共有開発環境、ステージング環境、または設定データと環境変数を隠しておく必要がある環境では、 - DebugKit を使用しないでください。 - -インストール -============ - -デフォルトで、DebugKit はデフォルトのアプリケーションスケルトンにインストールされています。 -もし削除してしまって再インストールしたい場合は、以下のコマンドをアプリケーションの -ルートディレクトリー (composer.json ファイルのある場所) で実行してください。 :: - - php composer.phar require --dev cakephp/debug_kit "~3.0" - -そして以下のコマンドでプラグインを有効化する必要があります。 :: - - bin/cake plugin load DebugKit - -設定 -==== - -* ``DebugKit.panels`` - DebugKit のパネルを有効化または無効化します。 - 次のようにして、任意の標準パネルを無効にすることができます。 :: - - // DebugKit をロードする前に - Configure::write('DebugKit.panels', ['DebugKit.Packages' => false]); - -* ``DebugKit.includeSchemaReflection`` - スキーマリフレクションクエリーの - ロギングを有効にするには、true に設定します。デフォルトは無効になっています。 - -* ``DebugKit.safeTld`` - ローカル開発用のトップレベルドメインのホワイトリストを設定します。 - これにより安全でないと判断したホスト上で DebugKit を表示できるようになります。 :: - - // 例: http://foo.bar.dev または http://my-shop.local のドメインはローカルとして許可する - Configure::write('DebugKit.safeTld', ['dev', 'local', 'example']); - -* ``DebugKit.forceEnable`` - DebugKit を強制的に表示します。これを使うときは注意してください。 - 通常は単純にローカルのトップレベルドメインをホワイトリストに追加したほうが安全です。 使用例:: - - // DebugKit をロードする前に - Configure::write('DebugKit.forceEnable', true); - -データベース設定 ----------------- - -デフォルトでは DebugKit はアプリケーションの ``/tmp`` 内の SQLite データベースに -パネルデータを保持します。もし pdo_sqlite をインストールできない場合は、 -**config/app.php** ファイル に ``debug_kit`` コネクションを定義すると -DebugKit が異なるデータベースを使用するように設定できます。例:: - - /** - * debug_kit コネクションは DebugKit のメタデータを格納します。 - */ - 'debug_kit' => [ - 'className' => 'Cake\Database\Connection', - 'driver' => 'Cake\Database\Driver\Mysql', - 'persistent' => false, - 'host' => 'localhost', - //'port' => 'nonstandard_port_number', - 'username' => 'dbusername', // Your DB username here - 'password' => 'dbpassword', // Your DB password here - 'database' => 'debug_kit', - 'encoding' => 'utf8', - 'timezone' => 'UTC', - 'cacheMetadata' => true, - 'quoteIdentifiers' => false, - //'init' => ['SET GLOBAL innodb_stats_on_metadata = 0'], - ], - -**tmp/debug_kit.sqlite** ファイルは、いつでも削除することができます。 -DebugKit は、必要に応じて、それを再生成します。 - -ツールバーの使い方 -================== - -DebugKit ツールバーは、いくつかのパネルで構成されています。これらのパネルは、 -DebugKit をインストールしてロードした後、ブラウザーの右下隅にある CakePHP -アイコンをクリックすると表示されます。各パネルは、パネルクラスとビューエレメントで構成されています。 -一般的に、パネルは単一の種類の情報のコレクションの処理やログやリクエスト情報の表示を行います。 -ツールバーからパネルを表示したり、独自のカスタムパネルを追加することを選択できます。 - -各パネルはアプリケーションの様々な側面を見せてくれます。 - -* **Cache** リクエスト中のキャッシュの使用状況の確認とキャッシュのクリアー。 -* **Environment** PHP 及び CakePHP に関連する環境変数の表示。 -* **History** 以前のリクエストの一覧の表示と、以前のリクエストのツールバーデータの読み込みと表示。 -* **Include** タイプごとにグループ化されたインクルードファイルを表示。 -* **Log** このリクエスト中にログファイルに加えられたすべてのエントリーを表示。 -* **Packages** 現在のバージョンのパッケージの依存関係の一覧を表示し、 - 古いパッケージをチェックすることができます。 -* **Mail** このリクエスト中の全てのメール送信を表示し、 - 送信せずに開発中のメールのプレビューができます。 -* **Request** 現在のリクエスト、GET、POST、Cake パラメーター、現在のルート情報、クッキー情報の表示。 -* **Session** 現在のセッション情報の表示。 -* **Sql Logs** 各データベースコネクションの SQL ログの表示。 -* **Timer** リクエスト中に ``DebugKit\DebugTimer`` で設定されたすべてのタイマーと、 - ``DebugKit\DebugMemory`` で収集されたメモリー使用状況の表示。 -* **Variables** コントローラーでセットされたビュー変数の表示。 - -履歴パネルを使用する -==================== - -履歴パネルは DebugKit で最も勘違いされやすい機能の一つです。 -エラーやリダイレクトを含む以前のリクエストのツールバーのデータを表示することができます。 - -.. figure:: ../_static/history-panel.png - :alt: Screenshot of the history panel in debug kit. - -ご覧のようにパネルにはリクエストの一覧が含まれます。左側にドットがついているのがアクティブな -リクエストです。どれかのリクエストをクリックするとそのリクエストのデータが読み込まれます。 -履歴データがロードされると代替のデータが読み込まれたことを示すようにパネルのタイトルが遷移します。 - -.. only:: html or epub - - .. video:: ../_static/history-panel-use.mp4 - :alt: Video of history panel in action. - -メールパネルを使用 -================== - -メールパネルは、リクエストの間に送信された全てのメールを追跡することができます。 - -.. only:: html or epub - - .. video:: ../_static/mail-panel.mp4 - :alt: Video of mail panel in action - -メーラープレビューは、開発中のメールを簡単にプレビューすることができます。 - -.. only:: html or epub - - .. video:: ../_static/mail-previewer.mp4 - :alt: Video of mail panel in action - -プレビュークラスの作成 ------------------------- - -メールを送信する前にプレビューするには、受信者と mailer メソッドに必要なテンプレート変数を -定義するプレビュークラスを作成する必要があります。 :: - - // src/Mailer/MailPreview/WelcomePreview.php の中で - namespace App\Mailer\Preview; - - use DebugKit\Mailer\MailPreview; - - class WelcomePreview extends MailPreview - { - public function welcome() - { - $mailer = $this->getMailer('Welcome'); - // メーラーのテンプレート変数受信者を設定します。 - - return $mailer; - } - } - -MailPreview クラスは、 アプリケーションまたはプラグインの ``Mailer\Preview`` -名前空間に存在し、 ``Preview`` を使用する必要があります。 - -独自のパネルを開発する -====================== - -アプリケーションのデバッグを補助するための DebugKit の独自のカスタムパネルを -作成することができます。 - -パネルクラスを作成する ----------------------- - -パネルクラスは単に **src/Panel** ディレクトリーに設置してください。ファイル名はクラス名と -一致する必要があります。 つまり ``MyCustomPanel`` クラスは -**src/Panel/MyCustomPanel.php** というファイル名であることを想定しています。 :: - - namespace App\Panel; - - use DebugKit\DebugPanel; - - /** - * My Custom Panel - */ - class MyCustomPanel extends DebugPanel - { - ... - } - -カスタムパネルは ``DebugPanel`` クラスを拡張する必要があることに注意してください。 - -コールバック ------------- - -デフォルトではパネルオブジェクトには、現在のリクエストをフックすることができる -2つのコールバックがあります。パネルは ``Controller.initialize`` と -``Controller.shutdown`` のイベントを取得します。もしパネルが追加のイベントを -取得したい場合は、 ``implementedEvents()`` メソッドを使用し、 -パネルが必要とするすべてのイベントを定義できます。 - -どのようにパネルを構築するかについてのいくつかの例として、ビルトインのパネルを参照してください。 - -パネルの構成要素 ----------------- - -各パネルはパネルのコンテンツを描画するためのビューエレメントがあることを想定しています。 -エレメント名はアンダースコアー区切りのクラス名である必要があります。 -たとえば、 ``SessionPanel`` は **session_panel.ctp** という名前のエレメントを持ちます。 -また、SqllogPanelは **sqllog_panel.ctp** という名前のエレメントを持ちます。 -これらのエレメントは **src/Template/Element** ディレクトリーのルートに設置する必要があります。 - -カスタムのタイトルとエレメント ------------------------------- - -パネルは慣例を元にそのタイトルとエレメント名を補足します。もしカスタムのタイトルやエレメント名を -付けたい場合は、パネルの振る舞いをカスタムするメソッドを定義することができます。 - -- ``title()`` - ツールバー上に表示されるタイトルを設定します -- ``elementName()`` - 与えられたパネルがどのエレメントを使用するかを設定します - -パネルフックメソッド --------------------- - -また、パネルの動作や表示方法をカスタムするために以下のフックメソッドを実装することができます。 - -* ``shutdown(Event $event)`` このメソッドは通常はパネルのデータの収集と準備を行います。 -* ``summary()`` パネルが折りたたまれている時に表示されるサマリーデータの文字列を - 返すことができます。多くの場合、これは件数や短いサマリー情報です。 -* ``data()`` エレメントのコンテキストで使用されるパネルのデータを返します。 - このフックメソッドは ``shutdown()`` で収集されるデータを更に操作することができます。 - このメソッドはシリアライズ化可能なデータを **必ず** 返す必要があります。 - -他のプラグインのパネル ----------------------- - -パネルはひとつの小さな違いを除き、`plugins `_ -とほぼ同じ動作を提供します。レンダリング時にパネルのエレメントを配置できるように、 -``public $plugin`` にプラグインディレクトリーの名前を必ずセットする必要があります。 :: - - namespace MyPlugin\Panel; - - use DebugKit\DebugPanel; - - class MyCustomPanel extends DebugPanel - { - public $plugin = 'MyPlugin'; - ... - } - -プラグインやアプリケーションパネルを使用するには、アプリケーションの DebugKit の設定を -更新します。 :: - - // src/Application.php の bootstrap() メソッドの中に追加 - Configure::write('DebugKit.panels', ['App', 'MyPlugin.MyCustom']); - $this->addPlugin('DebugKit', ['bootstrap' => true]); - -上記は、すべてのデフォルトのパネルと同じように ``AppPanel`` と ``MyPlugin`` の -``MyCustomPanel`` パネルを読みこみます。 - -ヘルパー関数 -================ - -* ``sql()`` ORM クエリーから SQL をダンプします。 -* ``sqld()`` ORM クエリーから SQL をダンプして終了します。 diff --git a/vendor/cakephp/debug_kit/docs/pt/conf.py b/vendor/cakephp/debug_kit/docs/pt/conf.py deleted file mode 100644 index 9e22cb0..0000000 --- a/vendor/cakephp/debug_kit/docs/pt/conf.py +++ /dev/null @@ -1,9 +0,0 @@ -import sys, os - -# Append the top level directory of the docs, so we can import from the config dir. -sys.path.insert(0, os.path.abspath('..')) - -# Pull in all the configuration options defined in the global config file.. -from config.all import * - -language = 'pt' diff --git a/vendor/cakephp/debug_kit/docs/pt/contents.rst b/vendor/cakephp/debug_kit/docs/pt/contents.rst deleted file mode 100644 index 423e20a..0000000 --- a/vendor/cakephp/debug_kit/docs/pt/contents.rst +++ /dev/null @@ -1,5 +0,0 @@ -.. toctree:: - :maxdepth: 2 - :caption: CakePHP DebugKit - - /index diff --git a/vendor/cakephp/debug_kit/docs/pt/index.rst b/vendor/cakephp/debug_kit/docs/pt/index.rst deleted file mode 100644 index d73d860..0000000 --- a/vendor/cakephp/debug_kit/docs/pt/index.rst +++ /dev/null @@ -1,216 +0,0 @@ -Debug Kit -######### - -DebugKit é um plugin suportado pelo time principal do CakePHP que oferece uma -barra de ferramentas para auxiliar na depuração de aplicações do CakePHP. - -Instalação -========== - -Por padrão o DebugKit é instalado com o esqueleto padrão da aplicação. Se -você o removeu e gostaria de reinstalá-lo, você pode executar o seguinte comando -a partir do diretório raiz da aplicação -(onde o arquivo composer.json está localizado):: - - php composer.phar require --dev cakephp/debug_kit "~3.0" - -Então, você precisará habilitar o plugin ao executar o seguinte comando:: - - bin/cake plugin load DebugKit - -Armazenamento do DebugKit -========================= - -Por padrão, o DebugKit usa um pequeno banco de dados SQLite no diretório -``/tmp`` de sua aplicação para armazenar os dados referentes ao painel -de informações. Se você quiser que o DebugKit armazene seus dados em outro -lugar, é necessário configurar uma nova conexão com o nome ``debug_kit`` . - -Configuração do banco de dados ------------------------------- - -Como informado anteriormente, por padrão, o DebugKit armazenará os dados do -painel em um banco de dados SQLite no diretório ``/tmp`` de sua aplicação. Se -você não puder instalar a extensão pdo_sqlite do PHP, você pode configurar o -DebugKit para usar um banco de dados diferente ao definir uma conexão -``debug_kit`` em seu arquivo **config/app.php**. Por exemplo:: - - /** - * A conexão debug_kit armazena meta-dados do DebugKit. - */ - 'debug_kit' => [ - 'className' => 'Cake\Database\Connection', - 'driver' => 'Cake\Database\Driver\Mysql', - 'persistent' => false, - 'host' => 'localhost', - //'port' => 'nonstandard_port_number', - 'username' => 'dbusername', // Your DB username here - 'password' => 'dbpassword', // Your DB password here - 'database' => 'debug_kit', - 'encoding' => 'utf8', - 'timezone' => 'UTC', - 'cacheMetadata' => true, - 'quoteIdentifiers' => false, - //'init' => ['SET GLOBAL innodb_stats_on_metadata = 0'], - ], - -Uso da barra de ferramentas -=========================== - -A barra de ferramentas do DebugKit é composta por vários painéis, que são -exibidos ao clicar no ícone do CakePHP no canto inferior direito da janela do -seu navegador. Uma vez que a barra de ferramentas é aberta, você deverá ver uma -série de botões. Cada um desses botões se expande em um painel de informações -relacionadas. - -Cada painel permite a você observar aspectos diferentes da sua aplicação: - -* **Cache** Exibe o uso de cache durante uma solicitação e limpa caches. -* **Environment** Exibe variáveis de ambiente relacionadas com PHP + CakePHP. -* **History** Exibe uma lista de requisições anteriores, e permite que você - carregue e veja dados da barra de ferramentas a partir de solicitações - anteriores. -* **Include** Exibe os arquivos inclusos divididos por grupo. -* **Log** Exibe todas as entradas feitas nos arquivos de log este pedido. -* **Request** Exibe informações sobre a requisição atual, GET, POST, informações - sobre a rota atual do Cake e Cookies. -* **Session** Exibe a informação atual da sessão. -* **Sql Logs** Exibe logs SQL para cada conexão com o banco de dados. -* **Timer** Exibe qualquer temporizador que fora definido durante a requisição - com ``DebugKit\DebugTimer``, e memória utilizada coletada com - ``DebugKit\DebugMemory``. -* **Variables** Exibe variáveis de View definidas em um Controller. - -Tipicamente, um painel manipula a recolha e apresentação de um único tipo -de informações como logs ou informações de requisições. Você pode optar por -visualizar os painéis padrões da barra de ferramentas ou adicionar seus próprios -painéis personalizados. - -Usando o painel History -======================= - -O painel History é uma das características mais frequentemente confundidas do -DebugKit. Ele oferece uma forma de visualizar os dados de requisições -anteriores na barra de ferramentas, incluindo erros e redirecionamentos. - -.. figure:: /_static/img/history-panel.png - :alt: Screenshot do painel History no DebugKit. - -Como você pode ver, o painel contém uma lista de requisições. Na esquerda você -pode ver um ponto marcando a requisição ativa. Clicar em qualquer requisição vai -carregar os dados referentes a mesma no painel. Quando os dados são carregados, -os títulos do painel vão sofrer uma transição para indicar que informações -alternativos foram carregados. - -.. only:: html or epub - - .. figure:: /_static/img/history-panel-use.gif - :alt: Video do painel History em ação. - -Desenvolvendo seus próprios painéis -=================================== - -Você pode criar seus próprios painéis customizados do DebugKit para ajudar -na depuração de suas aplicações. - -Criando uma Panel Class ------------------------ - -Panel Classes precisam ser colocadas no diretório **src/Panel**. O -nome do arquivo deve combinar com o nome da classe, então a classe -``MyCustomPanel`` deveria remeter ao nome de arquivo -**src/Panel/MyCustomPanel.php**:: - - namespace App\Panel; - - use DebugKit\DebugPanel; - - /** - * My Custom Panel - */ - class MyCustomPanel extends DebugPanel - { - ... - } - -Perceba que painéis customizados são necessários para extender a classe -``DebugPanel``. - -Callbacks ---------- - -Por padrão objetos do painel possuem dois callbacks, permitindo-lhes acoplar-se -na requisição atual. Painéis inscrevem-se aos eventos ``Controller.initialize`` -e ``Controller.shutdown``. Se o seu painel precisa inscrever-se a eventos -adicionais, você pode usar o método ``implementedEvents`` para definir todos os -eventos aos quais o seu painel possa precisar estar inscrito. - -Você deveria estudar os painéis nativos para absorver alguns exemplos de como -construir painéis. - -Elementos do painel -------------------- - -Cada painel deve ter um elemento view que renderiza o conteúdo do mesmo. -O nome do elemento deve ser sublinhado e flexionado a partir do nome da classe. -Por exemplo ``SessionPanel`` deve possuir um elemento nomeado -**session_panel.ctp**, e SqllogPanel deve possuir um elemento nomeado -**sqllog_panel.ctp**. Estes elementos devem estar localizados na raiz do seu -diretório **src/Template/Element**. - -Títulos personalizados e Elementos ----------------------------------- - -Os painéis devem relacionar o seu título e o nome do elemento por convenção. No -entanto, se você precisa escolher um nome de elemento personalizado ou título, -você pode definir métodos para customizar o comportamento do seu painel: - -- ``title()`` - Configure o título que é exibido na barra de ferramentas. -- ``elementName()`` - Configure qual elemento deve ser utilizada para um - determinado painel. - -Métodos de captura ------------------- - -Você também pode implementar os seguintes métodos para customizar como o seu -painel se comporta e se aparenta: - -* ``shutdown(Event $event)`` Esse método coleta e prepara os dados para o - painel. Os dados são geralmente armazenados em ``$this->_data``. -* ``summary()`` Este método retorna uma *string* de dados resumidos para serem - exibidos na *toolbar*, mesmo quando um painel está minimizado. Frequentemente, - é um contador ou um pequeno resumo de informações. -* ``data()`` Este método retorna os dados do painel que serão usados como - contexto para o elemento. Você pode manipular os dados coletados no método - ``shutdown()``. Esse método **deve** retornar dados que podem ser - serializados. - -Painéis em outros plugins -------------------------- - -Painéis disponibilizados por `plugins -`_ funcionam quase que totalmente -como outros plugins, com uma pequena diferença: Você deve definir ``public -$plugin`` como o nome do diretório do plugin, com isso os elementos do painel -poderão ser encontrados no momento de renderização:: - - namespace MyPlugin\Panel; - - use DebugKit\DebugPanel; - - class MyCustomPanel extends DebugPanel - { - public $plugin = 'MyPlugin'; - ... - } - -Para usar um plugin ou painel da aplicação, atualize a configuração do DebugKit -de sua aplicação para incluir o painel:: - - Configure::write( - 'DebugKit.panels', - array_merge(Configure::read('DebugKit.panels'), ['MyCustomPanel']) - ); - -O código acima deve carregar todos os painéis padrão tanto como os outros -painéis customizados do ``MyPlugin``. diff --git a/vendor/cakephp/debug_kit/src/Cache/Engine/DebugEngine.php b/vendor/cakephp/debug_kit/src/Cache/Engine/DebugEngine.php deleted file mode 100644 index 3634e55..0000000 --- a/vendor/cakephp/debug_kit/src/Cache/Engine/DebugEngine.php +++ /dev/null @@ -1,317 +0,0 @@ - 0, - 'delete' => 0, - 'read' => 0, - 'hit' => 0, - 'miss' => 0, - ]; - - /** - * Constructor - * - * @param mixed $config Config data or the proxied adapter. - */ - public function __construct($config) - { - $this->_config = $config; - } - - /** - * Initialize the proxied Cache Engine - * - * @param array $config Array of setting for the engine. - * @return bool True, this engine cannot fail to initialize. - */ - public function init(array $config = []) - { - if (is_object($this->_config)) { - $this->_engine = $this->_config; - - return true; - } - $registry = new CacheRegistry(); - $this->_engine = $registry->load('spies', $this->_config); - unset($registry); - - return true; - } - - /** - * Get the internal engine - * - * @return \Cake\Cache\CacheEngine - */ - public function engine() - { - return $this->_engine; - } - - /** - * Get the metrics for this object. - * - * @return array - */ - public function metrics() - { - return $this->_metrics; - } - - /** - * Track a metric. - * - * @param string $metric The metric to increment. - * @return void - */ - protected function _track($metric) - { - $this->_metrics[$metric]++; - } - - /** - * {@inheritDoc} - */ - public function write($key, $value) - { - $this->_track('write'); - DebugTimer::start('Cache.write ' . $key); - $result = $this->_engine->write($key, $value); - DebugTimer::stop('Cache.write ' . $key); - - return $result; - } - - /** - * {@inheritDoc} - */ - public function writeMany($data) - { - $this->_track('write'); - DebugTimer::start('Cache.writeMany'); - $result = $this->_engine->writeMany($data); - DebugTimer::stop('Cache.writeMany'); - - return $result; - } - - /** - * {@inheritDoc} - */ - public function read($key) - { - $this->_track('read'); - DebugTimer::start('Cache.read ' . $key); - $result = $this->_engine->read($key); - DebugTimer::stop('Cache.read ' . $key); - $metric = 'hit'; - if ($result === false) { - $metric = 'miss'; - } - $this->_track($metric); - - return $result; - } - - /** - * {@inheritDoc} - */ - public function readMany($data) - { - $this->_track('read'); - DebugTimer::start('Cache.readMany'); - $result = $this->_engine->readMany($data); - DebugTimer::stop('Cache.readMany'); - - return $result; - } - - /** - * {@inheritDoc} - */ - public function increment($key, $offset = 1) - { - $this->_track('write'); - DebugTimer::start('Cache.increment ' . $key); - $result = $this->_engine->increment($key, $offset); - DebugTimer::stop('Cache.increment ' . $key); - - return $result; - } - - /** - * {@inheritDoc} - */ - public function decrement($key, $offset = 1) - { - $this->_track('write'); - DebugTimer::start('Cache.decrement ' . $key); - $result = $this->_engine->decrement($key, $offset); - DebugTimer::stop('Cache.decrement ' . $key); - - return $result; - } - - /** - * {@inheritDoc} - */ - public function delete($key) - { - $this->_track('delete'); - DebugTimer::start('Cache.delete ' . $key); - $result = $this->_engine->delete($key); - DebugTimer::stop('Cache.delete ' . $key); - - return $result; - } - - /** - * {@inheritDoc} - */ - public function deleteMany($data) - { - $this->_track('delete'); - DebugTimer::start('Cache.deleteMany'); - $result = $this->_engine->deleteMany($data); - DebugTimer::stop('Cache.deleteMany'); - - return $result; - } - - /** - * {@inheritDoc} - */ - public function clear($check) - { - $this->_track('delete'); - DebugTimer::start('Cache.clear'); - $result = $this->_engine->clear($check); - DebugTimer::stop('Cache.clear'); - - return $result; - } - - /** - * {@inheritDoc} - */ - public function groups() - { - return $this->_engine->groups(); - } - - /** - * Return the proxied configuration data. - * - * This method uses func_get_args() as not doing so confuses the - * proxied class. - * - * @deprecated 3.6.0 use setConfig()/getConfig() instead. - * @param string $key The key to set/read. - * @param mixed $value The value to set. - * @param bool $merge Whether or not configuration should be merged. - * @return mixed - */ - public function config($key = null, $value = null, $merge = true) - { - return call_user_func_array([$this->_engine, 'config'], func_get_args()); - } - - /** - * Returns the config. - * - * @param string|null $key The key to get or null for the whole config. - * @param mixed $default The return value when the key does not exist. - * @return mixed Config value being read. - */ - public function getConfig($key = null, $default = null) - { - return $this->_engine->getConfig($key, $default); - } - - /** - * Sets the config. - * - * @param string|array $key The key to set, or a complete array of configs. - * @param mixed|null $value The value to set. - * @param bool $merge Whether to recursively merge or overwrite existing config, defaults to true. - * @return $this - * @throws \Cake\Core\Exception\Exception When trying to set a key that is invalid. - */ - public function setConfig($key, $value = null, $merge = true) - { - return $this->_engine->setConfig($key, $value, $merge); - } - - /** - * {@inheritDoc} - */ - public function clearGroup($group) - { - $this->_track('delete'); - DebugTimer::start('Cache.clearGroup ' . $group); - $result = $this->_engine->clearGroup($group); - DebugTimer::stop('Cache.clearGroup ' . $group); - - return $result; - } - - /** - * Magic __toString() method to get the CacheEngine's name - * - * @return string Returns the CacheEngine's name - */ - public function __toString() - { - if (!empty($this->_engine)) { - list($ns, $class) = namespaceSplit(get_class($this->_engine)); - - return str_replace('Engine', '', $class); - } - - return $this->_config['className']; - } -} diff --git a/vendor/cakephp/debug_kit/src/Controller/Component/ToolbarComponent.php b/vendor/cakephp/debug_kit/src/Controller/Component/ToolbarComponent.php deleted file mode 100644 index 259066f..0000000 --- a/vendor/cakephp/debug_kit/src/Controller/Component/ToolbarComponent.php +++ /dev/null @@ -1,45 +0,0 @@ - true, "routes" => true]);`', 'bootstrap.php'); - throw new \RuntimeException($msg); - } -} diff --git a/vendor/cakephp/debug_kit/src/Controller/ComposerController.php b/vendor/cakephp/debug_kit/src/Controller/ComposerController.php deleted file mode 100644 index 4817474..0000000 --- a/vendor/cakephp/debug_kit/src/Controller/ComposerController.php +++ /dev/null @@ -1,107 +0,0 @@ -loadComponent('RequestHandler'); - $this->viewBuilder()->setClassName(JsonView::class); - } - - /** - * Check outdated composer dependencies - * - * @return void - * @throws \RuntimeException - */ - public function checkDependencies() - { - $this->request->allowMethod('post'); - - $input = new ArrayInput([ - 'command' => 'outdated', - '--no-interaction' => true, - '--direct' => filter_var($this->request->getData('direct'), FILTER_VALIDATE_BOOLEAN), - ]); - - $output = $this->executeComposerCommand($input); - $dependencies = array_filter(explode("\n", $output->fetch())); - $packages = []; - foreach ($dependencies as $dependency) { - if (strpos($dependency, 'php_network_getaddresses') !== false) { - throw new \RuntimeException(__d('debug_kit', 'You have to be connected to the internet')); - } - if (strpos($dependency, '') !== false) { - $packages['semverCompatible'][] = $dependency; - continue; - } - $packages['bcBreaks'][] = $dependency; - } - if (!empty($packages['semverCompatible'])) { - $packages['semverCompatible'] = trim(implode("\n", $packages['semverCompatible'])); - } - if (!empty($packages['bcBreaks'])) { - $packages['bcBreaks'] = trim(implode("\n", $packages['bcBreaks'])); - } - - $this->set([ - '_serialize' => ['packages'], - 'packages' => $packages, - ]); - } - - /** - * @param ArrayInput $input An array describing the command input - * @return BufferedOutput Aa Console command buffered result - */ - private function executeComposerCommand(ArrayInput $input) - { - $bin = implode(DIRECTORY_SEPARATOR, [ROOT, 'vendor', 'bin', 'composer']); - putenv('COMPOSER_HOME=' . $bin); - putenv('COMPOSER_CACHE_DIR=' . CACHE); - - $dir = getcwd(); - chdir(ROOT); - $timeLimit = ini_get('max_execution_time'); - set_time_limit(300); - $memoryLimit = ini_get('memory_limit'); - ini_set('memory_limit', '512M'); - - $output = new BufferedOutput(); - $application = new Application(); - $application->setAutoExit(false); - $application->run($input, $output); - - // Restore environment - chdir($dir); - set_time_limit($timeLimit); - ini_set('memory_limit', $memoryLimit); - - return $output; - } -} diff --git a/vendor/cakephp/debug_kit/src/Controller/DashboardController.php b/vendor/cakephp/debug_kit/src/Controller/DashboardController.php deleted file mode 100644 index 079db5b..0000000 --- a/vendor/cakephp/debug_kit/src/Controller/DashboardController.php +++ /dev/null @@ -1,68 +0,0 @@ -viewBuilder()->setLayout('dashboard'); - } - - /** - * Dashboard. - * - * @return void - * @throws \Cake\Network\Exception\NotFoundException - */ - public function index() - { - $this->loadModel('DebugKit.Requests'); - - $data = [ - 'driver' => get_class($this->Requests->getConnection()->getDriver()), - 'rows' => $this->Requests->find()->count(), - ]; - - $this->set('connection', $data); - } - - /** - * Reset SQLite DB. - * - * @return \Cake\Http\Response - */ - public function reset() - { - $this->request->allowMethod('post'); - $this->loadModel('DebugKit.Requests'); - - $this->Requests->Panels->deleteAll('1=1'); - $this->Requests->deleteAll('1=1'); - - return $this->redirect(['action' => 'index']); - } -} diff --git a/vendor/cakephp/debug_kit/src/Controller/DebugKitController.php b/vendor/cakephp/debug_kit/src/Controller/DebugKitController.php deleted file mode 100644 index fa70db7..0000000 --- a/vendor/cakephp/debug_kit/src/Controller/DebugKitController.php +++ /dev/null @@ -1,54 +0,0 @@ -getRequest()->getAttribute('authorization'); - if ($authorizationService instanceof \Authorization\AuthorizationService) { - if (Configure::read('DebugKit.ignoreAuthorization')) { - $authorizationService->skipAuthorization(); - } else { - Log::info( - "Cake Authorization plugin is enabled. If you would like " . - "to force DebugKit to ignore it, set `DebugKit.ignoreAuthorization` " . - " Configure option to true." - ); - } - } - } -} diff --git a/vendor/cakephp/debug_kit/src/Controller/MailPreviewController.php b/vendor/cakephp/debug_kit/src/Controller/MailPreviewController.php deleted file mode 100644 index 31b22dc..0000000 --- a/vendor/cakephp/debug_kit/src/Controller/MailPreviewController.php +++ /dev/null @@ -1,265 +0,0 @@ -viewBuilder()->setLayout('DebugKit.mailer'); - } - - /** - * Handles mail-preview/index - * - * @return void - */ - public function index() - { - $this->set('mailPreviews', $this->getMailPreviews()->toArray()); - } - - /** - * Handles the viewing of an already sent email that was logged in the Mail panel - * for DebugKit - * - * @param string $panelId The Mail panel id where the email data is stored. - * @param string $number The email number as stored in the logs. - * @return \Psr\Http\Message\ResponseInterface|null. - */ - public function sent($panelId, $number) - { - $this->loadModel('DebugKit.Panels'); - $panel = $this->Panels->get($panelId); - - // @codingStandardsIgnoreStart - $content = @unserialize($panel->content); - // @codingStandardsIgnoreEnd - - if (empty($content['emails'][$number])) { - throw new NotFoundException(__d('debug_kit', 'No emails found in this request')); - } - - $email = $content['emails'][$number]; - $email = new SentMailResult(array_filter($email['headers']), $email['message']); - - $partType = $this->request->getQuery('part'); - if ($partType) { - return $this->respondWithPart($email, $partType); - } - - $this->set('noHeader', true); - $this->set('email', $email); - $this->set('plugin', ''); - $this->set('part', $this->findPreferredPart($email, $this->request->getQuery('part'))); - $this->viewBuilder()->setTemplate('email'); - } - - /** - * Handles mail-preview/email - * - * @param string $name The Mailer name - * @param string $method The mailer preview method - * @return \Psr\Http\Message\ResponseInterface|null - */ - public function email($name, $method) - { - // Clear the plugin attribute from the request instance - // Router is holding onto so that we can render mail previews - // in a plugin less request context. - Router::pushRequest($this->request->withParam('plugin', null)); - - $plugin = $this->request->getQuery('plugin'); - $email = $this->findPreview($name, $method, $plugin); - $partType = $this->request->getQuery('part'); - - $this->viewBuilder()->setLayout(false); - - if ($partType) { - return $this->respondWithPart($email, $partType); - } - - $humanName = Inflector::humanize(Inflector::underscore($name) . "_$method"); - $this->set('title', $humanName); - $this->set('email', $email); - $this->set('plugin', $plugin); - $this->set('part', $this->findPreferredPart($email, $this->request->getQuery('part'))); - } - - /** - * Returns a response object with the requested part type for the - * email or throws an exception, if no such part exists. - * - * @param \Debugkit\Mailer\AbstractResult $email the email to preview - * @param string $partType The email part to retrieve - * @return \Psr\Http\Message\ResponseInterface - */ - protected function respondWithPart($email, $partType) - { - $part = $this->findPart($email, $partType); - - if ($part === false) { - throw new NotFoundException(__d('debug_kit', "Email part ''{0}'' not found in email", $partType)); - } - - $response = $this->response->withType($partType); - if ($part === 'text') { - $part = '
' . $part . "
"; - } - $response = $response->withStringBody($part); - - return $response; - } - - /** - * Retrieves an array of MailPreview objects - * - * @return \Cake\Core\CollectionInterface - */ - protected function getMailPreviews() - { - return $this->getMailPreviewClasses()->groupBy('plugin'); - } - - /** - * Returns an array of MailPreview class names for the app and plugins - * - * @return \Cake\Core\CollectionInterface - */ - protected function getMailPreviewClasses() - { - $pluginPaths = collection(CorePlugin::loaded()) - ->reject(function ($plugin) { - return $plugin === 'DebugKit'; - }) - ->map(function ($plugin) { - return [App::path('Mailer/Preview', $plugin), "$plugin."]; - }); - - $appPaths = [App::path('Mailer/Preview'), '']; - - return collection([$appPaths]) - ->append($pluginPaths) - ->unfold(function ($pairs) { - list($paths, $plugin) = $pairs; - foreach ($paths as $path) { - yield $plugin => $path; - } - }) - ->unfold(function ($path, $plugin) { - foreach (glob($path . "*Preview.php") as $file) { - $base = str_replace(".php", "", basename($file)); - $class = App::className($plugin . $base, 'Mailer/Preview'); - if ($class) { - yield ['plugin' => trim($plugin, '.'), 'class' => new $class()]; - } - } - }); - } - - /** - * Finds a specified email part - * - * @param \DebugKit\Mailer\AbstractResult $email The result of the email preview - * @param string $partType The name of a part - * @return null|string - */ - protected function findPart(AbstractResult $email, $partType) - { - foreach ($email->getParts() as $part => $content) { - if ($part === $partType) { - return $content; - } - } - - return null; - } - - /** - * Finds a specified email part or the first part available - * - * @param \DebugKit\Mailer\AbstractResult $email The result of the email preview - * @param string $partType The name of a part - * @return null|string - */ - protected function findPreferredPart(AbstractResult $email, $partType) - { - $parts = $email->getParts(); - - if (empty($partType) && !empty($parts['html'])) { - return 'html'; - } - - if (empty($partType)) { - foreach ($email->getParts() as $part => $content) { - return $part; - } - } - - return $this->findPart($email, $partType) ?: null; - } - - /** - * Returns a matching MailPreview object with name - * - * @param string $previewName The Mailer name - * @param string $emailName The mailer preview method - * @param string|null $plugin The plugin where the mailer preview should be found - * @return \DebugKit\Mailer\PreviewResult The result of the email preview - * @throws \Cake\Http\Exception\NotFoundException - */ - protected function findPreview($previewName, $emailName, $plugin = null) - { - if ($plugin) { - $plugin = "$plugin."; - } - - $realClass = App::className($plugin . $previewName, "Mailer/Preview"); - if (!$realClass) { - throw new NotFoundException("Mailer preview ${previewName} not found"); - } - $mailPreview = new $realClass(); - - $email = $mailPreview->find($emailName); - if (!$email) { - throw new NotFoundException(__d('debug_kit', "Mailer preview {0}::{1} not found", $previewName, $emailName)); - } - - return new PreviewResult($mailPreview->$email(), $email); - } -} diff --git a/vendor/cakephp/debug_kit/src/Controller/PanelsController.php b/vendor/cakephp/debug_kit/src/Controller/PanelsController.php deleted file mode 100644 index 4cbe1b3..0000000 --- a/vendor/cakephp/debug_kit/src/Controller/PanelsController.php +++ /dev/null @@ -1,89 +0,0 @@ -viewBuilder() - ->setHelpers([ - 'Form', 'Html', 'Number', 'Url', 'DebugKit.Toolbar', - 'DebugKit.Credentials', 'DebugKit.SimpleGraph', - ]) - ->setLayout('DebugKit.toolbar'); - - if (!$this->request->is('json')) { - $this->viewBuilder()->setClassName('DebugKit.Ajax'); - } - } - - /** - * Index method that lets you get requests by panelid. - * - * @param string $requestId Request id - * @return void - * @throws \Cake\Http\Exception\NotFoundException - */ - public function index($requestId = null) - { - $query = $this->Panels->find('byRequest', ['requestId' => $requestId]); - $panels = $query->toArray(); - if (empty($panels)) { - throw new NotFoundException(); - } - $this->set([ - '_serialize' => ['panels'], - 'panels' => $panels, - ]); - } - - /** - * View a panel's data. - * - * @param string $id The id. - * @return void - */ - public function view($id = null) - { - $this->Cookie->configKey('debugKit_sort', 'encryption', false); - $this->set('sort', $this->Cookie->read('debugKit_sort')); - $panel = $this->Panels->get($id); - - $this->set('panel', $panel); - // @codingStandardsIgnoreStart - $this->set(@unserialize($panel->content)); - // @codingStandardsIgnoreEnd - } -} diff --git a/vendor/cakephp/debug_kit/src/Controller/RequestsController.php b/vendor/cakephp/debug_kit/src/Controller/RequestsController.php deleted file mode 100644 index df2d21f..0000000 --- a/vendor/cakephp/debug_kit/src/Controller/RequestsController.php +++ /dev/null @@ -1,61 +0,0 @@ -response = $this->response->withHeader('Content-Security-Policy', ''); - } - - /** - * Before render handler. - * - * @param \Cake\Event\Event $event The event. - * @return void - */ - public function beforeRender(Event $event) - { - $this->viewBuilder() - ->setLayout('DebugKit.toolbar') - ->setClassName('DebugKit.Ajax'); - } - - /** - * View a request's data. - * - * @param string $id The id. - * @return void - */ - public function view($id = null) - { - $toolbar = $this->Requests->get($id, ['contain' => 'Panels']); - $this->set('toolbar', $toolbar); - } -} diff --git a/vendor/cakephp/debug_kit/src/Controller/ToolbarController.php b/vendor/cakephp/debug_kit/src/Controller/ToolbarController.php deleted file mode 100644 index aad2b1a..0000000 --- a/vendor/cakephp/debug_kit/src/Controller/ToolbarController.php +++ /dev/null @@ -1,55 +0,0 @@ -request->allowMethod('post'); - if (!$this->request->getData('name')) { - throw new NotFoundException(__d('debug_kit', 'Invalid cache engine name.')); - } - $result = Cache::clear(false, $this->request->getData('name')); - $this->set([ - '_serialize' => ['success'], - 'success' => $result, - ]); - } -} diff --git a/vendor/cakephp/debug_kit/src/Database/Log/DebugLog.php b/vendor/cakephp/debug_kit/src/Database/Log/DebugLog.php deleted file mode 100644 index 15fc9d8..0000000 --- a/vendor/cakephp/debug_kit/src/Database/Log/DebugLog.php +++ /dev/null @@ -1,200 +0,0 @@ -_logger = $logger; - $this->_connectionName = $name; - $this->_includeSchema = $includeSchema; - } - - /** - * Set the schema include flag. - * - * @param bool $value Set - * @return $this - */ - public function setIncludeSchema($value) - { - $this->_includeSchema = $value; - - return $this; - } - - /** - * Get the connection name. - * - * @return array - */ - public function name() - { - return $this->_connectionName; - } - - /** - * Get the stored logs. - * - * @return array - */ - public function queries() - { - return $this->_queries; - } - - /** - * Get the total time - * - * @return int - */ - public function totalTime() - { - return $this->_totalTime; - } - - /** - * Get the total rows - * - * @return int - */ - public function totalRows() - { - return $this->_totalRows; - } - - /** - * Log queries - * - * @param \Cake\Database\Log\LoggedQuery $query The query being logged. - * @return void - */ - public function log(LoggedQuery $query) - { - if ($this->_logger) { - if ($this->_logger instanceof PsrAbstractLogger) { - $this->_logger->log($query, $query->error); - } else { - $this->_logger->log($query); - } - } - - if ($this->_includeSchema === false && $this->isSchemaQuery($query)) { - return; - } - - if (!empty($query->params)) { - $query->query = $this->_interpolate($query); - } - $this->_totalTime += $query->took; - $this->_totalRows += $query->numRows; - - $this->_queries[] = [ - 'query' => $query->query, - 'took' => $query->took, - 'rows' => $query->numRows, - ]; - } - - /** - * Sniff SQL statements for things only found in schema reflection. - * - * @param \Cake\Database\Log\LoggedQuery $query The query to check. - * @return bool - */ - protected function isSchemaQuery(LoggedQuery $query) - { - $querystring = $query->query; - - return ( - // Multiple engines - strpos($querystring, 'FROM information_schema') !== false || - // Postgres - strpos($querystring, 'FROM pg_catalog') !== false || - // MySQL - strpos($querystring, 'SHOW TABLE') === 0 || - strpos($querystring, 'SHOW FULL COLUMNS') === 0 || - strpos($querystring, 'SHOW INDEXES') === 0 || - // Sqlite - strpos($querystring, 'FROM sqlite_master') !== false || - strpos($querystring, 'PRAGMA') === 0 || - // Sqlserver - strpos($querystring, 'FROM INFORMATION_SCHEMA') !== false || - strpos($querystring, 'FROM sys.') !== false - ); - } -} diff --git a/vendor/cakephp/debug_kit/src/DebugInclude.php b/vendor/cakephp/debug_kit/src/DebugInclude.php deleted file mode 100644 index 6096486..0000000 --- a/vendor/cakephp/debug_kit/src/DebugInclude.php +++ /dev/null @@ -1,195 +0,0 @@ -_pluginPaths[$plugin] = str_replace('/', DIRECTORY_SEPARATOR, CorePlugin::path($plugin)); - } - - $lockFile = new JsonFile(ROOT . DIRECTORY_SEPARATOR . 'composer.lock'); - if ($lockFile->exists()) { - $lockContent = $lockFile->read(); - - $vendorDir = ROOT . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR; - $packages = array_merge($lockContent['packages'], $lockContent['packages-dev']); - - foreach ($packages as $package) { - $this->_composerPaths[$package['name']] = $vendorDir . str_replace('/', DIRECTORY_SEPARATOR, $package['name']) . DIRECTORY_SEPARATOR; - } - } - } - - /** - * Get the possible include paths - * - * @return array - */ - public function includePaths() - { - $paths = explode(PATH_SEPARATOR, get_include_path()); - $paths = array_filter($paths, function ($path) { - if ($path === '.' || strlen($path) === 0) { - return false; - } - - return true; - }); - - return array_values($paths); - } - - /** - * Check if a path is part of CakePHP - * - * @param string $file File to check - * @return bool - */ - public function isCakeFile($file) - { - return strpos($file, CAKE) === 0; - } - - /** - * Check if a path is from APP but not a plugin - * - * @param string $file File to check - * @return bool - */ - public function isAppFile($file) - { - return strpos($file, APP) === 0; - } - - /** - * Detect plugin the file belongs to - * - * @param string $file File to check - * @return string|bool plugin name, or false if not plugin - */ - public function getPluginName($file) - { - foreach ($this->_pluginPaths as $plugin => $path) { - if (strpos($file, $path) === 0) { - return $plugin; - } - } - - return false; - } - - /** - * Detect Composer package the file belongs to - * - * @param string $file File to check - * @return string|bool package name, or false if not Composer package - */ - public function getComposerPackageName($file) - { - foreach ($this->_composerPaths as $package => $path) { - if (strpos($file, $path) === 0) { - return $package; - } - } - - return false; - } - - /** - * Replace the path with APP, CAKE, ROOT or the plugin name - * - * @param string $file File to check - * @param string $type The file type - * @param string|null $name plugin name or composer package - * @return string Path with replaced prefix - */ - public function niceFileName($file, $type, $name = null) - { - switch ($type) { - case 'app': - return str_replace(APP, 'APP' . DIRECTORY_SEPARATOR, $file); - - case 'cake': - return str_replace(CAKE, 'CAKE' . DIRECTORY_SEPARATOR, $file); - - case 'root': - return str_replace(ROOT, 'ROOT', $file); - - case 'plugin': - return str_replace($this->_pluginPaths[$name], $name . DIRECTORY_SEPARATOR, $file); - - case 'vendor': - return str_replace($this->_composerPaths[$name], '', $file); - } - } - - /** - * Get the type of file (model, controller etc) - * - * @param string $file File to check. - * @return string - */ - public function getFileType($file) - { - foreach ($this->_fileTypes as $type) { - if (stripos($file, DIRECTORY_SEPARATOR . $type . DIRECTORY_SEPARATOR) !== false) { - return $type; - } - } - - return 'other'; - } -} diff --git a/vendor/cakephp/debug_kit/src/DebugMemory.php b/vendor/cakephp/debug_kit/src/DebugMemory.php deleted file mode 100644 index 36d4e5e..0000000 --- a/vendor/cakephp/debug_kit/src/DebugMemory.php +++ /dev/null @@ -1,105 +0,0 @@ -plugin) { - return $this->plugin . '.' . Inflector::underscore($name); - } - - return Inflector::underscore($name); - } - - /** - * Get the data a panel has collected. - * - * @return array - */ - public function data() - { - return $this->_data; - } - - /** - * Get the summary data for a panel. - * - * This data is displayed in the toolbar even when the panel is collapsed. - * - * @return string - */ - public function summary() - { - return ''; - } - - /** - * Initialize hook method. - * - * @return void - */ - public function initialize() - { - } - - /** - * Shutdown callback - * - * @param \Cake\Event\Event $event The event. - * @return void - */ - public function shutdown(Event $event) - { - } - - /** - * Get the events this panels supports. - * - * @return array - */ - public function implementedEvents() - { - return [ - 'Controller.shutdown' => 'shutdown', - ]; - } -} diff --git a/vendor/cakephp/debug_kit/src/DebugSql.php b/vendor/cakephp/debug_kit/src/DebugSql.php deleted file mode 100644 index 3bd0b26..0000000 --- a/vendor/cakephp/debug_kit/src/DebugSql.php +++ /dev/null @@ -1,188 +0,0 @@ - -%s -
-%s
-
- -HTML; - - /** - * Template used for CLI and text output. - * - * @var string - */ - private static $templateText = <<getValueBinder()->bindings()) - : static::interpolate($sql, $query->valueBinder()->bindings()); - } - - $trace = Debugger::trace(['start' => 1, 'depth' => $stackDepth + 2, 'format' => 'array']); - $file = isset($trace[$stackDepth]) ? $trace[$stackDepth]['file'] : 'n/a'; - $line = isset($trace[$stackDepth]) ? $trace[$stackDepth]['line'] : 0; - $lineInfo = ''; - if ($file) { - $search = []; - if (defined('ROOT')) { - $search = [ROOT]; - } - if (defined('CAKE_CORE_INCLUDE_PATH')) { - array_unshift($search, CAKE_CORE_INCLUDE_PATH); - } - $file = str_replace($search, '', $file); - } - - $template = static::$templateHtml; - $sqlHighlight = true; - if ((PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') || $showHtml === false) { - $template = static::$templateText; - $sqlHighlight = false; - if ($file && $line) { - $lineInfo = sprintf('%s (line %s)', $file, $line); - } - } - if ($showHtml === null && $template !== static::$templateText) { - $showHtml = true; - } - - $var = $showHtml ? SqlFormatter::format($sql, $sqlHighlight) : $sql; - $var = str_replace( - ': ', - ':', - $var - ); - - if ($showHtml) { - $template = static::$templateHtml; - if ($file && $line) { - $lineInfo = sprintf('%s (line %s)', $file, $line); - } - } - - printf($template, $lineInfo, $var); - - return $query; - } - - /** - * Prints out the SQL statements generated by a Query object and dies. - * - * Only runs if debug mode is enabled. - * It will otherwise just continue code execution and ignore this function. - * - * @param Query $query Query to show SQL statements for. - * @param bool $showValues Renders the SQL statement with bound variables. - * @param bool|null $showHtml If set to true, the method prints the debug - * data in a browser-friendly way. - * @param int $stackDepth Provides a hint as to which file in the call stack to reference. - * @return void - */ - public static function sqld(Query $query, $showValues = true, $showHtml = null, $stackDepth = 1) - { - static::sql($query, $showValues, $showHtml, $stackDepth); - die(1); - } - - /** - * Helper function used to replace query placeholders by the real - * params used to execute the query. - * - * @param string $sql The SQL statement - * @param array $bindings The Query bindings - * @return string - */ - private static function interpolate($sql, array $bindings) - { - $params = array_map(function ($binding) { - $p = $binding['value']; - - if ($p === null) { - return 'NULL'; - } - if (is_bool($p)) { - return $p ? '1' : '0'; - } - - if (is_string($p)) { - $replacements = [ - '$' => '\\$', - '\\' => '\\\\\\\\', - "'" => "''", - ]; - - $p = strtr($p, $replacements); - - return "'$p'"; - } - - return $p; - }, $bindings); - - $keys = []; - $limit = is_int(key($params)) ? 1 : -1; - foreach ($params as $key => $param) { - $keys[] = is_string($key) ? "/$key\b/" : '/[?]/'; - } - - return preg_replace($keys, $params, $sql, $limit); - } -} diff --git a/vendor/cakephp/debug_kit/src/DebugTimer.php b/vendor/cakephp/debug_kit/src/DebugTimer.php deleted file mode 100644 index 673a09c..0000000 --- a/vendor/cakephp/debug_kit/src/DebugTimer.php +++ /dev/null @@ -1,216 +0,0 @@ - 1) { - $message .= ' #' . $i; - } - - self::$_timers[$name] = [ - 'start' => $start, - 'message' => $message, - 'named' => $named, - ]; - - return true; - } - - /** - * Stop a benchmarking timer. - * - * $name should be the same as the $name used in startTimer(). - * - * @param string $name The name of the timer to end. - * @return bool true if timer was ended, false if timer was not started. - */ - public static function stop($name = null) - { - $end = microtime(true); - if (!$name) { - $names = array_reverse(array_keys(self::$_timers)); - foreach ($names as $name) { - if (!empty(self::$_timers[$name]['end'])) { - continue; - } - if (empty(self::$_timers[$name]['named'])) { - break; - } - } - } else { - $i = 1; - $_name = $name; - while (isset(self::$_timers[$name])) { - if (empty(self::$_timers[$name]['end'])) { - break; - } - $i++; - $name = $_name . ' #' . $i; - } - } - if (!isset(self::$_timers[$name])) { - return false; - } - self::$_timers[$name]['end'] = $end; - - return true; - } - - /** - * Get all timers that have been started and stopped. - * Calculates elapsed time for each timer. If clear is true, will delete existing timers - * - * @param bool $clear false - * @return array - */ - public static function getAll($clear = false) - { - $start = self::requestStartTime(); - $now = microtime(true); - - $times = []; - if (!empty(self::$_timers)) { - $firstTimer = reset(self::$_timers); - $_end = $firstTimer['start']; - } else { - $_end = $now; - } - $times['Core Processing (Derived from $_SERVER["REQUEST_TIME"])'] = [ - 'message' => __d('debug_kit', 'Core Processing (Derived from $_SERVER["REQUEST_TIME"])'), - 'start' => 0, - 'end' => $_end - $start, - 'time' => round($_end - $start, 6), - 'named' => null, - ]; - foreach (self::$_timers as $name => $timer) { - if (!isset($timer['end'])) { - $timer['end'] = $now; - } - $times[$name] = array_merge($timer, [ - 'start' => $timer['start'] - $start, - 'end' => $timer['end'] - $start, - 'time' => self::elapsedTime($name), - ]); - } - if ($clear) { - self::$_timers = []; - } - - return $times; - } - - /** - * Clear all existing timers - * - * @return bool true - */ - public static function clear() - { - self::$_timers = []; - - return true; - } - - /** - * Get the difference in time between the timer start and timer end. - * - * @param string $name the name of the timer you want elapsed time for. - * @param int $precision the number of decimal places to return, defaults to 5. - * @return float number of seconds elapsed for timer name, 0 on missing key - */ - public static function elapsedTime($name = 'default', $precision = 5) - { - if (!isset(self::$_timers[$name]['start']) || !isset(self::$_timers[$name]['end'])) { - return 0; - } - - return round(self::$_timers[$name]['end'] - self::$_timers[$name]['start'], $precision); - } - - /** - * Get the total execution time until this point - * - * @return float elapsed time in seconds since script start. - */ - public static function requestTime() - { - $start = self::requestStartTime(); - $now = microtime(true); - - return ($now - $start); - } - - /** - * get the time the current request started. - * - * @return float time of request start - */ - public static function requestStartTime() - { - if (defined('TIME_START')) { - $startTime = TIME_START; - } elseif (isset($GLOBALS['TIME_START'])) { - $startTime = $GLOBALS['TIME_START']; - } else { - $startTime = env('REQUEST_TIME'); - } - - return $startTime; - } -} diff --git a/vendor/cakephp/debug_kit/src/Locale/debug_kit.pot b/vendor/cakephp/debug_kit/src/Locale/debug_kit.pot deleted file mode 100644 index df4988d..0000000 --- a/vendor/cakephp/debug_kit/src/Locale/debug_kit.pot +++ /dev/null @@ -1,138 +0,0 @@ -# LANGUAGE translation of Debug Kit Application -# Copyright 2008 Andy Dawson -# No version information was available in the source files. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: debug_kit-\n" -"POT-Creation-Date: 2009-05-27 09:47+0200\n" -"PO-Revision-Date: YYYY-mm-DD HH:MM+ZZZZ\n" -"Last-Translator: Andy Dawson \n" -"Language-Team:\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=utf-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Poedit-Basepath: ../../../\n" - -#: controllers/components/toolbar.php:91 -msgid "Component initialization and startup" -msgstr "" - -#: controllers/components/toolbar.php:140 -msgid "Controller Action" -msgstr "" - -#: controllers/components/toolbar.php:167 -msgid "Render Controller Action" -msgstr "" - -#: controllers/components/toolbar.php:231 -msgid "Could not load DebugToolbar panel %s" -msgstr "" - -#: views/elements/debug_toolbar.ctp:25 -msgid "There are no active panels. You must enable a panel to see its output." -msgstr "" - -#: views/elements/history_panel.ctp:21 -msgid "Request History" -msgstr "" - -#: views/elements/history_panel.ctp:23 -msgid "No previous requests logged." -msgstr "" - -#: views/elements/history_panel.ctp:25 -msgid "previous requests available" -msgstr "" - -#: views/elements/history_panel.ctp:27 -msgid "Restore to current request" -msgstr "" - -#: views/elements/log_panel.ctp:21 -msgid "Logs" -msgstr "" - -#: views/elements/log_panel.ctp:28 -msgid "Time" -msgstr "" - -#: views/elements/log_panel.ctp:28 -#: views/elements/timer_panel.ctp:54 -msgid "Message" -msgstr "" - -#: views/elements/log_panel.ctp:37 -msgid "There were no log entries made this request" -msgstr "" - -#: views/elements/request_panel.ctp:21 -msgid "Request" -msgstr "" - -#: views/elements/request_panel.ctp:35 -msgid "Current Route" -msgstr "" - -#: views/elements/session_panel.ctp:21 -msgid "Session" -msgstr "" - -#: views/elements/sql_log_panel.ctp:21 -msgid "Sql Logs" -msgstr "" - -#: views/elements/sql_log_panel.ctp:31 -msgid "toggle (%s) query explains for %s" -msgstr "" - -#: views/elements/sql_log_panel.ctp:39 -msgid "No slow queries!, or your database does not support EXPLAIN" -msgstr "" - -#: views/elements/sql_log_panel.ctp:44 -msgid "No active database connections" -msgstr "" - -#: views/elements/timer_panel.ctp:33 -msgid "Memory" -msgstr "" - -#: views/elements/timer_panel.ctp:35 -msgid "Current Memory Use" -msgstr "" - -#: views/elements/timer_panel.ctp:39 -msgid "Peak Memory Use" -msgstr "" - -#: views/elements/timer_panel.ctp:43 -msgid "Timers" -msgstr "" - -#: views/elements/timer_panel.ctp:45 -msgid "%s (ms)" -msgstr "" - -#: views/elements/timer_panel.ctp:46 -msgid "Total Request Time:" -msgstr "" - -#: views/elements/timer_panel.ctp:54 -msgid "Time in ms" -msgstr "" - -#: views/elements/timer_panel.ctp:54 -msgid "Graph" -msgstr "" - -#: views/elements/variables_panel.ctp:21 -msgid "View Variables" -msgstr "" - -#: views/helpers/simple_graph.php:79 -msgid "Starting %sms into the request, taking %sms" -msgstr "" - diff --git a/vendor/cakephp/debug_kit/src/Locale/eng/LC_MESSAGES/debug_kit.po b/vendor/cakephp/debug_kit/src/Locale/eng/LC_MESSAGES/debug_kit.po deleted file mode 100644 index 9aec832..0000000 --- a/vendor/cakephp/debug_kit/src/Locale/eng/LC_MESSAGES/debug_kit.po +++ /dev/null @@ -1,135 +0,0 @@ -# LANGUAGE translation of CakePHP Application -# Copyright YEAR NAME -# No version information was available in the source files. -# -#, fuzzy -msgid "" -msgstr "Project-Id-Version: PROJECT VERSION\n" - "POT-Creation-Date: 2009-05-27 09:47+0200\n" - "PO-Revision-Date: YYYY-mm-DD HH:MM+ZZZZ\n" - "Last-Translator: NAME \n" - "Language-Team: LANGUAGE \n" - "MIME-Version: 1.0\n" - "Content-Type: text/plain; charset=UTF-8\n" - "Content-Transfer-Encoding: 8bit\n" - "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" - -#: controllers/components/toolbar.php:91 -msgid "Component initialization and startup" -msgstr "" - -#: controllers/components/toolbar.php:140 -msgid "Controller Action" -msgstr "" - -#: controllers/components/toolbar.php:167 -msgid "Render Controller Action" -msgstr "" - -#: controllers/components/toolbar.php:231 -msgid "Could not load DebugToolbar panel %s" -msgstr "" - -#: views/elements/debug_toolbar.ctp:25 -msgid "There are no active panels. You must enable a panel to see its output." -msgstr "" - -#: views/elements/history_panel.ctp:21 -msgid "Request History" -msgstr "" - -#: views/elements/history_panel.ctp:23 -msgid "No previous requests logged." -msgstr "" - -#: views/elements/history_panel.ctp:25 -msgid "previous requests available" -msgstr "" - -#: views/elements/history_panel.ctp:27 -msgid "Restore to current request" -msgstr "" - -#: views/elements/log_panel.ctp:21 -msgid "Logs" -msgstr "" - -#: views/elements/log_panel.ctp:28 -msgid "Time" -msgstr "" - -#: views/elements/log_panel.ctp:28 views/elements/timer_panel.ctp:54 -msgid "Message" -msgstr "" - -#: views/elements/log_panel.ctp:37 -msgid "There were no log entries made this request" -msgstr "" - -#: views/elements/request_panel.ctp:21 -msgid "Request" -msgstr "" - -#: views/elements/request_panel.ctp:35 -msgid "Current Route" -msgstr "" - -#: views/elements/session_panel.ctp:21 -msgid "Session" -msgstr "" - -#: views/elements/sql_log_panel.ctp:21 -msgid "Sql Logs" -msgstr "" - -#: views/elements/sql_log_panel.ctp:31 -msgid "toggle (%s) query explains for %s" -msgstr "" - -#: views/elements/sql_log_panel.ctp:39 -msgid "No slow queries!, or your database does not support EXPLAIN" -msgstr "" - -#: views/elements/sql_log_panel.ctp:44 -msgid "No active database connections" -msgstr "" - -#: views/elements/timer_panel.ctp:33 -msgid "Memory" -msgstr "" - -#: views/elements/timer_panel.ctp:35 -msgid "Current Memory Use" -msgstr "" - -#: views/elements/timer_panel.ctp:39 -msgid "Peak Memory Use" -msgstr "" - -#: views/elements/timer_panel.ctp:43 -msgid "Timers" -msgstr "" - -#: views/elements/timer_panel.ctp:45 -msgid "%s (ms)" -msgstr "" - -#: views/elements/timer_panel.ctp:46 -msgid "Total Request Time:" -msgstr "" - -#: views/elements/timer_panel.ctp:54 -msgid "Time in ms" -msgstr "" - -#: views/elements/timer_panel.ctp:54 -msgid "Graph" -msgstr "" - -#: views/elements/variables_panel.ctp:21 -msgid "View Variables" -msgstr "" - -#: views/helpers/simple_graph.php:79 -msgid "Starting %sms into the request, taking %sms" -msgstr "" diff --git a/vendor/cakephp/debug_kit/src/Locale/fra/LC_MESSAGES/debug_kit.po b/vendor/cakephp/debug_kit/src/Locale/fra/LC_MESSAGES/debug_kit.po deleted file mode 100644 index 515574d..0000000 --- a/vendor/cakephp/debug_kit/src/Locale/fra/LC_MESSAGES/debug_kit.po +++ /dev/null @@ -1,135 +0,0 @@ -# LANGUAGE translation of CakePHP Application -# Copyright YEAR NAME -# No version information was available in the source files. -# -#, fuzzy -msgid "" -msgstr "Project-Id-Version: PROJECT VERSION\n" - "POT-Creation-Date: 2013-06-04 12:00+0200\n" - "PO-Revision-Date: YYYY-mm-DD HH:MM+ZZZZ\n" - "Last-Translator: cake17 \n" - "Language-Team: \n" - "MIME-Version: 1.0\n" - "Content-Type: text/plain; charset=UTF-8\n" - "Content-Transfer-Encoding: 8bit\n" - "Plural-Forms: nplurals=2; plural=n>1;\n" - -#: controllers/components/toolbar.php:91 -msgid "Component initialization and startup" -msgstr "Initialisation du component et démarrage" - -#: controllers/components/toolbar.php:140 -msgid "Controller Action" -msgstr "Action du Controller" - -#: controllers/components/toolbar.php:167 -msgid "Render Controller Action" -msgstr "Rendu de l'Action du Controller" - -#: controllers/components/toolbar.php:231 -msgid "Could not load DebugToolbar panel %s" -msgstr "Ne peut charger le panel %s de DebugToolbar" - -#: views/elements/debug_toolbar.ctp:25 -msgid "There are no active panels. You must enable a panel to see its output." -msgstr "Il n'y a pas de panels actifs. Vous devez activer le panel pour voir sa sortie." - -#: views/elements/history_panel.ctp:21 -msgid "Request History" -msgstr "Historique des Requêtes" - -#: views/elements/history_panel.ctp:23 -msgid "No previous requests logged." -msgstr "Pas de demandes antérieures enregistrées." - -#: views/elements/history_panel.ctp:25 -msgid "previous requests available" -msgstr "Des requêtes antérieures sont disponibles" - -#: views/elements/history_panel.ctp:27 -msgid "Restore to current request" -msgstr "Restaure la requête actuelle" - -#: views/elements/log_panel.ctp:21 -msgid "Logs" -msgstr "Logs" - -#: views/elements/log_panel.ctp:28 -msgid "Time" -msgstr "Date" - -#: views/elements/log_panel.ctp:28 views/elements/timer_panel.ctp:54 -msgid "Message" -msgstr "Message" - -#: views/elements/log_panel.ctp:37 -msgid "There were no log entries made this request" -msgstr "Il n'y avait pas d'entrées de log faîtes pour cette requête" - -#: views/elements/request_panel.ctp:21 -msgid "Request" -msgstr "Requête" - -#: views/elements/request_panel.ctp:35 -msgid "Current Route" -msgstr "Route actuelle" - -#: views/elements/session_panel.ctp:21 -msgid "Session" -msgstr "Session" - -#: views/elements/sql_log_panel.ctp:21 -msgid "Sql Logs" -msgstr "Logs Sql" - -#: views/elements/sql_log_panel.ctp:31 -msgid "toggle (%s) query explains for %s" -msgstr "bascule (%s) requêtes expliquées pour %s" - -#: views/elements/sql_log_panel.ctp:39 -msgid "No slow queries!, or your database does not support EXPLAIN" -msgstr "Pas de requêtes lentes!, ou votre base de données ne supporte pas EXPLAIN" - -#: views/elements/sql_log_panel.ctp:44 -msgid "No active database connections" -msgstr "Pas de connections actives de la base de données" - -#: views/elements/timer_panel.ctp:33 -msgid "Memory" -msgstr "Mémoire" - -#: views/elements/timer_panel.ctp:35 -msgid "Current Memory Use" -msgstr "Utilisation de la Mémoire Actuelle" - -#: views/elements/timer_panel.ctp:39 -msgid "Peak Memory Use" -msgstr "Utilisation de la Mémoire au niveau maximum" - -#: views/elements/timer_panel.ctp:43 -msgid "Timers" -msgstr "Timers" - -#: views/elements/timer_panel.ctp:45 -msgid "%s (ms)" -msgstr "%s (ms)" - -#: views/elements/timer_panel.ctp:46 -msgid "Total Request Time:" -msgstr "Total du Temps de Requête" - -#: views/elements/timer_panel.ctp:54 -msgid "Time in ms" -msgstr "Temps en ms" - -#: views/elements/timer_panel.ctp:54 -msgid "Graph" -msgstr "Graph" - -#: views/elements/variables_panel.ctp:21 -msgid "View Variables" -msgstr "Variables du View" - -#: views/helpers/simple_graph.php:79 -msgid "Starting %sms into the request, taking %sms" -msgstr "Début en %sms de la requête, et prend %sms" diff --git a/vendor/cakephp/debug_kit/src/Locale/lim/LC_MESSAGES/debug_kit.po b/vendor/cakephp/debug_kit/src/Locale/lim/LC_MESSAGES/debug_kit.po deleted file mode 100644 index bf3894a..0000000 --- a/vendor/cakephp/debug_kit/src/Locale/lim/LC_MESSAGES/debug_kit.po +++ /dev/null @@ -1,136 +0,0 @@ -# LANGUAGE translation of Debug Kit Application -# Copyright 2008 Andy Dawson -# No version information was available in the source files. -# -msgid "" -msgstr "" -"Project-Id-Version: debug_kit-\n" -"POT-Creation-Date: 2009-05-27 09:47+0200\n" -"PO-Revision-Date: 2009-05-27 09:47+0200\n" -"Last-Translator: Automatically generated\n" -"Language-Team:none\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Poedit-Basepath: ../../../\n" -"Language: lim\n" - -#: controllers/components/toolbar.php:91 -msgid "Component initialization and startup" -msgstr "" - -#: controllers/components/toolbar.php:140 -msgid "Controller Action" -msgstr "" - -#: controllers/components/toolbar.php:167 -msgid "Render Controller Action" -msgstr "" - -#: controllers/components/toolbar.php:231 -msgid "Could not load DebugToolbar panel %s" -msgstr "" - -#: views/elements/debug_toolbar.ctp:25 -msgid "There are no active panels. You must enable a panel to see its output." -msgstr "" - -#: views/elements/history_panel.ctp:21 -msgid "Request History" -msgstr "" - -#: views/elements/history_panel.ctp:23 -msgid "No previous requests logged." -msgstr "" - -#: views/elements/history_panel.ctp:25 -msgid "previous requests available" -msgstr "" - -#: views/elements/history_panel.ctp:27 -msgid "Restore to current request" -msgstr "" - -#: views/elements/log_panel.ctp:21 -msgid "Logs" -msgstr "" - -#: views/elements/log_panel.ctp:28 -msgid "Time" -msgstr "" - -#: views/elements/log_panel.ctp:28 views/elements/timer_panel.ctp:54 -msgid "Message" -msgstr "" - -#: views/elements/log_panel.ctp:37 -msgid "There were no log entries made this request" -msgstr "" - -#: views/elements/request_panel.ctp:21 -msgid "Request" -msgstr "" - -#: views/elements/request_panel.ctp:35 -msgid "Current Route" -msgstr "" - -#: views/elements/session_panel.ctp:21 -msgid "Session" -msgstr "" - -#: views/elements/sql_log_panel.ctp:21 -msgid "Sql Logs" -msgstr "" - -#: views/elements/sql_log_panel.ctp:31 -msgid "toggle (%s) query explains for %s" -msgstr "" - -#: views/elements/sql_log_panel.ctp:39 -msgid "No slow queries!, or your database does not support EXPLAIN" -msgstr "" - -#: views/elements/sql_log_panel.ctp:44 -msgid "No active database connections" -msgstr "" - -#: views/elements/timer_panel.ctp:33 -msgid "Memory" -msgstr "" - -#: views/elements/timer_panel.ctp:35 -msgid "Current Memory Use" -msgstr "" - -#: views/elements/timer_panel.ctp:39 -msgid "Peak Memory Use" -msgstr "" - -#: views/elements/timer_panel.ctp:43 -msgid "Timers" -msgstr "" - -#: views/elements/timer_panel.ctp:45 -msgid "%s (ms)" -msgstr "" - -#: views/elements/timer_panel.ctp:46 -msgid "Total Request Time:" -msgstr "" - -#: views/elements/timer_panel.ctp:54 -msgid "Time in ms" -msgstr "" - -#: views/elements/timer_panel.ctp:54 -msgid "Graph" -msgstr "" - -#: views/elements/variables_panel.ctp:21 -msgid "View Variables" -msgstr "" - -#: views/helpers/simple_graph.php:79 -msgid "Starting %sms into the request, taking %sms" -msgstr "" diff --git a/vendor/cakephp/debug_kit/src/Locale/nld/LC_MESSAGES/debug_kit.po b/vendor/cakephp/debug_kit/src/Locale/nld/LC_MESSAGES/debug_kit.po deleted file mode 100644 index b6b754f..0000000 --- a/vendor/cakephp/debug_kit/src/Locale/nld/LC_MESSAGES/debug_kit.po +++ /dev/null @@ -1,141 +0,0 @@ -# LANGUAGE translation of Debug Kit Application -# Copyright 2008 Andy Dawson -# No version information was available in the source files. -# -msgid "" -msgstr "" -"Project-Id-Version: debug_kit-\n" -"POT-Creation-Date: 2009-05-27 09:47+0200\n" -"PO-Revision-Date: 2014-07-17 17:04+0200\n" -"Last-Translator: Marlin Cremers \n" -"Language-Team: \n" -"Language: nld\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=utf-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 1.9\n" -"X-Poedit-Basepath: ../../../\n" - -#: controllers/components/toolbar.php:91 -msgid "Component initialization and startup" -msgstr "Component initializatie en opstarten" - -#: controllers/components/toolbar.php:140 -msgid "Controller Action" -msgstr "Controller Actie" - -#: controllers/components/toolbar.php:167 -msgid "Render Controller Action" -msgstr "Produceer Controller Actie" - -#: controllers/components/toolbar.php:231 -msgid "Could not load DebugToolbar panel %s" -msgstr "Kon DebugToolbar paneel %s niet laden" - -#: views/elements/debug_toolbar.ctp:25 -msgid "There are no active panels. You must enable a panel to see its output." -msgstr "" -"Er zijn geen actieve panelen. Je moet een paneel aanzetten om de uitvoer te " -"zien." - -#: views/elements/history_panel.ctp:21 -msgid "Request History" -msgstr "Aanvraag Geschiedenis" - -#: views/elements/history_panel.ctp:23 -msgid "No previous requests logged." -msgstr "Geen vorige aanvragen gelogged." - -#: views/elements/history_panel.ctp:25 -msgid "previous requests available" -msgstr "vorige aanvraag beschikbaar" - -#: views/elements/history_panel.ctp:27 -msgid "Restore to current request" -msgstr "Herstel naar actuele aanvraag" - -#: views/elements/log_panel.ctp:21 -msgid "Logs" -msgstr "Logs" - -#: views/elements/log_panel.ctp:28 -msgid "Time" -msgstr "Tijd" - -#: views/elements/log_panel.ctp:28 -#: views/elements/timer_panel.ctp:54 -msgid "Message" -msgstr "Bericht" - -#: views/elements/log_panel.ctp:37 -msgid "There were no log entries made this request" -msgstr "Er zijn geen log vermeldingen gemaakt in deze aanvraag" - -#: views/elements/request_panel.ctp:21 -msgid "Request" -msgstr "Aanvraag" - -#: views/elements/request_panel.ctp:35 -msgid "Current Route" -msgstr "Huide Route" - -#: views/elements/session_panel.ctp:21 -msgid "Session" -msgstr "Sessie" - -#: views/elements/sql_log_panel.ctp:21 -msgid "Sql Logs" -msgstr "Sql Logs" - -#: views/elements/sql_log_panel.ctp:31 -msgid "toggle (%s) query explains for %s" -msgstr "schakel (%s) aanvraag uitleg voor %s" - -#: views/elements/sql_log_panel.ctp:39 -msgid "No slow queries!, or your database does not support EXPLAIN" -msgstr "Geen langzame vragen!, of je database ondersteund geen EXPLAIN" - -#: views/elements/sql_log_panel.ctp:44 -msgid "No active database connections" -msgstr "Geen actieve database verbindingen" - -#: views/elements/timer_panel.ctp:33 -msgid "Memory" -msgstr "Geheugen" - -#: views/elements/timer_panel.ctp:35 -msgid "Current Memory Use" -msgstr "Actueel Geheugen Gebruik" - -#: views/elements/timer_panel.ctp:39 -msgid "Peak Memory Use" -msgstr "Hoogste Geheugen Gebruik" - -#: views/elements/timer_panel.ctp:43 -msgid "Timers" -msgstr "Timers" - -#: views/elements/timer_panel.ctp:45 -msgid "%s (ms)" -msgstr "%s (ms)" - -#: views/elements/timer_panel.ctp:46 -msgid "Total Request Time:" -msgstr "Totale Aanvraag Tijd:" - -#: views/elements/timer_panel.ctp:54 -msgid "Time in ms" -msgstr "Tijd in ms" - -#: views/elements/timer_panel.ctp:54 -msgid "Graph" -msgstr "Diagram" - -#: views/elements/variables_panel.ctp:21 -msgid "View Variables" -msgstr "View Variabelen" - -#: views/helpers/simple_graph.php:79 -msgid "Starting %sms into the request, taking %sms" -msgstr "Starten %sms in de aanvraag, neemt %sms" diff --git a/vendor/cakephp/debug_kit/src/Locale/pt_BR/LC_MESSAGES/debug_kit.po b/vendor/cakephp/debug_kit/src/Locale/pt_BR/LC_MESSAGES/debug_kit.po deleted file mode 100644 index e1e4c45..0000000 --- a/vendor/cakephp/debug_kit/src/Locale/pt_BR/LC_MESSAGES/debug_kit.po +++ /dev/null @@ -1,135 +0,0 @@ -# LANGUAGE translation of CakePHP Application -# Copyright YEAR NAME -# No version information was available in the source files. -# -#, fuzzy -msgid "" -msgstr "Project-Id-Version: PROJECT VERSION\n" - "POT-Creation-Date: 2014-01-23 08:29+0200\n" - "PO-Revision-Date: YYYY-mm-DD HH:MM+ZZZZ\n" - "Last-Translator: Lincoln Brito \n" - "Language-Team: LANGUAGE \n" - "MIME-Version: 1.0\n" - "Content-Type: text/plain; charset=UTF-8\n" - "Content-Transfer-Encoding: 8bit\n" - "Plural-Forms: nplurals=2; plural=n>1;\n" - -#: controllers/components/toolbar.php:91 -msgid "Component initialization and startup" -msgstr "Inicialização de componente" - -#: controllers/components/toolbar.php:140 -msgid "Controller Action" -msgstr "Action do Controller" - -#: controllers/components/toolbar.php:167 -msgid "Render Controller Action" -msgstr "Renderizar Action do Controller" - -#: controllers/components/toolbar.php:231 -msgid "Could not load DebugToolbar panel %s" -msgstr "Não foi possível carregar o painel %s do DebugToolbar" - -#: views/elements/debug_toolbar.ctp:25 -msgid "There are no active panels. You must enable a panel to see its output." -msgstr "Não existem painéis ativos. Você deve habilitar um painel para visualizar sua saída." - -#: views/elements/history_panel.ctp:21 -msgid "Request History" -msgstr "Histórico de requisições" - -#: views/elements/history_panel.ctp:23 -msgid "No previous requests logged." -msgstr "Sem requisições anteriores logadas." - -#: views/elements/history_panel.ctp:25 -msgid "previous requests available" -msgstr "requisições anteriores disponíveis" - -#: views/elements/history_panel.ctp:27 -msgid "Restore to current request" -msgstr "Restaurar para requisição atual" - -#: views/elements/log_panel.ctp:21 -msgid "Logs" -msgstr "Logs" - -#: views/elements/log_panel.ctp:28 -msgid "Time" -msgstr "Tempo" - -#: views/elements/log_panel.ctp:28 views/elements/timer_panel.ctp:54 -msgid "Message" -msgstr "Mensagem" - -#: views/elements/log_panel.ctp:37 -msgid "There were no log entries made this request" -msgstr "Não houveram entradas no log para essa requisição " - -#: views/elements/request_panel.ctp:21 -msgid "Request" -msgstr "Requisição" - -#: views/elements/request_panel.ctp:35 -msgid "Current Route" -msgstr "Rota Atual" - -#: views/elements/session_panel.ctp:21 -msgid "Session" -msgstr "Sessão" - -#: views/elements/sql_log_panel.ctp:21 -msgid "Sql Logs" -msgstr "Logs Sql" - -#: views/elements/sql_log_panel.ctp:31 -msgid "toggle (%s) query explains for %s" -msgstr "alternar (%s) query explains por %s" - -#: views/elements/sql_log_panel.ctp:39 -msgid "No slow queries!, or your database does not support EXPLAIN" -msgstr "Sem consultas lentas!, ou o seu banco de dados não suporta EXPLAIN" - -#: views/elements/sql_log_panel.ctp:44 -msgid "No active database connections" -msgstr "Sem conexões ativas de banco de dados" - -#: views/elements/timer_panel.ctp:33 -msgid "Memory" -msgstr "Memória" - -#: views/elements/timer_panel.ctp:35 -msgid "Current Memory Use" -msgstr "Uso atual de memória" - -#: views/elements/timer_panel.ctp:39 -msgid "Peak Memory Use" -msgstr "Pico de uso de memória" - -#: views/elements/timer_panel.ctp:43 -msgid "Timers" -msgstr "Tempos" - -#: views/elements/timer_panel.ctp:45 -msgid "%s (ms)" -msgstr "%s (ms)" - -#: views/elements/timer_panel.ctp:46 -msgid "Total Request Time:" -msgstr "Tempo Total de Requisição" - -#: views/elements/timer_panel.ctp:54 -msgid "Time in ms" -msgstr "Tempo em ms" - -#: views/elements/timer_panel.ctp:54 -msgid "Graph" -msgstr "Gráfico" - -#: views/elements/variables_panel.ctp:21 -msgid "View Variables" -msgstr "Visualizar Variáveis" - -#: views/helpers/simple_graph.php:79 -msgid "Starting %sms into the request, taking %sms" -msgstr "Começando %sms na requisição, levando %sms" diff --git a/vendor/cakephp/debug_kit/src/Locale/spa/LC_MESSAGES/debug_kit.po b/vendor/cakephp/debug_kit/src/Locale/spa/LC_MESSAGES/debug_kit.po deleted file mode 100644 index 0833a49..0000000 --- a/vendor/cakephp/debug_kit/src/Locale/spa/LC_MESSAGES/debug_kit.po +++ /dev/null @@ -1,135 +0,0 @@ -# LANGUAGE translation of CakePHP Application -# Copyright YEAR NAME -# No version information was available in the source files. -# -#, fuzzy -msgid "" -msgstr "Project-Id-Version: PROJECT VERSION\n" - "POT-Creation-Date: 2009-05-27 09:47+0200\n" - "PO-Revision-Date: YYYY-mm-DD HH:MM+ZZZZ\n" - "Last-Translator: NAME \n" - "Language-Team: LANGUAGE \n" - "MIME-Version: 1.0\n" - "Content-Type: text/plain; charset=UTF-8\n" - "Content-Transfer-Encoding: 8bit\n" - "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" - -#: controllers/components/toolbar.php:91 -msgid "Component initialization and startup" -msgstr "" - -#: controllers/components/toolbar.php:140 -msgid "Controller Action" -msgstr "" - -#: controllers/components/toolbar.php:167 -msgid "Render Controller Action" -msgstr "" - -#: controllers/components/toolbar.php:231 -msgid "Could not load DebugToolbar panel %s" -msgstr "" - -#: views/elements/debug_toolbar.ctp:25 -msgid "There are no active panels. You must enable a panel to see its output." -msgstr "" - -#: views/elements/history_panel.ctp:21 -msgid "Request History" -msgstr "" - -#: views/elements/history_panel.ctp:23 -msgid "No previous requests logged." -msgstr "" - -#: views/elements/history_panel.ctp:25 -msgid "previous requests available" -msgstr "" - -#: views/elements/history_panel.ctp:27 -msgid "Restore to current request" -msgstr "" - -#: views/elements/log_panel.ctp:21 -msgid "Logs" -msgstr "" - -#: views/elements/log_panel.ctp:28 -msgid "Time" -msgstr "" - -#: views/elements/log_panel.ctp:28 views/elements/timer_panel.ctp:54 -msgid "Message" -msgstr "" - -#: views/elements/log_panel.ctp:37 -msgid "There were no log entries made this request" -msgstr "" - -#: views/elements/request_panel.ctp:21 -msgid "Request" -msgstr "" - -#: views/elements/request_panel.ctp:35 -msgid "Current Route" -msgstr "" - -#: views/elements/session_panel.ctp:21 -msgid "Session" -msgstr "" - -#: views/elements/sql_log_panel.ctp:21 -msgid "Sql Logs" -msgstr "" - -#: views/elements/sql_log_panel.ctp:31 -msgid "toggle (%s) query explains for %s" -msgstr "" - -#: views/elements/sql_log_panel.ctp:39 -msgid "No slow queries!, or your database does not support EXPLAIN" -msgstr "" - -#: views/elements/sql_log_panel.ctp:44 -msgid "No active database connections" -msgstr "" - -#: views/elements/timer_panel.ctp:33 -msgid "Memory" -msgstr "" - -#: views/elements/timer_panel.ctp:35 -msgid "Current Memory Use" -msgstr "" - -#: views/elements/timer_panel.ctp:39 -msgid "Peak Memory Use" -msgstr "" - -#: views/elements/timer_panel.ctp:43 -msgid "Timers" -msgstr "" - -#: views/elements/timer_panel.ctp:45 -msgid "%s (ms)" -msgstr "" - -#: views/elements/timer_panel.ctp:46 -msgid "Total Request Time:" -msgstr "" - -#: views/elements/timer_panel.ctp:54 -msgid "Time in ms" -msgstr "" - -#: views/elements/timer_panel.ctp:54 -msgid "Graph" -msgstr "" - -#: views/elements/variables_panel.ctp:21 -msgid "View Variables" -msgstr "" - -#: views/helpers/simple_graph.php:79 -msgid "Starting %sms into the request, taking %sms" -msgstr "" \ No newline at end of file diff --git a/vendor/cakephp/debug_kit/src/Log/Engine/DebugKitLog.php b/vendor/cakephp/debug_kit/src/Log/Engine/DebugKitLog.php deleted file mode 100644 index fc96681..0000000 --- a/vendor/cakephp/debug_kit/src/Log/Engine/DebugKitLog.php +++ /dev/null @@ -1,78 +0,0 @@ -_logs[$type])) { - $this->_logs[$type] = []; - } - $this->_logs[$type][] = [date('Y-m-d H:i:s'), $this->_format($message)]; - } - - /** - * Get the logs. - * - * @return array - */ - public function all() - { - return $this->_logs; - } - - /** - * Get the number of log entries. - * - * @return int - */ - public function count() - { - return array_reduce($this->_logs, function ($sum, $v) { - return $sum + count($v); - }, 0); - } - - /** - * Check if there are no logs. - * - * @return bool - */ - public function noLogs() - { - return empty($this->_logs); - } -} diff --git a/vendor/cakephp/debug_kit/src/Mailer/AbstractResult.php b/vendor/cakephp/debug_kit/src/Mailer/AbstractResult.php deleted file mode 100644 index 4c4e443..0000000 --- a/vendor/cakephp/debug_kit/src/Mailer/AbstractResult.php +++ /dev/null @@ -1,54 +0,0 @@ -headers; - } - - /** - * Returns the rendered parts in th email - * - * @return array - */ - public function getParts() - { - return $this->parts; - } -} diff --git a/vendor/cakephp/debug_kit/src/Mailer/MailPreview.php b/vendor/cakephp/debug_kit/src/Mailer/MailPreview.php deleted file mode 100644 index c720876..0000000 --- a/vendor/cakephp/debug_kit/src/Mailer/MailPreview.php +++ /dev/null @@ -1,102 +0,0 @@ -validEmail($email)) { - return $email; - } - - return null; - } - - /** - * Returns a list of valid emails - * - * @return array - */ - public function getEmails() - { - $emails = []; - foreach (get_class_methods($this) as $methodName) { - if (!$this->validEmail($methodName)) { - continue; - } - - $emails[] = $methodName; - } - - return $emails; - } - - /** - * Returns the name of this preview - * - * @return string - */ - public function name() - { - $classname = get_class($this); - $pos = strrpos($classname, '\\'); - - return substr($classname, $pos + 1); - } - - /** - * Returns whether or not a specified email is valid - * for this MailPreview instance - * - * @param string $email Name of email - * @return bool - */ - protected function validEmail($email) - { - if (empty($email)) { - return false; - } - - $baseClass = new ReflectionClass(get_class()); - if ($baseClass->hasMethod($email)) { - return false; - } - - try { - $method = new ReflectionMethod($this, $email); - } catch (ReflectionException $e) { - return false; - } - - return $method->isPublic(); - } -} diff --git a/vendor/cakephp/debug_kit/src/Mailer/PreviewResult.php b/vendor/cakephp/debug_kit/src/Mailer/PreviewResult.php deleted file mode 100644 index 5866c35..0000000 --- a/vendor/cakephp/debug_kit/src/Mailer/PreviewResult.php +++ /dev/null @@ -1,63 +0,0 @@ -processMailer(clone $mailer, $method); - $mailer->reset(); - } - - /** - * Executes the mailer and extracts the relevant information from the generated email - * - * @param Mailer $mailer The mailer instance to execute and extract the email data from - * @param string $method The method to execute in the mailer - * @return void - */ - protected function processMailer(Mailer $mailer, $method) - { - $reflection = new ReflectionClass($mailer); - $prop = $reflection->getProperty('_email'); - $prop->setAccessible(true); - $email = $prop->getValue($mailer); - - if (!$email->viewBuilder()->getTemplate()) { - $email->viewBuilder()->setTemplate($method); - } - - $render = (new ReflectionClass($email)) - ->getMethod('_renderTemplates') - ->getClosure($email); - - $this->parts = $render(''); - - $extra = ['from', 'sender', 'replyTo', 'readReceipt', 'returnPath', 'to', 'cc', 'subject']; - $this->headers = array_filter($email->getHeaders($extra)); - } -} diff --git a/vendor/cakephp/debug_kit/src/Mailer/SentMailResult.php b/vendor/cakephp/debug_kit/src/Mailer/SentMailResult.php deleted file mode 100644 index 60f3fc5..0000000 --- a/vendor/cakephp/debug_kit/src/Mailer/SentMailResult.php +++ /dev/null @@ -1,36 +0,0 @@ -headers = $headers; - $this->parts = $parts; - } -} diff --git a/vendor/cakephp/debug_kit/src/Mailer/Transport/DebugKitTransport.php b/vendor/cakephp/debug_kit/src/Mailer/Transport/DebugKitTransport.php deleted file mode 100644 index 5e84e24..0000000 --- a/vendor/cakephp/debug_kit/src/Mailer/Transport/DebugKitTransport.php +++ /dev/null @@ -1,141 +0,0 @@ -emailLog = $config['debugKitLog']; - - if ($originalTransport !== null) { - $this->originalTransport = $originalTransport; - - return; - } - - $className = false; - if (!empty($config['originalClassName'])) { - $className = App::className( - $config['originalClassName'], - 'Mailer/Transport', - 'Transport' - ); - } - - if ($className) { - unset($config['originalClassName'], $config['debugKitLog']); - $this->originalTransport = new $className($config); - } - } - - /** - * Send mail - * - * @param \Cake\Mailer\Email $email Cake Email - * @return array - */ - public function send(Email $email) - { - $headers = $email->getHeaders(['from', 'sender', 'replyTo', 'readReceipt', 'returnPath', 'to', 'cc']); - $parts = [ - 'text' => $email->message(Email::MESSAGE_TEXT), - 'html' => $email->message(Email::MESSAGE_HTML), - ]; - - $headers['Subject'] = $email->getOriginalSubject(); - $result = ['headers' => $headers, 'message' => $parts]; - $this->emailLog[] = $result; - - if ($this->originalTransport !== null) { - return $this->originalTransport->send($email); - } - - return $result; - } - - /** - * Proxy unknown methods to the wrapped object - * - * @param string $method The method to call - * @param array $args The args to call $method with. - * @return mixed - */ - public function __call($method, array $args) - { - return call_user_func_array([$this->originalTransport, $method], $args); - } - - /** - * Proxy property reads to the wrapped object - * - * @param string $name The property to read. - * @return mixed - */ - public function __get($name) - { - return $this->originalTransport->{$name}; - } - - /** - * Proxy property changes to the wrapped object - * - * @param string $name The property to read. - * @param mixed $value The property value. - * @return mixed - */ - public function __set($name, $value) - { - return $this->originalTransport->{$name} = $value; - } - - /** - * Proxy property changes to the wrapped object - * - * @param string $name The property to read. - * @return bool - */ - public function __isset($name) - { - return isset($this->originalTransport->{$name}); - } - - /** - * Proxy property changes to the wrapped object - * - * @param string $name The property to delete. - * @return void - */ - public function __unset($name) - { - unset($this->originalTransport->{$name}); - } -} diff --git a/vendor/cakephp/debug_kit/src/Middleware/DebugKitMiddleware.php b/vendor/cakephp/debug_kit/src/Middleware/DebugKitMiddleware.php deleted file mode 100644 index 99f7f55..0000000 --- a/vendor/cakephp/debug_kit/src/Middleware/DebugKitMiddleware.php +++ /dev/null @@ -1,61 +0,0 @@ -service = $service; - } - - /** - * Invoke the middleware. - * - * DebugKit will augment the response and add the toolbar if possible. - * - * @param \Psr\Http\Message\ServerRequestInterface $request The request. - * @param \Psr\Http\Message\ResponseInterface $response The response. - * @param callable $next Callback to invoke the next middleware. - * @return \Psr\Http\Message\ResponseInterface A response - */ - public function __invoke($request, $response, $next) - { - $this->service->loadPanels(); - $this->service->initializePanels(); - $response = $next($request, $response); - $row = $this->service->saveData($request, $response); - if (!$row) { - return $response; - } - - return $this->service->injectScripts($row, $response); - } -} diff --git a/vendor/cakephp/debug_kit/src/Model/Behavior/TimedBehavior.php b/vendor/cakephp/debug_kit/src/Model/Behavior/TimedBehavior.php deleted file mode 100644 index ec4bfac..0000000 --- a/vendor/cakephp/debug_kit/src/Model/Behavior/TimedBehavior.php +++ /dev/null @@ -1,68 +0,0 @@ -getSubject()->getAlias(); - DebugTimer::start($alias . '_find', $alias . '->find()'); - - return $query->formatResults(function ($results) use ($alias) { - DebugTimer::stop($alias . '_find'); - - return $results; - }); - } - - /** - * beforeSave, starts a time before a save is initiated. - * - * @param \Cake\Event\Event $event The beforeSave event - * @return void - */ - public function beforeSave(Event $event) - { - $alias = $event->getSubject()->getAlias(); - DebugTimer::start($alias . '_save', $alias . '->save()'); - } - - /** - * afterSave, stop the timer started from a save. - * - * @param \Cake\Event\Event $event The afterSave event - * @return void - */ - public function afterSave(Event $event) - { - $alias = $event->getSubject()->getAlias(); - DebugTimer::stop($alias . '_save'); - } -} diff --git a/vendor/cakephp/debug_kit/src/Model/Entity/Panel.php b/vendor/cakephp/debug_kit/src/Model/Entity/Panel.php deleted file mode 100644 index 5e92c3a..0000000 --- a/vendor/cakephp/debug_kit/src/Model/Entity/Panel.php +++ /dev/null @@ -1,52 +0,0 @@ -getConnection(); - $schema = $connection->getSchemaCollection(); - - try { - $existing = $schema->listTables(); - } catch (PDOException $e) { - // Handle errors when SQLite blows up if the schema has changed. - if (strpos($e->getMessage(), 'schema has changed') !== false) { - $existing = $schema->listTables(); - } else { - throw $e; - } - } - - try { - foreach ($fixtures as $name) { - $class = App::className($name, 'Test/Fixture', 'Fixture'); - if ($class === false) { - throw new \RuntimeException("Unknown fixture '$name'."); - } - /** @var \Cake\Datasource\FixtureInterface $fixture */ - $fixture = new $class($connection->configName()); - if (in_array($fixture->table, $existing)) { - continue; - } - $fixture->create($connection); - } - } catch (PDOException $e) { - if (strpos($e->getMessage(), 'unable to open')) { - throw new RuntimeException( - 'Could not create a SQLite database. ' . - 'Ensure that your webserver has write access to the database file and folder it is in.' - ); - } - throw $e; - } - } -} diff --git a/vendor/cakephp/debug_kit/src/Model/Table/PanelsTable.php b/vendor/cakephp/debug_kit/src/Model/Table/PanelsTable.php deleted file mode 100644 index 11b36bf..0000000 --- a/vendor/cakephp/debug_kit/src/Model/Table/PanelsTable.php +++ /dev/null @@ -1,74 +0,0 @@ -belongsTo('DebugKit.Requests'); - $this->ensureTables(['DebugKit.Requests', 'DebugKit.Panels']); - } - - /** - * Find panels by requestid - * - * @param \Cake\ORM\Query $query The query - * @param array $options The options to use. - * @return \Cake\ORM\Query The query. - * @throws \RuntimeException - */ - public function findByRequest(Query $query, array $options) - { - if (empty($options['requestId'])) { - throw new \RuntimeException(__d('debug_kit', 'Missing request id in {0}.', 'findByRequest()')); - } - - return $query->where(['Panels.request_id' => $options['requestId']]) - ->order(['Panels.title' => 'ASC']); - } - - /** - * DebugKit tables are special. - * - * @return string - */ - public static function defaultConnectionName() - { - return 'debug_kit'; - } -} diff --git a/vendor/cakephp/debug_kit/src/Model/Table/RequestsTable.php b/vendor/cakephp/debug_kit/src/Model/Table/RequestsTable.php deleted file mode 100644 index 5557774..0000000 --- a/vendor/cakephp/debug_kit/src/Model/Table/RequestsTable.php +++ /dev/null @@ -1,128 +0,0 @@ -hasMany('DebugKit.Panels', [ - 'sort' => ['Panels.title' => 'ASC'], - ]); - $this->addBehavior('Timestamp', [ - 'events' => [ - 'Model.beforeSave' => ['requested_at' => 'new'], - ], - ]); - $this->ensureTables(['DebugKit.Requests', 'DebugKit.Panels']); - } - - /** - * DebugKit tables are special. - * - * @return string - */ - public static function defaultConnectionName() - { - return 'debug_kit'; - } - - /** - * Finder method to get recent requests as a simple array - * - * @param \Cake\ORM\Query $query The query - * @param array $options The options - * @return Query The query. - */ - public function findRecent(Query $query, array $options) - { - return $query->order(['Requests.requested_at' => 'DESC']) - ->limit(10); - } - - /** - * Check if garbage collection should be run - * - * @return bool - */ - protected function shouldGc() - { - return time() % 100 === 0; - } - - /** - * Garbage collect old request data. - * - * Delete request data that is older than latest 20 requests. - * You can use the `DebugKit.requestCount` config to change this limit. - * This method will only trigger periodically. - * - * @return void - */ - public function gc() - { - if (!$this->shouldGc()) { - return; - } - $noPurge = $this->find() - ->select(['id']) - ->enableHydration(false) - ->order(['requested_at' => 'desc']) - ->limit(Configure::read('DebugKit.requestCount') ?: 20) - ->extract('id') - ->toArray(); - - $query = $this->Panels->query() - ->delete() - ->where(['request_id NOT IN' => $noPurge]); - $statement = $query->execute(); - $statement->closeCursor(); - - $query = $this->query() - ->delete() - ->where(['id NOT IN' => $noPurge]); - - $statement = $query->execute(); - $statement->closeCursor(); - - $conn = $this->getConnection(); - if ($conn->getDriver() instanceof Sqlite) { - $conn->execute('VACUUM;'); - } - } -} diff --git a/vendor/cakephp/debug_kit/src/Panel/CachePanel.php b/vendor/cakephp/debug_kit/src/Panel/CachePanel.php deleted file mode 100644 index ad4248a..0000000 --- a/vendor/cakephp/debug_kit/src/Panel/CachePanel.php +++ /dev/null @@ -1,71 +0,0 @@ -_instances[$name] = $instance; - } - } - } - - /** - * Get the data for this panel - * - * @return array - */ - public function data() - { - $metrics = []; - foreach ($this->_instances as $name => $instance) { - $metrics[$name] = $instance->metrics(); - } - - return [ - 'metrics' => $metrics, - ]; - } -} diff --git a/vendor/cakephp/debug_kit/src/Panel/DeprecationsPanel.php b/vendor/cakephp/debug_kit/src/Panel/DeprecationsPanel.php deleted file mode 100644 index 8edf3ee..0000000 --- a/vendor/cakephp/debug_kit/src/Panel/DeprecationsPanel.php +++ /dev/null @@ -1,170 +0,0 @@ -_debug = new DebugInclude(); - } - - /** - * Get a list of files that were deprecated and split them out into the various parts of the app - * - * @return array - */ - protected function _prepare() - { - $errors = static::$deprecatedErrors; - $return = ['cake' => [], 'app' => [], 'plugins' => [], 'vendor' => [], 'other' => []]; - - foreach ($errors as $error) { - $file = $error['file']; - $line = $error['line']; - if (isset($error['context']['frame'])) { - $file = $error['context']['frame']['file']; - $line = $error['context']['frame']['line']; - } - - $errorData = [ - 'file' => $file, - 'line' => $line, - 'message' => $error['message'], - ]; - - $pluginName = $this->_debug->getPluginName($file); - if ($pluginName) { - $errorData['niceFile'] = $this->_debug->niceFileName($file, 'plugin', $pluginName); - $return['plugins'][$pluginName][] = $errorData; - } elseif ($this->_debug->isAppFile($file)) { - $errorData['niceFile'] = $this->_debug->niceFileName($file, 'app'); - $return['app'][] = $errorData; - } elseif ($this->_debug->isCakeFile($file)) { - $errorData['niceFile'] = $this->_debug->niceFileName($file, 'cake'); - $return['cake'][] = $errorData; - } else { - $vendorName = $this->_debug->getComposerPackageName($file); - - if ($vendorName) { - $errorData['niceFile'] = $this->_debug->niceFileName($file, 'vendor', $vendorName); - $return['vendor'][$vendorName][] = $errorData; - } else { - $errorData['niceFile'] = $this->_debug->niceFileName($file, 'root'); - $return['other'][] = $errorData; - } - } - } - - ksort($return['app']); - ksort($return['cake']); - ksort($return['plugins']); - ksort($return['vendor']); - - foreach ($return['plugins'] as &$plugin) { - ksort($plugin); - } - - return $return; - } - - /** - * Add a error - * - * @param array $error The deprecated error - * @return void - */ - public static function addDeprecatedError($error) - { - static::$deprecatedErrors[] = $error; - } - - /** - * Reset the tracked errors. - * - * @return void - */ - public static function clearDeprecatedErrors() - { - static::$deprecatedErrors = []; - } - - /** - * Get the number of files deprecated in this request. - * - * @return string - */ - public function summary() - { - $data = $this->_data; - if (empty($data)) { - $data = $this->_prepare(); - } - - return array_reduce($data, function ($carry, $item) { - if (empty($item)) { - return $carry; - } - // app, cake, or other groups - if (Hash::dimensions($item) == 2) { - return $carry + count($item); - } - - // plugin and vendor groups - foreach ($item as $group) { - $carry += count($group); - } - - return $carry; - }, 0); - } - - /** - * Shutdown callback - * - * @param \Cake\Event\Event $event Event - * @return void - */ - public function shutdown(Event $event) - { - $this->_data = $this->_prepare(); - } -} diff --git a/vendor/cakephp/debug_kit/src/Panel/EnvironmentPanel.php b/vendor/cakephp/debug_kit/src/Panel/EnvironmentPanel.php deleted file mode 100644 index 3765d76..0000000 --- a/vendor/cakephp/debug_kit/src/Panel/EnvironmentPanel.php +++ /dev/null @@ -1,97 +0,0 @@ - $phpVer], - $_SERVER - ); - unset($return['php']['argv']); - - // ini Data - $return['ini'] = [ - 'intl.default_locale' => ini_get('intl.default_locale'), - 'memory_limit' => ini_get('memory_limit'), - 'error_reporting' => ini_get('error_reporting'), - 'upload_max_filesize' => ini_get('upload_max_filesize'), - 'post_max_size' => ini_get('post_max_size'), - ]; - - // CakePHP Data - $return['cake'] = [ - 'APP' => APP, - 'APP_DIR' => APP_DIR, - 'CACHE' => CACHE, - 'CAKE' => CAKE, - 'CAKE_CORE_INCLUDE_PATH' => CAKE_CORE_INCLUDE_PATH, - 'CONFIG' => CONFIG, - 'CORE_PATH' => CORE_PATH, - 'CAKE_VERSION' => Configure::version(), - 'DS' => DS, - 'LOGS' => LOGS, - 'ROOT' => ROOT, - 'TESTS' => TESTS, - 'TMP' => TMP, - 'WWW_ROOT' => WWW_ROOT, - ]; - - $hiddenCakeConstants = array_fill_keys( - [ - 'TIME_START', 'SECOND', 'MINUTE', 'HOUR', 'DAY', 'WEEK', 'MONTH', 'YEAR', - ], - '' - ); - $var = get_defined_constants(true); - $return['app'] = array_diff_key($var['user'], $return['cake'], $hiddenCakeConstants); - - if (isset($var['hidef'])) { - $return['hidef'] = $var['hidef']; - } - - return $return; - } - - /** - * Shutdown callback - * - * @param \Cake\Event\Event $event Event - * @return void - */ - public function shutdown(Event $event) - { - $this->_data = $this->_prepare(); - } -} diff --git a/vendor/cakephp/debug_kit/src/Panel/HistoryPanel.php b/vendor/cakephp/debug_kit/src/Panel/HistoryPanel.php deleted file mode 100644 index f2ece23..0000000 --- a/vendor/cakephp/debug_kit/src/Panel/HistoryPanel.php +++ /dev/null @@ -1,49 +0,0 @@ -find('recent'); - - return [ - 'requests' => $recent->toArray(), - ]; - } - - /** - * Gets the initial text for the history summary - * - * @return string - */ - public function summary() - { - return '0 xhr'; - } -} diff --git a/vendor/cakephp/debug_kit/src/Panel/IncludePanel.php b/vendor/cakephp/debug_kit/src/Panel/IncludePanel.php deleted file mode 100644 index 6494050..0000000 --- a/vendor/cakephp/debug_kit/src/Panel/IncludePanel.php +++ /dev/null @@ -1,116 +0,0 @@ -_debug = new DebugInclude(); - } - - /** - * Get a list of files that were included and split them out into the various parts of the app - * - * @return array - */ - protected function _prepare() - { - $return = ['cake' => [], 'app' => [], 'plugins' => [], 'vendor' => [], 'other' => []]; - - foreach (get_included_files() as $file) { - $pluginName = $this->_debug->getPluginName($file); - - if ($pluginName) { - $return['plugins'][$pluginName][$this->_debug->getFileType($file)][] = $this->_debug->niceFileName($file, 'plugin', $pluginName); - } elseif ($this->_debug->isAppFile($file)) { - $return['app'][$this->_debug->getFileType($file)][] = $this->_debug->niceFileName($file, 'app'); - } elseif ($this->_debug->isCakeFile($file)) { - $return['cake'][$this->_debug->getFileType($file)][] = $this->_debug->niceFileName($file, 'cake'); - } else { - $vendorName = $this->_debug->getComposerPackageName($file); - - if ($vendorName) { - $return['vendor'][$vendorName][] = $this->_debug->niceFileName($file, 'vendor', $vendorName); - } else { - $return['other'][] = $this->_debug->niceFileName($file, 'root'); - } - } - } - - $return['paths'] = $this->_debug->includePaths(); - - ksort($return['app']); - ksort($return['cake']); - ksort($return['plugins']); - ksort($return['vendor']); - - foreach ($return['plugins'] as &$plugin) { - ksort($plugin); - } - - return $return; - } - - /** - * Get the number of files included in this request. - * - * @return string - */ - public function summary() - { - $data = $this->_data; - if (empty($data)) { - $data = $this->_prepare(); - } - - unset($data['paths']); - $data = array_filter($data, function ($v, $k) { - return !empty($v); - }, ARRAY_FILTER_USE_BOTH); - - return count(Hash::flatten($data)); - } - - /** - * Shutdown callback - * - * @param \Cake\Event\Event $event Event - * @return void - */ - public function shutdown(Event $event) - { - $this->_data = $this->_prepare(); - } -} diff --git a/vendor/cakephp/debug_kit/src/Panel/LogPanel.php b/vendor/cakephp/debug_kit/src/Panel/LogPanel.php deleted file mode 100644 index 8297448..0000000 --- a/vendor/cakephp/debug_kit/src/Panel/LogPanel.php +++ /dev/null @@ -1,66 +0,0 @@ - 'DebugKit.DebugKit', - ]); - } - - /** - * Get the panel data - * - * @return array - */ - public function data() - { - return [ - 'logger' => Log::engine('debug_kit_log_panel'), - ]; - } - - /** - * Get the summary data. - * - * @return string - */ - public function summary() - { - $logger = Log::engine('debug_kit_log_panel'); - if (!$logger) { - return '0'; - } - - return (string)$logger->count(); - } -} diff --git a/vendor/cakephp/debug_kit/src/Panel/MailPanel.php b/vendor/cakephp/debug_kit/src/Panel/MailPanel.php deleted file mode 100644 index 7aeb87c..0000000 --- a/vendor/cakephp/debug_kit/src/Panel/MailPanel.php +++ /dev/null @@ -1,93 +0,0 @@ -getProperty('_config'); - $property->setAccessible(true); - $configs = $property->getValue(); - - $log = $this->emailLog = new ArrayObject(); - - foreach ($configs as $name => &$transport) { - if (is_object($transport)) { - $configs[$name] = new DebugKitTransport(['debugKitLog' => $log], $transport); - continue; - } - - $className = App::className($transport['className'], 'Mailer/Transport', 'Transport'); - - if (!$className) { - continue; - } - - $transport['originalClassName'] = $transport['className']; - $transport['className'] = 'DebugKit.DebugKit'; - $transport['debugKitLog'] = $log; - } - $property->setValue($configs); - } - - /** - * Get the data this panel wants to store. - * - * @return array - */ - public function data() - { - return [ - 'emails' => isset($this->emailLog) ? $this->emailLog->getArrayCopy() : [], - ]; - } - - /** - * Get summary data from the queries run. - * - * @return string - */ - public function summary() - { - if (empty($this->emailLog)) { - return ''; - } - - return (string)count($this->emailLog); - } -} diff --git a/vendor/cakephp/debug_kit/src/Panel/PackagesPanel.php b/vendor/cakephp/debug_kit/src/Panel/PackagesPanel.php deleted file mode 100644 index 5c2c888..0000000 --- a/vendor/cakephp/debug_kit/src/Panel/PackagesPanel.php +++ /dev/null @@ -1,46 +0,0 @@ -exists()) { - $lockContent = $lockFile->read(); - $packages = $lockContent['packages']; - $devPackages = $lockContent['packages-dev']; - } - - return [ - 'packages' => $packages, - 'devPackages' => $devPackages, - ]; - } -} diff --git a/vendor/cakephp/debug_kit/src/Panel/PanelRegistry.php b/vendor/cakephp/debug_kit/src/Panel/PanelRegistry.php deleted file mode 100644 index 8f8183b..0000000 --- a/vendor/cakephp/debug_kit/src/Panel/PanelRegistry.php +++ /dev/null @@ -1,83 +0,0 @@ -setEventManager($events); - } - - /** - * Resolve a panel class name. - * - * Part of the template method for Cake\Utility\ObjectRegistry::load() - * - * @param string $class Partial class name to resolve. - * @return string|false Either the correct class name or false. - */ - protected function _resolveClassName($class) - { - return App::className($class, 'Panel', 'Panel'); - } - - /** - * Throws an exception when a component is missing. - * - * Part of the template method for Cake\Utility\ObjectRegistry::load() - * - * @param string $class The classname that is missing. - * @param string $plugin The plugin the component is missing in. - * @return void - * @throws \RuntimeException - */ - protected function _throwMissingClassError($class, $plugin) - { - throw new \RuntimeException(__d('debug_kit', "Unable to find ''{0}'' panel.", $class)); - } - - /** - * Create the panels instance. - * - * Part of the template method for Cake\Utility\ObjectRegistry::load() - * - * @param string $class The classname to create. - * @param string $alias The alias of the panel. - * @param array $config An array of config to use for the panel. - * @return \DebugKit\DebugPanel The constructed panel class. - */ - protected function _create($class, $alias, $config) - { - $instance = new $class($this, $config); - $this->getEventManager()->on($instance); - - return $instance; - } -} diff --git a/vendor/cakephp/debug_kit/src/Panel/RequestPanel.php b/vendor/cakephp/debug_kit/src/Panel/RequestPanel.php deleted file mode 100644 index 9d15dd5..0000000 --- a/vendor/cakephp/debug_kit/src/Panel/RequestPanel.php +++ /dev/null @@ -1,46 +0,0 @@ -getSubject(); - $request = $controller->request; - $this->_data = [ - 'params' => $request->getAttribute("params"), - 'query' => $request->getQueryParams(), - 'data' => $request->getData(), - 'cookie' => $request->getCookieParams(), - 'get' => $_GET, - 'matchedRoute' => $request->getParam('_matchedRoute'), - 'headers' => ['response' => headers_sent($file, $line), 'file' => $file, 'line' => $line], - ]; - } -} diff --git a/vendor/cakephp/debug_kit/src/Panel/RoutesPanel.php b/vendor/cakephp/debug_kit/src/Panel/RoutesPanel.php deleted file mode 100644 index 9ddc8a7..0000000 --- a/vendor/cakephp/debug_kit/src/Panel/RoutesPanel.php +++ /dev/null @@ -1,61 +0,0 @@ -defaults['plugin'])) || $route->defaults['plugin'] !== 'DebugKit'; - }); - - return (string)count($routes); - } - - /** - * Data collection callback. - * - * @param \Cake\Event\Event $event The shutdown event. - * @return void - */ - public function shutdown(Event $event) - { - $controller = $event->getSubject(); - /* @var \Cake\Http\ServerRequest $request */ - $request = $controller ? $controller->request : null; - $this->_data = [ - 'matchedRoute' => $request ? $request->getParam('_matchedRoute') : null, - ]; - } -} diff --git a/vendor/cakephp/debug_kit/src/Panel/SessionPanel.php b/vendor/cakephp/debug_kit/src/Panel/SessionPanel.php deleted file mode 100644 index 6bd9755..0000000 --- a/vendor/cakephp/debug_kit/src/Panel/SessionPanel.php +++ /dev/null @@ -1,39 +0,0 @@ -getSubject()->request; - if ($request) { - $this->_data = ['content' => $request->getSession()->read()]; - } - } -} diff --git a/vendor/cakephp/debug_kit/src/Panel/SqlLogPanel.php b/vendor/cakephp/debug_kit/src/Panel/SqlLogPanel.php deleted file mode 100644 index 95c013d..0000000 --- a/vendor/cakephp/debug_kit/src/Panel/SqlLogPanel.php +++ /dev/null @@ -1,111 +0,0 @@ -configName() === 'debug_kit') { - continue; - } - $logger = null; - if ($connection->isQueryLoggingEnabled()) { - $logger = $connection->getLogger(); - } - - if ($logger instanceof DebugLog) { - $logger->setIncludeSchema($includeSchemaReflection); - $this->_loggers[] = $logger; - continue; - } - $logger = new DebugLog($logger, $name, $includeSchemaReflection); - - $connection->enableQueryLogging(true); - - if (method_exists($connection, 'setLogger')) { - $connection->setLogger($logger); - } else { - $connection->logger($logger); - } - - $this->_loggers[] = $logger; - } - } - - /** - * Get the data this panel wants to store. - * - * @return array - */ - public function data() - { - return [ - 'tables' => array_map(function (Table $table) { - return $table->getAlias(); - }, TableRegistry::getTableLocator()->genericInstances()), - 'loggers' => $this->_loggers, - ]; - } - - /** - * Get summary data from the queries run. - * - * @return string - */ - public function summary() - { - $count = $time = 0; - foreach ($this->_loggers as $logger) { - $count += count($logger->queries()); - $time += $logger->totalTime(); - } - if (!$count) { - return '0'; - } - - return "$count / $time ms"; - } -} diff --git a/vendor/cakephp/debug_kit/src/Panel/TimerPanel.php b/vendor/cakephp/debug_kit/src/Panel/TimerPanel.php deleted file mode 100644 index ebb75ea..0000000 --- a/vendor/cakephp/debug_kit/src/Panel/TimerPanel.php +++ /dev/null @@ -1,129 +0,0 @@ - 0, 'callable' => $before('Event: ' . $name)], - ['priority' => 999, 'callable' => $after('Event: ' . $name)], - ]; - }; - - return [ - 'Controller.initialize' => [ - ['priority' => 0, 'callable' => function () { - DebugMemory::record(__d('debug_kit', 'Controller initialization')); - }], - ['priority' => 0, 'callable' => $before('Event: Controller.initialize')], - ['priority' => 999, 'callable' => $after('Event: Controller.initialize')], - ], - 'Controller.startup' => [ - ['priority' => 0, 'callable' => $before('Event: Controller.startup')], - ['priority' => 999, 'callable' => $after('Event: Controller.startup')], - ['priority' => 999, 'callable' => function () { - DebugMemory::record(__d('debug_kit', 'Controller action start')); - DebugTimer::start(__d('debug_kit', 'Controller action')); - }], - ], - 'Controller.beforeRender' => [ - ['priority' => 0, 'callable' => function () { - DebugTimer::stop(__d('debug_kit', 'Controller action')); - }], - ['priority' => 0, 'callable' => $before('Event: Controller.beforeRender')], - ['priority' => 999, 'callable' => $after('Event: Controller.beforeRender')], - ['priority' => 999, 'callable' => function () { - DebugMemory::record(__d('debug_kit', 'View Render start')); - DebugTimer::start(__d('debug_kit', 'View Render start')); - }], - ], - 'View.beforeRender' => $both('View.beforeRender'), - 'View.afterRender' => $both('View.afterRender'), - 'View.beforeLayout' => $both('View.beforeLayout'), - 'View.afterLayout' => $both('View.afterLayout'), - 'View.beforeRenderFile' => [ - ['priority' => 0, 'callable' => function ($event, $filename) { - DebugTimer::start(__d('debug_kit', 'Render {0}', $filename)); - }], - ], - 'View.afterRenderFile' => [ - ['priority' => 0, 'callable' => function ($event, $filename) { - DebugTimer::stop(__d('debug_kit', 'Render {0}', $filename)); - }], - ], - 'Controller.shutdown' => [ - ['priority' => 0, 'callable' => $before('Event: Controller.shutdown')], - ['priority' => 0, 'callable' => function () { - DebugTimer::stop(__d('debug_kit', 'View Render start')); - DebugMemory::record(__d('debug_kit', 'Controller shutdown')); - }], - ['priority' => 999, 'callable' => $after('Event: Controller.shutdown')], - ], - ]; - } - - /** - * Get the data for the panel. - * - * @return array - */ - public function data() - { - return [ - 'requestTime' => DebugTimer::requestTime(), - 'timers' => DebugTimer::getAll(), - 'memory' => DebugMemory::getAll(), - 'peakMemory' => DebugMemory::getPeak(), - ]; - } - - /** - * Get the summary for the panel. - * - * @return string - */ - public function summary() - { - $time = Number::precision(DebugTimer::requestTime(), 2) . ' s'; - $memory = Number::toReadableSize(DebugMemory::getPeak()); - - return "$time / $memory"; - } -} diff --git a/vendor/cakephp/debug_kit/src/Panel/VariablesPanel.php b/vendor/cakephp/debug_kit/src/Panel/VariablesPanel.php deleted file mode 100644 index c6d803e..0000000 --- a/vendor/cakephp/debug_kit/src/Panel/VariablesPanel.php +++ /dev/null @@ -1,195 +0,0 @@ -errors(); - - foreach ($entity->visibleProperties() as $property) { - $v = $entity[$property]; - if ($v instanceof EntityInterface) { - $errors[$property] = $this->_getErrors($v); - } elseif (is_array($v)) { - foreach ($v as $key => $varValue) { - if ($varValue instanceof EntityInterface) { - $errors[$property][$key] = $this->_getErrors($varValue); - } - } - } - } - - return Hash::filter($errors); - } - - /** - * Safely retrieves debug information from an object - * and applies a callback. - * - * @param callable $walker The walker to apply on the debug info array. - * @param object $item The item whose debug info to retrieve. - * - * @return array|string - */ - protected function _walkDebugInfo(callable $walker, $item) - { - try { - $info = $item->__debugInfo(); - } catch (\Exception $exception) { - return __d('debug_kit', 'Could not retrieve debug info - {0}. Error: {1} in {2}, line {3}', get_class($item), $exception->getMessage(), $exception->getFile(), $exception->getLine()); - } - - return array_map($walker, $info); - } - - /** - * Shutdown event - * - * @param \Cake\Event\Event $event The event - * @return void - */ - public function shutdown(Event $event) - { - $controller = $event->getSubject(); - $errors = []; - - $walker = function (&$item) use (&$walker) { - if ( - $item instanceof Collection || - $item instanceof Query || - $item instanceof ResultSet - ) { - try { - $item = $item->toArray(); - } catch (\Cake\Database\Exception $e) { - //Likely issue is unbuffered query; fall back to __debugInfo - $item = $this->_walkDebugInfo($walker, $item); - } catch (RuntimeException $e) { - // Likely a non-select query. - $item = $this->_walkDebugInfo($walker, $item); - } catch (InvalidArgumentException $e) { - $item = $this->_walkDebugInfo($walker, $item); - } - } elseif ( - $item instanceof Closure || - $item instanceof PDO || - $item instanceof SimpleXMLElement - ) { - $item = 'Unserializable object - ' . get_class($item); - } elseif ($item instanceof Exception) { - $item = sprintf( - 'Unserializable object - %s. Error: %s in %s, line %s', - get_class($item), - $item->getMessage(), - $item->getFile(), - $item->getLine() - ); - } elseif (is_object($item)) { - if (method_exists($item, '__debugInfo')) { - // Convert objects into using __debugInfo. - $item = $this->_walkDebugInfo($walker, $item); - } else { - $item = $this->trySerialize($item); - } - } elseif (is_resource($item)) { - $item = sprintf('[%s] %s', get_resource_type($item), $item); - } - - return $this->trySerialize($item); - }; - // Copy so viewVars is not mutated. - $vars = $controller->viewVars; - array_walk_recursive($vars, $walker); - - foreach ($vars as $k => $v) { - // Get the validation errors for Entity - if ($v instanceof EntityInterface) { - $errors[$k] = $this->_getErrors($v); - } elseif ($v instanceof Form) { - $formError = $v->errors(); - if (!empty($formError)) { - $errors[$k] = $formError; - } - } - } - - $this->_data = [ - 'content' => $vars, - 'errors' => $errors, - ]; - } - - /** - * Try to serialize an item, provide an error message if not possible - * - * @param mixed $item Item to check - * @return mixed The $item if it is serializable, error message if not - */ - protected function trySerialize($item) - { - try { - serialize($item); - - return $item; - } catch (\Exception $e) { - if (is_object($item)) { - return __d('debug_kit', 'Unserializable object - {0}. Error: {1} in {2}, line {3}', get_class($item), $e->getMessage(), $e->getFile(), $e->getLine()); - } - - return __d('debug_kit', 'Unserializable Error: {1} in {2}, line {3}', $e->getMessage(), $e->getFile(), $e->getLine()); - } - } - - /** - * Get summary data for the variables panel. - * - * @return string - */ - public function summary() - { - if (!isset($this->_data['content'])) { - return '0'; - } - - return (string)count($this->_data['content']); - } -} diff --git a/vendor/cakephp/debug_kit/src/Plugin.php b/vendor/cakephp/debug_kit/src/Plugin.php deleted file mode 100644 index be6dc5c..0000000 --- a/vendor/cakephp/debug_kit/src/Plugin.php +++ /dev/null @@ -1,23 +0,0 @@ -service = new ToolbarService($events, $config); - } - - /** - * Event bindings - * - * @return array - */ - public function implementedEvents() - { - return [ - 'Dispatcher.beforeDispatch' => [ - 'callable' => 'beforeDispatch', - 'priority' => 0, - ], - 'Dispatcher.afterDispatch' => [ - 'callable' => 'afterDispatch', - 'priority' => 9999, - ], - ]; - } - - /** - * Check whether or not debug kit is enabled. - * - * @return bool - */ - public function isEnabled() - { - return $this->service->isEnabled(); - } - - /** - * Get the list of loaded panels - * - * @return array - */ - public function loadedPanels() - { - return $this->service->registry()->loaded(); - } - - /** - * Get the list of loaded panels - * - * @param string $name The name of the panel you want to get. - * @return \DebugKit\DebugPanel|null The panel or null. - */ - public function panel($name) - { - $registry = $this->service->registry(); - - return $registry->{$name}; - } - - /** - * Do the required setup work. - * - * - Build panels. - * - Connect events - * - * @return void - */ - public function setup() - { - $this->service->loadPanels(); - } - - /** - * Call the initialize method onl all the loaded panels. - * - * @param \Cake\Event\Event $event The beforeDispatch event. - * @return void - */ - public function beforeDispatch(Event $event) - { - $this->service->initializePanels(); - } - - /** - * Save the toolbar data. - * - * @param \Cake\Event\Event $event The afterDispatch event. - * @return \Psr\Http\Message\ResponseInterface|void Modified response or null - */ - public function afterDispatch(Event $event) - { - /* @var Request $request */ - $request = $event->getData('request'); - /* @var Response $response */ - $response = $event->getData('response'); - $row = $this->service->saveData($request, $response); - if (!$row) { - return; - } - - return $this->service->injectScripts($row, $response); - } -} diff --git a/vendor/cakephp/debug_kit/src/Shell/BenchmarkShell.php b/vendor/cakephp/debug_kit/src/Shell/BenchmarkShell.php deleted file mode 100644 index 0324688..0000000 --- a/vendor/cakephp/debug_kit/src/Shell/BenchmarkShell.php +++ /dev/null @@ -1,173 +0,0 @@ -args[0]; - $defaults = ['t' => 100, 'n' => 10]; - $options = array_merge($defaults, $this->params); - $times = []; - - $this->out(Text::insert(__d('debug_kit', '-> Testing :url'), compact('url'))); - $this->out(""); - for ($i = 0; $i < $options['n']; $i++) { - if (floor($options['t'] - array_sum($times)) <= 0 || $options['n'] <= 1) { - break; - } - - $start = microtime(true); - file_get_contents($url); - $stop = microtime(true); - - $times[] = $stop - $start; - } - $this->_results($times); - } - - /** - * Prints calculated results - * - * @param array $times Array of time values - * @return void - */ - protected function _results($times) - { - $duration = array_sum($times); - $requests = count($times); - - $this->out(Text::insert(__d('debug_kit', 'Total Requests made: :requests'), compact('requests'))); - $this->out(Text::insert(__d('debug_kit', 'Total Time elapsed: :duration (seconds)'), compact('duration'))); - - $this->out(""); - - $this->out(Text::insert(__d('debug_kit', 'Requests/Second: :rps req/sec'), [ - 'rps' => round($requests / $duration, 3), - ])); - - $this->out(Text::insert(__d('debug_kit', 'Average request time: :average-time seconds'), [ - 'average-time' => round($duration / $requests, 3), - ])); - - $this->out(Text::insert(__d('debug_kit', 'Standard deviation of average request time: :std-dev'), [ - 'std-dev' => round($this->_deviation($times, true), 3), - ])); - - $this->out(Text::insert(__d('debug_kit', 'Longest/shortest request: :longest sec/:shortest sec'), [ - 'longest' => round(max($times), 3), - 'shortest' => round(min($times), 3), - ])); - - $this->out(""); - } - - /** - * One-pass, numerically stable calculation of population variance. - * - * Donald E. Knuth (1998). - * The Art of Computer Programming, volume 2: Seminumerical Algorithms, 3rd edn., - * p. 232. Boston: Addison-Wesley. - * - * @param array $times Array of values - * @param bool $sample If true, calculates an unbiased estimate of the population - * variance from a finite sample. - * @return float Variance - */ - protected function _variance($times, $sample = true) - { - $n = $mean = $M2 = 0; - - foreach ($times as $time) { - $n += 1; - $delta = $time - $mean; - $mean = $mean + $delta / $n; - $M2 = $M2 + $delta * ($time - $mean); - } - - if ($sample) { - $n -= 1; - } - - return $M2 / $n; - } - - /** - * Calculate the standard deviation. - * - * @param array $times Array of values - * @param bool $sample '' - * @return float Standard deviation - */ - protected function _deviation($times, $sample = true) - { - return sqrt($this->_variance($times, $sample)); - } - - /** - * Get option parser. - * - * @return \Cake\Console\ConsoleOptionParser - */ - public function getOptionParser() - { - $parser = parent::getOptionParser(); - $parser->description(__d( - 'debug_kit', - 'Allows you to obtain some rough benchmarking statistics' . - 'about a fully qualified URL.' - )) - ->addArgument('url', [ - 'help' => __d('debug_kit', 'The URL to request.'), - 'required' => true, - ]) - ->addOption('n', [ - 'default' => 10, - 'help' => __d('debug_kit', 'Number of iterations to perform.'), - ]) - ->addOption('t', [ - 'default' => 100, - 'help' => __d( - 'debug_kit', - 'Maximum total time for all iterations, in seconds.' . - 'If a single iteration takes more than the timeout, only one request will be made' - ), - ]) - ->epilog(__d( - 'debug_kit', - 'Example Use: `cake benchmark --n 10 --t 100 http://localhost/testsite`. ' . - 'Note: this benchmark does not include browser render times.' - )); - - return $parser; - } -} diff --git a/vendor/cakephp/debug_kit/src/Shell/WhitespaceShell.php b/vendor/cakephp/debug_kit/src/Shell/WhitespaceShell.php deleted file mode 100644 index 812a768..0000000 --- a/vendor/cakephp/debug_kit/src/Shell/WhitespaceShell.php +++ /dev/null @@ -1,101 +0,0 @@ -params['path']) && strpos($this->params['path'], '/') === 0) { - $path = $this->params['path']; - } elseif (!empty($this->params['path'])) { - $path .= $this->params['path']; - } - $folder = new Folder($path); - - $r = $folder->findRecursive('.*\.php'); - $this->out("Checking *.php in " . $path); - foreach ($r as $file) { - $c = file_get_contents($file); - if (preg_match('/^[\n\r|\n\r|\n|\r|\s]+\<\?php/', $c)) { - $this->out('!!!contains leading whitespaces: ' . $this->shortPath($file)); - } - if (preg_match('/\?\>[\n\r|\n\r|\n|\r|\s]+$/', $c)) { - $this->out('!!!contains trailing whitespaces: ' . $this->shortPath($file)); - } - } - } - - /** - * Much like main() except files are modified. Be sure to have - * backups or use version control. - * - * @return void - */ - public function trim() - { - $path = APP; - if (!empty($this->params['path']) && strpos($this->params['path'], '/') === 0) { - $path = $this->params['path']; - } elseif (!empty($this->params['path'])) { - $path .= $this->params['path']; - } - $folder = new Folder($path); - - $r = $folder->findRecursive('.*\.php'); - $this->out("Checking *.php in " . $path); - foreach ($r as $file) { - $c = file_get_contents($file); - if (preg_match('/^[\n\r|\n\r|\n|\r|\s]+\<\?php/', $c) || preg_match('/\?\>[\n\r|\n\r|\n|\r|\s]+$/', $c)) { - $this->out('trimming' . $this->shortPath($file)); - $c = preg_replace('/^[\n\r|\n\r|\n|\r|\s]+\<\?php/', '[\n\r|\n\r|\n|\r|\s]+$/', '?>', $c); - file_put_contents($file, $c); - } - } - } - - /** - * get the option parser - * - * @return \Cake\Console\ConsoleOptionParser - */ - public function getOptionParser() - { - $parser = parent::getOptionParser(); - - return $parser->addOption('path', [ - 'short' => 'p', - 'help' => __d('debug_kit', 'Absolute path or relative to {0}.', 'APP'), - ]); - } -} diff --git a/vendor/cakephp/debug_kit/src/Template/Dashboard/index.ctp b/vendor/cakephp/debug_kit/src/Template/Dashboard/index.ctp deleted file mode 100644 index ee3566f..0000000 --- a/vendor/cakephp/debug_kit/src/Template/Dashboard/index.ctp +++ /dev/null @@ -1,26 +0,0 @@ - -

- -

-
    -
  • :
  • - -
  • : Number->format($connection['rows']) ?>
  • - -
- - Form->postLink( - __d('debug_kit', 'Reset database'), - ['_method' => 'POST', 'action' => 'reset'], - ['confirm' => 'Are you sure?'] - ); ?> - - -

Actions

-
    -
  • Html->link(__d('debug_kit', 'Mail Preview'), ['controller' => 'MailPreview']); ?>
  • -
diff --git a/vendor/cakephp/debug_kit/src/Template/Element/cache_panel.ctp b/vendor/cakephp/debug_kit/src/Template/Element/cache_panel.ctp deleted file mode 100644 index 63fceef..0000000 --- a/vendor/cakephp/debug_kit/src/Template/Element/cache_panel.ctp +++ /dev/null @@ -1,80 +0,0 @@ - - -

- - $counters): ?> -
-

- - - - - - - - - - - $val): ?> - - - - - - -
-
- - - - diff --git a/vendor/cakephp/debug_kit/src/Template/Element/deprecations_panel.ctp b/vendor/cakephp/debug_kit/src/Template/Element/deprecations_panel.ctp deleted file mode 100644 index ce90ea2..0000000 --- a/vendor/cakephp/debug_kit/src/Template/Element/deprecations_panel.ctp +++ /dev/null @@ -1,63 +0,0 @@ - -

-
    - -
  • - : -
    - -
  • - -
- - - $pluginData): - $printer($plugin, $pluginData); - endforeach; -endif; - -if (count($cake)): - $printer('cake', $cake); -endif; - -if (count($vendor)): - foreach ($vendor as $vendorSection => $vendorData): - $printer($vendorSection, $vendorData); - endforeach; -endif; - -if (count($other)): - $printer('other', $other); -endif; diff --git a/vendor/cakephp/debug_kit/src/Template/Element/environment_panel.ctp b/vendor/cakephp/debug_kit/src/Template/Element/environment_panel.ctp deleted file mode 100644 index 5ce58d8..0000000 --- a/vendor/cakephp/debug_kit/src/Template/Element/environment_panel.ctp +++ /dev/null @@ -1,153 +0,0 @@ - - -

- - - - - - - - - - - $val): ?> - - - - - - -
- -
- -
- - -

- - - - - - - - - - - $val): ?> - - - - - - -
- -
- -
- - -

- - - - - - - - - - - $val): ?> - - - - - - -
INI VariableValue
Credentials->filter($val) ?>
- -
- -
- - -

- - - - - - - - - - - $val): ?> - - - - - - -
Credentials->filter($val) ?>
- -
- -
- - - -

- - - - - - - - - - - $val): ?> - - - - - - -
- -
- -
- - diff --git a/vendor/cakephp/debug_kit/src/Template/Element/history_panel.ctp b/vendor/cakephp/debug_kit/src/Template/Element/history_panel.ctp deleted file mode 100644 index cf2f657..0000000 --- a/vendor/cakephp/debug_kit/src/Template/Element/history_panel.ctp +++ /dev/null @@ -1,140 +0,0 @@ - -
- -

- -

- - -
- - - - - diff --git a/vendor/cakephp/debug_kit/src/Template/Element/include_panel.ctp b/vendor/cakephp/debug_kit/src/Template/Element/include_panel.ctp deleted file mode 100644 index ff6935d..0000000 --- a/vendor/cakephp/debug_kit/src/Template/Element/include_panel.ctp +++ /dev/null @@ -1,34 +0,0 @@ - -

-Toolbar->makeNeatArray($paths) ?> - -

-Toolbar->makeNeatArray(compact('app', 'cake', 'plugins', 'vendor', 'other')) ?> diff --git a/vendor/cakephp/debug_kit/src/Template/Element/log_panel.ctp b/vendor/cakephp/debug_kit/src/Template/Element/log_panel.ctp deleted file mode 100644 index 3d9e0eb..0000000 --- a/vendor/cakephp/debug_kit/src/Template/Element/log_panel.ctp +++ /dev/null @@ -1,42 +0,0 @@ - -noLogs()): ?> -

- - all() as $logName => $logs): ?> -

- - - - - - - - - - - - - - - -
- - diff --git a/vendor/cakephp/debug_kit/src/Template/Element/mail_panel.ctp b/vendor/cakephp/debug_kit/src/Template/Element/mail_panel.ctp deleted file mode 100644 index 6214908..0000000 --- a/vendor/cakephp/debug_kit/src/Template/Element/mail_panel.ctp +++ /dev/null @@ -1,49 +0,0 @@ -

- Html->link(__d('debug_kit', 'Email previews page'), ['controller' => 'MailPreview', 'action' => 'index'], ['target' => '_blank'])) ?> -

-" . __d('debug_kit', 'No emails were sent during this request') . "

"; - return; - } - $url = $this->Url->build(['controller' => 'MailPreview', 'action' => 'sent', 'panel' => $panel->id, 'id' => 0]); -?> -
-
- - - - - $email) : ?> - - - - -
- - Text->truncate($email['headers']['Subject'])) : - '(No Subject)' - ?> -
-
- -
- diff --git a/vendor/cakephp/debug_kit/src/Template/Element/packages_panel.ctp b/vendor/cakephp/debug_kit/src/Template/Element/packages_panel.ctp deleted file mode 100644 index 33688ef..0000000 --- a/vendor/cakephp/debug_kit/src/Template/Element/packages_panel.ctp +++ /dev/null @@ -1,140 +0,0 @@ - - -
- -
- -
- - -
-
- -
-

- - - - - - - - - - - - - - - - -
- - - -
-
- - -
-

- - - - - - - - - - - - - - - - -
- - - -
-
- - - - diff --git a/vendor/cakephp/debug_kit/src/Template/Element/preview_header.ctp b/vendor/cakephp/debug_kit/src/Template/Element/preview_header.ctp deleted file mode 100644 index f12a943..0000000 --- a/vendor/cakephp/debug_kit/src/Template/Element/preview_header.ctp +++ /dev/null @@ -1,24 +0,0 @@ -
- - - - - - getHeaders() as $name => $header) :?> - - - - - -
View As - getParts()) ?> - Form->control('part', [ - 'type' => 'select', - 'label' => false, - 'value' => $this->request->getQuery('part') ?: 'html', - 'onChange' => 'formatChanged(this);', - 'options' => array_combine($partNames, $partNames), - ]); - ?> -
-
diff --git a/vendor/cakephp/debug_kit/src/Template/Element/request_panel.ctp b/vendor/cakephp/debug_kit/src/Template/Element/request_panel.ctp deleted file mode 100644 index ef090fa..0000000 --- a/vendor/cakephp/debug_kit/src/Template/Element/request_panel.ctp +++ /dev/null @@ -1,65 +0,0 @@ - - -

- ' . __d('debug_kit', 'Headers already sent at file {0} and line {1}.', [$headers['file'], $headers['line']]) . '

' ?> - - -

-Toolbar->makeNeatArray($params) ?> - -

-' . __d('debug_kit', 'No post data.') . '

'; -else: - echo $this->Toolbar->makeNeatArray($data); -endif; -?> - -

Query string

-' . __d('debug_kit', 'No querystring data.') . '

'; -else: - echo $this->Toolbar->makeNeatArray($query); -endif; -?> - -

Cookie

- - Toolbar->makeNeatArray($cookie) ?> - -

- - - -

-

Toolbar->makeNeatArray(['template' => $matchedRoute]) ?>

- diff --git a/vendor/cakephp/debug_kit/src/Template/Element/routes_panel.ctp b/vendor/cakephp/debug_kit/src/Template/Element/routes_panel.ctp deleted file mode 100644 index 3ca4336..0000000 --- a/vendor/cakephp/debug_kit/src/Template/Element/routes_panel.ctp +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - - template): - $class = 'highlighted'; - elseif ($route->defaults['plugin'] === 'DebugKit'): - $class = 'debugkit-route hidden'; - endif; - ?> - - - - - - - -
options, '_name', $route->getName())) ?>template) ?>
defaults, JSON_PRETTY_PRINT) ?>
- - diff --git a/vendor/cakephp/debug_kit/src/Template/Element/session_panel.ctp b/vendor/cakephp/debug_kit/src/Template/Element/session_panel.ctp deleted file mode 100644 index 6490df3..0000000 --- a/vendor/cakephp/debug_kit/src/Template/Element/session_panel.ctp +++ /dev/null @@ -1,20 +0,0 @@ - -Toolbar->makeNeatArray($content); diff --git a/vendor/cakephp/debug_kit/src/Template/Element/sql_log_panel.ctp b/vendor/cakephp/debug_kit/src/Template/Element/sql_log_panel.ctp deleted file mode 100644 index a2b6fdd..0000000 --- a/vendor/cakephp/debug_kit/src/Template/Element/sql_log_panel.ctp +++ /dev/null @@ -1,92 +0,0 @@ - - - -

-

Cake\ORM\Table') ?>

-
    - -
  • - -
-
- - - - - queries(); - if (empty($queries)): - continue; - endif; - - $noOutput = false; - ?> -
-

name()) ?>

-
- totalTime(), - count($queries), - $logger->totalRows() - ); - ?> -
- - - - - - - - - - - - - - - - - - -
-
- - - - -
- diff --git a/vendor/cakephp/debug_kit/src/Template/Element/timer_panel.ctp b/vendor/cakephp/debug_kit/src/Template/Element/timer_panel.ctp deleted file mode 100644 index 76be3fe..0000000 --- a/vendor/cakephp/debug_kit/src/Template/Element/timer_panel.ctp +++ /dev/null @@ -1,101 +0,0 @@ - -
-

-
- - Number->toReadableSize($peakMemory) ?> -
- - - - - - - - - - $value): ?> - - - - - - -
Number->toReadableSize($value) ?>
-
- -
-

-
- - Number->precision($requestTime * 1000, 0) ?> ms -
- - - - - - - - - - - $timeInfo): - $indent = 0; - for ($j = 0; $j < $i; $j++): - if (($values[$j]['end'] > $timeInfo['start']) && ($values[$j]['end']) > ($timeInfo['end'])): - $indent++; - endif; - endfor; - $indent = str_repeat("\xC2\xA0\xC2\xA0", $indent); - ?> - - - - - - -
- - Number->precision($timeInfo['time'] * 1000, 2) ?> - SimpleGraph->bar( - $timeInfo['time'] * 1000, - $timeInfo['start'] * 1000, - [ - 'max' => $maxTime * 1000, - 'requestTime' => $requestTime * 1000, - ] - ) ?> -
-
diff --git a/vendor/cakephp/debug_kit/src/Template/Element/variables_panel.ctp b/vendor/cakephp/debug_kit/src/Template/Element/variables_panel.ctp deleted file mode 100644 index a154234..0000000 --- a/vendor/cakephp/debug_kit/src/Template/Element/variables_panel.ctp +++ /dev/null @@ -1,36 +0,0 @@ -%s

', $error); -endif; - -if (!empty($content)): - printf('', $sort ? ' checked="checked"' : '', __d('debug_kit', 'Sort variables by name')); - $this->Toolbar->setSort($sort); - echo $this->Toolbar->makeNeatArray($content); -endif; - -if (!empty($errors)): - echo '

' . __d('debug_kit', 'Validation errors') . '

'; - echo $this->Toolbar->makeNeatArray($errors); -endif; diff --git a/vendor/cakephp/debug_kit/src/Template/Layout/dashboard.ctp b/vendor/cakephp/debug_kit/src/Template/Layout/dashboard.ctp deleted file mode 100644 index a4fd17b..0000000 --- a/vendor/cakephp/debug_kit/src/Template/Layout/dashboard.ctp +++ /dev/null @@ -1,13 +0,0 @@ -extend('toolbar') ?> - -
- -

- -

- - -
- fetch('content'); ?> -
-
diff --git a/vendor/cakephp/debug_kit/src/Template/Layout/mailer.ctp b/vendor/cakephp/debug_kit/src/Template/Layout/mailer.ctp deleted file mode 100644 index 3d4c7c0..0000000 --- a/vendor/cakephp/debug_kit/src/Template/Layout/mailer.ctp +++ /dev/null @@ -1,13 +0,0 @@ -extend('toolbar') ?> - -
- -

- -

- - -
- fetch('content'); ?> -
-
diff --git a/vendor/cakephp/debug_kit/src/Template/Layout/panel.ctp b/vendor/cakephp/debug_kit/src/Template/Layout/panel.ctp deleted file mode 100644 index a031e55..0000000 --- a/vendor/cakephp/debug_kit/src/Template/Layout/panel.ctp +++ /dev/null @@ -1,6 +0,0 @@ -fetch('content'); diff --git a/vendor/cakephp/debug_kit/src/Template/Layout/toolbar.ctp b/vendor/cakephp/debug_kit/src/Template/Layout/toolbar.ctp deleted file mode 100644 index 35a7fc2..0000000 --- a/vendor/cakephp/debug_kit/src/Template/Layout/toolbar.ctp +++ /dev/null @@ -1,22 +0,0 @@ - - - - - <?= isset($title) ? h($title) : "Debug Kit Toolbar" ?> - Html->css('DebugKit./css/reset') ?> - Html->css('DebugKit./css/toolbar') ?> - - - fetch('content') ?> -
- Html->image('DebugKit./img/cake.icon.png', ['class' => 'indicator'])?> -
- - Html->script('DebugKit./js/jquery') ?> - Html->script('DebugKit./js/toolbar-app') ?> - fetch('script') ?> - diff --git a/vendor/cakephp/debug_kit/src/Template/MailPreview/email.ctp b/vendor/cakephp/debug_kit/src/Template/MailPreview/email.ctp deleted file mode 100644 index 6220896..0000000 --- a/vendor/cakephp/debug_kit/src/Template/MailPreview/email.ctp +++ /dev/null @@ -1,33 +0,0 @@ - - -request->getQuery('part')) : ?> - element('preview_header'); ?> - - - - - -

- - - diff --git a/vendor/cakephp/debug_kit/src/Template/MailPreview/index.ctp b/vendor/cakephp/debug_kit/src/Template/MailPreview/index.ctp deleted file mode 100644 index 995d176..0000000 --- a/vendor/cakephp/debug_kit/src/Template/MailPreview/index.ctp +++ /dev/null @@ -1,90 +0,0 @@ - $previews) : ?> -

- - -

name()) ?>

- - - getEmails() as $email) : ?> - - - - - -
- Html->link($email, [ - 'controller' => 'MailPreview', - 'action' => 'email', - '?' => ['plugin' => $plugin], - $mailPreview->name(), - $email, - ]); - ?> -
- - - -
-

-

⌛

-

-

-

🏃

- -

-

- -
-    to($user->email)
-                    ->subject(sprintf("Welcome %s", $user->name))
-                    ->template("welcome_mail") // ' . __d('debug_kit', 'By default template with same name as method name is used.') . '
-                    ->layout("custom")
-                    ->set(["user" => $user]);
-            }
-        }';
-        highlight_string($code);
-    ?>
-    
-

- -
-    loadModel("Users");
-                $user = $this->Users->find()->first();
-                return $this->getMailer("User")
-                    ->welcome($user)
-                    ->set(["activationToken" => "dummy-token"]);
-            }
-        }';
-        highlight_string($code);
-    ?>
-    
- -

-

-

🙃

-
diff --git a/vendor/cakephp/debug_kit/src/Template/Panels/view.ctp b/vendor/cakephp/debug_kit/src/Template/Panels/view.ctp deleted file mode 100644 index 144a507..0000000 --- a/vendor/cakephp/debug_kit/src/Template/Panels/view.ctp +++ /dev/null @@ -1,10 +0,0 @@ - -

title) ?>

-
- element($panel->element) ?> -
diff --git a/vendor/cakephp/debug_kit/src/Template/Requests/view.ctp b/vendor/cakephp/debug_kit/src/Template/Requests/view.ctp deleted file mode 100644 index 2d6242f..0000000 --- a/vendor/cakephp/debug_kit/src/Template/Requests/view.ctp +++ /dev/null @@ -1,57 +0,0 @@ - -
- × -
- -
-
- -
    - - -
  • -
      - panels as $panel): ?> - - -
    -
  • -
  • - Html->image('DebugKit./img/cake.icon.png', [ - 'alt' => 'Debug Kit', 'title' => 'CakePHP ' . Configure::version() . ' Debug Kit' - ]) ?> -
  • -
-Html->script('DebugKit./js/debug_kit', [ - 'block' => true, - 'id' => '__debug_kit_app', - 'data-id' => $toolbar->id, - 'data-url' => Router::url('/', true), - 'data-webroot' => $this->request->getAttribute("webroot"), -]) ?> diff --git a/vendor/cakephp/debug_kit/src/ToolbarService.php b/vendor/cakephp/debug_kit/src/ToolbarService.php deleted file mode 100644 index 570b885..0000000 --- a/vendor/cakephp/debug_kit/src/ToolbarService.php +++ /dev/null @@ -1,317 +0,0 @@ - [ - 'DebugKit.Cache' => true, - 'DebugKit.Session' => true, - 'DebugKit.Request' => true, - 'DebugKit.SqlLog' => true, - 'DebugKit.Timer' => true, - 'DebugKit.Log' => true, - 'DebugKit.Variables' => true, - 'DebugKit.Environment' => true, - 'DebugKit.Include' => true, - 'DebugKit.History' => true, - 'DebugKit.Routes' => true, - 'DebugKit.Packages' => true, - 'DebugKit.Mail' => true, - 'DebugKit.Deprecations' => true, - ], - 'forceEnable' => false, - 'safeTld' => [], - ]; - - /** - * Constructor - * - * @param \Cake\Event\EventManager $events The event manager to use defaults to the global manager - * @param array $config The configuration data for DebugKit. - */ - public function __construct(EventManager $events, array $config) - { - $this->setConfig($config); - $this->registry = new PanelRegistry($events); - } - - /** - * Fetch the PanelRegistry - * - * @return \DebugKit\Panel\PanelRegistry - */ - public function registry() - { - return $this->registry; - } - - /** - * Check whether or not debug kit is enabled. - * - * @return bool - */ - public function isEnabled() - { - $enabled = (bool)Configure::read('debug'); - - if ($enabled && !$this->isSuspiciouslyProduction()) { - return true; - } - $force = $this->getConfig('forceEnable'); - if (is_callable($force)) { - return $force(); - } - - return $force; - } - - /** - * Returns true if this applications is being executed on a domain with a TLD - * that is commonly associated with a production environment. - * - * @return bool - */ - protected function isSuspiciouslyProduction() - { - $host = explode('.', parse_url('http://' . env('HTTP_HOST'), PHP_URL_HOST)); - $first = current($host); - $isIP = is_numeric(implode('', $host)); - - if (count($host) === 1) { - return false; - } - - if ($isIP && in_array($first, ['192', '10', '127'])) { - // Accessing the app by private IP, this is safe - return false; - } - - $tld = end($host); - $safeTopLevelDomains = ['localhost', 'invalid', 'test', 'example', 'local']; - $safeTopLevelDomains = array_merge($safeTopLevelDomains, (array)$this->getConfig('safeTld')); - - if (!in_array($tld, $safeTopLevelDomains, true) && !$this->getConfig('forceEnable')) { - $host = implode('.', $host); - $safeList = implode(', ', $safeTopLevelDomains); - Log::warning( - "DebugKit is disabling itself as your host `{$host}` " . - "is not in the known safe list of top-level-domains ({$safeList}). " . - "If you would like to force DebugKit on use the `DebugKit.forceEnable` Configure option." - ); - - return true; - } - - return false; - } - - /** - * Get the list of loaded panels - * - * @return array - */ - public function loadedPanels() - { - return $this->registry->loaded(); - } - - /** - * Get the a loaded panel - * - * @param string $name The name of the panel you want to get. - * @return \DebugKit\DebugPanel|null The panel or null. - */ - public function panel($name) - { - return $this->registry->{$name}; - } - - /** - * Load all the panels being used - * - * @return void - */ - public function loadPanels() - { - foreach ($this->getConfig('panels') as $panel => $enabled) { - list($panel, $enabled) = (is_numeric($panel)) ? [$enabled, true] : [$panel, $enabled]; - if ($enabled) { - $this->registry->load($panel); - } - } - } - - /** - * Call the initialize method onl all the loaded panels. - * - * @return void - */ - public function initializePanels() - { - foreach ($this->registry->loaded() as $panel) { - $this->registry->{$panel}->initialize(); - } - } - - /** - * Save the toolbar state. - * - * @param \Cake\Http\ServerRequest $request The request - * @param \Psr\Http\Message\ResponseInterface $response The response - * @return null|\DebugKit\Model\Entity\Request Saved request data. - */ - public function saveData(ServerRequest $request, ResponseInterface $response) - { - // Skip debugkit requests and requestAction() - $path = $request->getUri()->getPath(); - if ( - strpos($path, 'debug_kit') !== false || - strpos($path, 'debug-kit') !== false || - $request->is('requested') - ) { - return null; - } - $data = [ - 'url' => $request->getUri()->getPath(), - 'content_type' => $response->getHeaderLine('Content-Type'), - 'method' => $request->getMethod(), - 'status_code' => $response->getStatusCode(), - 'requested_at' => $request->getEnv('REQUEST_TIME'), - 'panels' => [], - ]; - /* @var \DebugKit\Model\Table\RequestsTable $requests */ - $requests = TableRegistry::get('DebugKit.Requests'); - $requests->gc(); - - $row = $requests->newEntity($data); - $row->isNew(true); - - foreach ($this->registry->loaded() as $name) { - $panel = $this->registry->{$name}; - try { - $content = serialize($panel->data()); - } catch (\Exception $e) { - $content = serialize([ - 'error' => $e->getMessage(), - ]); - } - $row->panels[] = $requests->Panels->newEntity([ - 'panel' => $name, - 'element' => $panel->elementName(), - 'title' => $panel->title(), - 'summary' => $panel->summary(), - 'content' => $content, - ]); - } - - return $requests->save($row); - } - - /** - * Reads the modified date of a file in the webroot, and returns the integer - * - * @return string - */ - public function getToolbarUrl() - { - $url = 'js/toolbar.js'; - $filePaths = [ - str_replace('/', DIRECTORY_SEPARATOR, WWW_ROOT . 'debug_kit/' . $url), - str_replace('/', DIRECTORY_SEPARATOR, CorePlugin::path('DebugKit') . 'webroot/' . $url), - ]; - $url = '/debug_kit/' . $url; - foreach ($filePaths as $filePath) { - if (file_exists($filePath)) { - return $url . '?' . filemtime($filePath); - } - } - - return $url; - } - - /** - * Injects the JS to build the toolbar. - * - * The toolbar will only be injected if the response's content type - * contains HTML and there is a tag. - * - * @param \DebugKit\Model\Entity\Request $row The request data to inject. - * @param \Psr\Http\Message\ResponseInterface $response The response to augment. - * @return \Psr\Http\Message\ResponseInterface The modified response - */ - public function injectScripts($row, ResponseInterface $response) - { - $response = $response->withHeader('X-DEBUGKIT-ID', $row->id); - if (strpos($response->getHeaderLine('Content-Type'), 'html') === false) { - return $response; - } - $body = $response->getBody(); - if (!$body->isSeekable() || !$body->isWritable()) { - return $response; - } - $body->rewind(); - $contents = $body->getContents(); - - $pos = strrpos($contents, ''); - if ($pos === false) { - return $response; - } - - $url = Router::url('/', true); - $script = sprintf( - '', - $row->id, - $url, - Router::url($this->getToolbarUrl()) - ); - $contents = substr($contents, 0, $pos) . $script . substr($contents, $pos); - $body->rewind(); - $body->write($contents); - - return $response->withBody($body); - } -} diff --git a/vendor/cakephp/debug_kit/src/View/AjaxView.php b/vendor/cakephp/debug_kit/src/View/AjaxView.php deleted file mode 100644 index cfc310a..0000000 --- a/vendor/cakephp/debug_kit/src/View/AjaxView.php +++ /dev/null @@ -1,41 +0,0 @@ -response = $this->response->withType('ajax'); - } -} diff --git a/vendor/cakephp/debug_kit/src/View/Helper/CredentialsHelper.php b/vendor/cakephp/debug_kit/src/View/Helper/CredentialsHelper.php deleted file mode 100644 index a2213e6..0000000 --- a/vendor/cakephp/debug_kit/src/View/Helper/CredentialsHelper.php +++ /dev/null @@ -1,68 +0,0 @@ - mysql://******@localhost/my_db - * - * @param string $in variable to filter - * @return string - */ - public function filter($in) - { - $regexp = '/^([^:;]+:\/\/)([^:;]+:?.*?)@(.*)$/i'; - if (!is_string($in) || empty($in)) { - return $in; - } - preg_match_all($regexp, $in, $tokens); - if (empty($tokens[0])) { - return h($in); - } - $protocol = Hash::get($tokens, '1.0'); - $credentials = Hash::get($tokens, '2.0'); - $tail = Hash::get($tokens, '3.0'); - $link = $this->Html->tag('a', '******', [ - 'class' => 'filtered-credentials', - 'title' => h($credentials), - 'onclick' => "this.innerHTML = this.title", - ]); - - return h($protocol) . $link . '@' . h($tail); - } -} diff --git a/vendor/cakephp/debug_kit/src/View/Helper/SimpleGraphHelper.php b/vendor/cakephp/debug_kit/src/View/Helper/SimpleGraphHelper.php deleted file mode 100644 index 11d1ba1..0000000 --- a/vendor/cakephp/debug_kit/src/View/Helper/SimpleGraphHelper.php +++ /dev/null @@ -1,79 +0,0 @@ - (int) Maximum value in the graphs - * - width => (int) - * - valueType => string (value, percentage) - * - style => array - * - * @var array - */ - protected $_defaultSettings = [ - 'max' => 100, - 'width' => 350, - 'valueType' => 'value', - ]; - - /** - * bar method - * - * @param float $value Value to be graphed - * @param int $offset how much indentation - * @param array|\Graph $options Graph options - * @return string Html graph - */ - public function bar($value, $offset, $options = []) - { - $settings = array_merge($this->_defaultSettings, $options); - /* @var int $max */ - /* @var int $width */ - /* @var string $valueType */ - extract($settings); - - $graphValue = ($value / $max) * $width; - $graphValue = max(round($graphValue), 1); - - if ($valueType === 'percentage') { - $graphOffset = 0; - } else { - $graphOffset = ($offset / $max) * $width; - $graphOffset = round($graphOffset); - } - - return sprintf( - '
', - "width: {$width}px", - "margin-left: {$graphOffset}px; width: {$graphValue}px", - __d('debug_kit', "Starting {0}ms into the request, taking {1}ms", $offset, $value) - ); - } -} diff --git a/vendor/cakephp/debug_kit/src/View/Helper/TidyHelper.php b/vendor/cakephp/debug_kit/src/View/Helper/TidyHelper.php deleted file mode 100644 index c8db0f4..0000000 --- a/vendor/cakephp/debug_kit/src/View/Helper/TidyHelper.php +++ /dev/null @@ -1,189 +0,0 @@ -tidyErrors($html, $out); - - if (!$errors) { - return []; - } - $result = ['Error' => [], 'Warning' => [], 'Misc' => []]; - $errors = explode("\n", $errors); - $markup = explode("\n", $out); - foreach ($errors as $error) { - preg_match('@line (\d+) column (\d+) - (\w+): (.*)@', $error, $matches); - if ($matches) { - list($original, $line, $column, $type, $message) = $matches; - $line = $line - 1; - - $string = ''; - if (isset($markup[$line - 1])) { - $string .= h($markup[$line - 1]); - } - // phpcs:ignore - $string .= '' . h(@$markup[$line]) . ''; - if (isset($markup[$line + 1])) { - $string .= h($markup[$line + 1]); - } - $string .= ''; - - $result[$type][$string][] = h($message); - } elseif ($error) { - $message = $error; - $result['Misc'][h($message)][] = h($message); - } - } - $this->results = $result; - - return $result; - } - - /** - * report method - * - * Call process if a string is passed, or no prior results exist - and return the results using - * the toolbar helper to generate a nested navigatable array - * - * @param mixed $html null - * @return string - */ - public function report($html = null) - { - if ($html) { - $this->process($html); - } elseif ($this->results === null) { - $this->process($this->_View->output); - } - if (!$this->results) { - return '

' . __d('debug_kit', 'No markup errors found') . '

'; - } - foreach ($this->results as &$results) { - foreach ($results as $type => &$messages) { - foreach ($messages as &$message) { - $message = html_entity_decode($message, ENT_COMPAT, Configure::read('App.encoding')); - } - } - } - - return $this->Toolbar->makeNeatArray(array_filter($this->results), 0, 0, false); - } - - /** - * Run the html string through tidy, and return the (raw) errors. pass back a reference to the - * normalized string so that the error messages can be linked to the line that caused them. - * - * @param string $in '' - * @param string $out '' - * @return string - */ - public function tidyErrors($in = '', &$out = '') - { - $out = preg_replace('@>\s*<@s', ">\n<", $in); - - // direct access? windows etc - if (function_exists('tidy_parse_string')) { - $tidy = tidy_parse_string($out, [], 'UTF8'); - $tidy->cleanRepair(); - $errors = $tidy->errorBuffer . "\n"; - - return $errors; - } - - // cli - $File = new File(rtrim(TMP, DS) . DS . rand() . '.html', true); - $File->write($out); - $path = $File->pwd(); - $errors = $path . '.err'; - $this->_exec("tidy -eq -utf8 -f $errors $path"); - $File->delete(); - - if (!file_exists($errors)) { - return ''; - } - $Error = new File($errors); - $errors = $Error->read(); - $Error->delete(); - - return $errors; - } - - /** - * exec method - * - * @param mixed $cmd '' - * @param mixed $out null - * @return bool True if successful - */ - protected function _exec($cmd, &$out = null) - { - if (DS === '/') { - $_out = exec($cmd . ' 2>&1', $out, $return); - } else { - $_out = exec($cmd, $out, $return); - } - - if (Configure::read('debug')) { - $source = Debugger::trace(['depth' => 1, 'start' => 2]) . "\n"; - //Log::write('system_calls_' . date('Y-m-d'), "\n" . $source . Debugger::exportVar(compact('cmd','out','return'))); - //Log::write('system_calls', "\n" . $source . Debugger::exportVar(compact('cmd','out','return'))); - } - if ($return) { - return false; - } - - return $_out ? $_out : true; - } -} diff --git a/vendor/cakephp/debug_kit/src/View/Helper/ToolbarHelper.php b/vendor/cakephp/debug_kit/src/View/Helper/ToolbarHelper.php deleted file mode 100644 index cb8cff5..0000000 --- a/vendor/cakephp/debug_kit/src/View/Helper/ToolbarHelper.php +++ /dev/null @@ -1,149 +0,0 @@ -sort = $sort; - } - - /** - * Recursively goes through an array and makes neat HTML out of it. - * - * @param mixed $values Array to make pretty. - * @param int $openDepth Depth to add open class - * @param int $currentDepth current depth. - * @param bool $doubleEncode Whether or not to double encode. - * @param \SplObjectStorage $currentAncestors Object references found down - * the path. - * @return string - */ - public function makeNeatArray($values, $openDepth = 0, $currentDepth = 0, $doubleEncode = false, \SplObjectStorage $currentAncestors = null) - { - if ($currentAncestors === null) { - $ancestors = new \SplObjectStorage(); - } elseif (is_object($values)) { - $ancestors = new \SplObjectStorage(); - $ancestors->addAll($currentAncestors); - $ancestors->attach($values); - } else { - $ancestors = $currentAncestors; - } - $className = "neat-array depth-$currentDepth"; - if ($openDepth > $currentDepth) { - $className .= ' expanded'; - } - $nextDepth = $currentDepth + 1; - $out = "
    "; - if (!is_array($values)) { - if (is_bool($values)) { - $values = [$values]; - } - if ($values === null) { - $values = [null]; - } - if (is_object($values) && method_exists($values, 'toArray')) { - $values = $values->toArray(); - } - } - if (empty($values)) { - $values[] = '(empty)'; - } - if ($this->sort && is_array($values) && $currentDepth === 0) { - ksort($values); - } - foreach ($values as $key => $value) { - $out .= '
  • ' . h($key, $doubleEncode) . ' '; - if (is_array($value) && count($value) > 0) { - $out .= '(array)'; - } elseif (is_object($value)) { - $out .= '(' . (get_class($value) ?: 'object') . ')'; - } - if ($value === null) { - $value = '(null)'; - } - if ($value === false) { - $value = '(false)'; - } - if ($value === true) { - $value = '(true)'; - } - if (empty($value) && $value != 0) { - $value = '(empty)'; - } - if ($value instanceof Closure) { - $value = 'function'; - } - - $isObject = is_object($value); - if ($isObject && $ancestors->contains($value)) { - $isObject = false; - $value = ' - recursion'; - } - - if ( - ( - $value instanceof ArrayAccess || - $value instanceof Iterator || - is_array($value) || - $isObject - ) && !empty($value) - ) { - $out .= $this->makeNeatArray($value, $openDepth, $nextDepth, $doubleEncode, $ancestors); - } else { - $out .= h($value, $doubleEncode); - } - $out .= '
  • '; - } - $out .= '
'; - - return $out; - } -} diff --git a/vendor/cakephp/debug_kit/tests/Fixture/PanelsFixture.php b/vendor/cakephp/debug_kit/tests/Fixture/PanelsFixture.php deleted file mode 100644 index f22f10a..0000000 --- a/vendor/cakephp/debug_kit/tests/Fixture/PanelsFixture.php +++ /dev/null @@ -1,86 +0,0 @@ - ['type' => 'uuid'], - 'request_id' => ['type' => 'uuid', 'null' => false], - 'panel' => ['type' => 'string'], - 'title' => ['type' => 'string'], - 'element' => ['type' => 'string'], - 'summary' => ['type' => 'string'], - 'content' => ['type' => 'binary', 'length' => TableSchema::LENGTH_LONG], - '_constraints' => [ - 'primary' => ['type' => 'primary', 'columns' => ['id']], - 'unique_panel' => ['type' => 'unique', 'columns' => ['request_id', 'panel']], - 'request_id_fk' => [ - 'type' => 'foreign', - 'columns' => ['request_id'], - 'references' => ['requests', 'id'], - ], - ], - ]; - - /** - * Records - * - * @var array - */ - public $records = [ - [ - 'id' => 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa', - 'request_id' => 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa', - 'panel' => 'DebugKit.Request', - 'title' => 'Request', - 'element' => 'DebugKit.request_panel', - 'content' => 'a:5:{s:6:"params";a:5:{s:6:"plugin";N;s:10:"controller";s:5:"Tasks";s:6:"action";s:3:"add";s:4:"_ext";N;s:4:"pass";a:0:{}}s:5:"query";a:0:{}s:4:"data";a:0:{}s:6:"cookie";a:2:{s:14:"toolbarDisplay";s:4:"show";s:7:"CAKEPHP";s:26:"9pk8sa2ot6pclki9f4iakio560";}s:3:"get";a:0:{}}', - ], - ]; - - /** - * Constructor - * - * @param string $connection The connection name to use. - */ - public function __construct($connection = null) - { - if ($connection) { - $this->connection = $connection; - } - $this->init(); - } -} diff --git a/vendor/cakephp/debug_kit/tests/Fixture/RequestsFixture.php b/vendor/cakephp/debug_kit/tests/Fixture/RequestsFixture.php deleted file mode 100644 index 87e8c8d..0000000 --- a/vendor/cakephp/debug_kit/tests/Fixture/RequestsFixture.php +++ /dev/null @@ -1,77 +0,0 @@ - ['type' => 'uuid', 'null' => false], - 'url' => ['type' => 'text', 'null' => false], - 'content_type' => ['type' => 'string'], - 'status_code' => ['type' => 'integer'], - 'method' => ['type' => 'string'], - 'requested_at' => ['type' => 'datetime', 'null' => false], - '_constraints' => [ - 'primary' => ['type' => 'primary', 'columns' => ['id']], - ], - ]; - - /** - * Records - * - * @var array - */ - public $records = [ - [ - 'id' => 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa', - 'url' => '/tasks/add', - 'content_type' => 'text/html', - 'status_code' => 200, - 'requested_at' => '2014-08-21 7:41:12', - ], - ]; - - /** - * Constructor - * - * @param string $connection The connection name to use. - */ - public function __construct($connection = null) - { - if ($connection) { - $this->connection = $connection; - } - $this->init(); - } -} diff --git a/vendor/cakephp/debug_kit/webroot/css/raleway-regular.eot b/vendor/cakephp/debug_kit/webroot/css/raleway-regular.eot deleted file mode 100644 index e1e9878..0000000 Binary files a/vendor/cakephp/debug_kit/webroot/css/raleway-regular.eot and /dev/null differ diff --git a/vendor/cakephp/debug_kit/webroot/css/raleway-regular.svg b/vendor/cakephp/debug_kit/webroot/css/raleway-regular.svg deleted file mode 100644 index 5041bb5..0000000 --- a/vendor/cakephp/debug_kit/webroot/css/raleway-regular.svg +++ /dev/null @@ -1,244 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/vendor/cakephp/debug_kit/webroot/css/raleway-regular.ttf b/vendor/cakephp/debug_kit/webroot/css/raleway-regular.ttf deleted file mode 100644 index 7731965..0000000 Binary files a/vendor/cakephp/debug_kit/webroot/css/raleway-regular.ttf and /dev/null differ diff --git a/vendor/cakephp/debug_kit/webroot/css/raleway-regular.woff b/vendor/cakephp/debug_kit/webroot/css/raleway-regular.woff deleted file mode 100644 index 29fd401..0000000 Binary files a/vendor/cakephp/debug_kit/webroot/css/raleway-regular.woff and /dev/null differ diff --git a/vendor/cakephp/debug_kit/webroot/css/reset.css b/vendor/cakephp/debug_kit/webroot/css/reset.css deleted file mode 100644 index 73614e1..0000000 --- a/vendor/cakephp/debug_kit/webroot/css/reset.css +++ /dev/null @@ -1,47 +0,0 @@ -/* http://meyerweb.com/eric/tools/css/reset/ - v2.0 | 20110126 - License: none (public domain) -*/ -html, body, div, span, applet, object, iframe, -h1, h2, h3, h4, h5, h6, p, blockquote, pre, -a, abbr, acronym, address, big, cite, code, -del, dfn, em, img, ins, kbd, q, s, samp, -small, strike, strong, sub, sup, tt, var, -b, u, i, center, -dl, dt, dd, ol, ul, li, -fieldset, form, label, legend, -table, caption, tbody, tfoot, thead, tr, th, td, -article, aside, canvas, details, embed, -figure, figcaption, footer, header, hgroup, -menu, nav, output, ruby, section, summary, -time, mark, audio, video { - margin: 0; - padding: 0; - border: 0; - font-size: 100%; - font: inherit; - vertical-align: baseline; -} -/* HTML5 display-role reset for older browsers */ -article, aside, details, figcaption, figure, -footer, header, hgroup, menu, nav, section { - display: block; -} -body { - line-height: 1; -} -ol, ul { - list-style: none; -} -blockquote, q { - quotes: none; -} -blockquote:before, blockquote:after, -q:before, q:after { - content: ''; - content: none; -} -table { - border-collapse: collapse; - border-spacing: 0; -} diff --git a/vendor/cakephp/debug_kit/webroot/css/toolbar.css b/vendor/cakephp/debug_kit/webroot/css/toolbar.css deleted file mode 100644 index f113722..0000000 --- a/vendor/cakephp/debug_kit/webroot/css/toolbar.css +++ /dev/null @@ -1,611 +0,0 @@ -@font-face { - font-family: 'CakeFont'; - src: url('./raleway-medium.eot'); - src: url('./raleway-regular.eot?#iefix') format('embedded-opentype'), - url('./raleway-regular.woff') format('woff'), - url('./raleway-regular.ttf') format('truetype'), - url('./raleway-regular.svg#ralewayregular') format('svg'); - font-weight: normal; - font-style: normal; -} - -body { - padding: 0; - margin: 0; - font-family: "Helvetica-Neue", Helvetica, Arial, sans-serif; - overflow: hidden; -} - -/** - * Basic typography - */ -h1, -h2, -h3, -h4 { - font-family: 'CakeFont', sans-serif; - margin: 15px 0; - font-weight: 300; - line-height: 20px; - text-rendering: optimizelegibility; -} -h1, -h2, -h3 { - line-height: 40px; -} -h1 { - font-size: 38.5px; -} -h2 { - font-size: 31.5px; -} -h3 { - font-size: 24.5px; -} -h4 { - font-size: 17.5px; -} -p { - margin-bottom: 10px; -} -strong { - font-weight: bold; -} - -.centered-text { - text-align: center; -} -.right-text { - text-align: right; -} - -.toolbar { - background: #D33C44; - height: 40px; - position: absolute; - bottom: 0; - left: 0; - right: 0; -} -.toolbar.open { - border-radius: 0; - overflow: auto; - padding-right: 40px; -} - -.toolbar-inner { - position: relative; - overflow: hidden; - white-space: nowrap; - display: flex; -} - -.hidden { - display: none; -} - -/* Open close button */ -#panel-button, -.panel { - height: 40px; - line-height: 40px; - text-align: center; - cursor: pointer; - float: left; -} -#panel-button { - line-height: 20px; - height: 40px; - width: 40px; - position: absolute; - right: 0; - bottom: 0; -} -#panel-button img { - margin: 0; - display: block; -} -.panel { - border-left: 1px solid rgba(0, 0, 0, 0.075); - padding: 0px 9px; - position: relative; -} -.panel:first-child { - border-left: 0; -} -.panel-active { - background: #fff; - color: #D33C44; - transition: background-color 300ms linear; -} -.panel-active .panel-button { - color: #D33C44; -} - -.panel-button { - color: #fff; - font-family: CakeFont, Helvetica, Arial, sans-serif; -} -.panel-summary { - background: rgba(60, 60, 60, 0.3); - color: #fff; - font-size: 12px; - line-height: 20px; - padding: 4px; - border-radius: 4px; - vertical-align: middle; -} - -.panel-button-left { - padding-left: 0; -} -.panel-button-right { - padding-right: 0; - border-right: 1px solid rgba(0, 0, 0, 0.075); -} - -.history-mode .panel-active .panel-button { - color: #ab47bc; -} - -/** - * Panel layout - */ -#panel-content-container { - background: #fff; - position: absolute; - top: 100%; - bottom: 40px; - left: 0; - right: 0; - overflow-y: auto; - transition: top 0.25s ease-out; -} - -#panel-content-container.enabled { - top: 0; - transition: top 0.25s ease-out-expo; -} - -@keyframes slideup { - from { - top: 100%; - } - to { - top: 0%; - } -} - -.panel-title { - color: #fff; - font-family: CakeFont, sans-serif; - font-weight: normal; - background: #D33C44; - padding: 10px; - margin: 0; - transition: background-color 300ms linear; -} -.history-mode .panel-title { - background: #ab47bc; -} -.panel-content { - padding: 10px; -} - -.button-close { - position: absolute; - top: 15px; - right: 15px; - background: rgba(0, 0, 0, 0.3); - color: #fff; - display: inline-block; - padding: 8px; - line-height: 12px; - font-size: 20px; - height: 12px; - width: 12px; - border-radius: 15px; - -moz-border-radius: 15px; - -webkit-border-radius: 15px; - vertical-align: middle; - cursor: pointer; -} -.button-close:hover { - background: rgba(0, 0, 0, 0.5); -} - -.section-tile { - box-sizing: border-box; - float: left; - width: 50%; - padding: 10px; -} - - -/** - * Tables - */ -table { - width: 100%; - border: 0; - clear: both; - margin: 10px 0; - border-spacing: 0; -} -table td, -table th { - text-align: left; - border: 0; - padding: 9px; - margin: 0; -} -table td { - border-bottom: 1px solid #ccc; -} -table th { - border-bottom: 3px solid #2a6496; - color: #111; - font-weight: bold; - line-height: 16px; -} - -pre, -.debug-table td { - font-family: Monaco, Consolas, mono-space; -} - -/* X column tables have the 2nd+ cell right aligned */ -.debug-table th:nth-child(n+2), -.debug-table td:nth-child(n+2) { - text-align:right; -} -.debug-table td:nth-child(n+2) { - word-wrap: break-word; - word-break: break-all; - word-break: break-word; /* Not standard for webkit */ -} -.debug-table th.left, -.debug-table td.left { - text-align: left; -} -.debug-table .highlighted td { - background: #e7e9fd; -} - -.list { - list-style: disc; - margin: 10px 0 10px 20px; -} -.list li { - margin: 10px 0; -} -.deprecation-list li { - font-family: Monaco, Consolas, mono-space; -} - -/** - * Neat Array styles - */ -.neat-array, -.neat-array li { - list-style:none; - list-style-image:none; -} -.neat-array { - padding: 1px 2px 1px 20px; - background: #eaeae7; - list-style: none; - margin: 0 0 1em 0; -} -.neat-array .neat-array { - padding: 0 0 0 20px; - margin: 0; - border-top: 1px solid #eaeae7; -} -.neat-array li { - border-top: 1px solid #eaeae7; - border-bottom: 1px solid #eaeae7; - background: rgba(255, 255, 255, 0.95); - margin: 0; - line-height: 1.5em; -} -.neat-array li:hover { - background: #fff; -} -.neat-array li strong { - padding-left: 8px; - font-weight: bold; -} -.neat-array li > strong:before { - position: relative; - left: -3px; - content: "\2003 "; -} - -/* expandable sections */ -.neat-array li.expandable { - cursor: pointer; -} -.neat-array .expanded { - border-bottom:0; -} -.neat-array li.expandable.expanded > strong:before { - position: relative; - left: -3px; - content: "\2937 "; -} -.neat-array li.expandable.collapsed > strong:before, -.neat-array li.expandable.expanded .expandable.collapsed > strong:before { - position: relative; - left: -3px; - content: "\2192 "; -} -.neat-array li { - cursor: default; -} - -.toggle-checkbox { - display: block; - margin-bottom: 10px; - font-size: 12px; - color: #666; -} -.toggle-checkbox input[type=checkbox] { - vertical-align: middle; - margin-top: 0; -} - - -/** - * Graph table. - */ -.graph-bar, -.graph-bar-value { - margin: 0; - padding: 0; - border: none; - overflow: hidden; - height: 14px; -} -.graph-bar { - background: #ddd; -} -.graph-bar-value { - background: #428bca; -} - - -/** - * History panel - */ -.history-list li { - padding-left: 10px; - border-bottom: 1px solid #ccc; - position: relative; -} -.history-list .active:before { - content: "\2022 "; - font-size: 40px; - color: #42bd41; - line-height: 12px; - position: absolute; - top: 38%; - left: 0; - vertical-align: middle; -} -.history-list li:last-child { - border-bottom: 0; -} -.history-list li:hover { - background-color: #e7e9fd; -} - -.history-link { - color: #222; - display: block; - text-decoration: none; - padding: 6px; -} - -.history-bubble { - font-size: 12px; - line-height: 14px; - display: inline-block; - background: #eee; - padding: 2px; - border-radius: 4px; -} - -.xhr { - background:#7CFF46 -} -.history-time { - font-size: 12px; - display: block; -} -.history-url { - font-size: 14px; - font-family: Monaco, Consolas, mono-space; -} - -/** - * Packages panel - */ -.package-version { - background: #D33C44; - border-radius: 4px; - line-height: 20px; - display: inline-block; - white-space: nowrap; -} - -.package-link { - color: #000000; - text-decoration: none; -} - -/** - * Warnings and info boxes. - */ -.warning, -.info { - padding: 10px 10px 10px 20px; - font-size: 14px; -} - -.warning { - background: #f2dede; -} - -.info { - background: #d9edf7; -} -.warning:before, -.info:before { - padding: 8px; - line-height: 12px; - font-size: 20px; - font-family: "CakeFont"; - font-weight: bold; - height: 12px; - width: 12px; - border-radius: 15px; - -moz-border-radius: 15px; - -webkit-border-radius: 15px; - text-align: center; - vertical-align: middle; - display: inline-block; - position: relative; - left: -11px; - - background-color: #fff; -} - -.warning:before { - color: #f2dede; - content: '!'; -} -.info:before { - color: #d9edf7; - content: 'i'; -} - -/** - * Buttons - */ -.btn-primary { - font-size: 14px; - border: 1px solid #2a6496; - background-color: #428bca; - color: #fff; - border-radius: 4px; - box-shadow: 0 2px 0 #2a6496; - padding: 4px 10px; -} -.btn-primary:active { - box-shadow: none; - position: relative; - top: 2px; -} - -.btn-primary:hover { - cursor:pointer; -} - -#loader { - background: rgba(255, 255, 255, 0.7); - position: absolute; - top: 0; - bottom: 40px; - left: 0; - right: 0; - overflow: hidden; - z-index: 100; - display: none; - opacity: 0; - transition: opacity 0.5s ease-in; -} - -#loader.loading { - display: block; - opacity: 1; -} - -#loader .indicator { - width: 30px; - height: 30px; - position: absolute; - top: 50%; - left: 50%; - margin: -15px 0 0 -15px; - -webkit-animation: spin 4s linear infinite; - -moz-animation: spin 4s linear infinite; - animation: spin 4s linear infinite; -} - -@-moz-keyframes spin { - 100% { - -moz-transform: rotate(360deg); - } -} - -@-webkit-keyframes spin { - 100% { - -webkit-transform: rotate(360deg); - } -} - -@keyframes spin { - 100% { - -webkit-transform: rotate(360deg); - transform: rotate(360deg); - } -} - -.panel-content .filtered-credentials { - text-decoration: underline; - cursor: pointer; -} - -.terminal { - margin: 20px 0; - padding: 20px; - background-color: #1a1a1a; - color: #ffffff; - line-height: 1.4; - display: none; -} - -.terminal .section-header { - color: #428bca; -} - -.terminal .section-header:nth-of-type(1) { - margin-top: 0; -} - -.terminal highlight { - color: #D33C44; -} - -.terminal .loading { - margin: 0; -} - -.terminal .indicator { - vertical-align: middle; - width: 30px; - height: 30px; - -webkit-animation: spin 4s linear infinite; - -moz-animation: spin 4s linear infinite; - animation: spin 4s linear infinite; -} - -.terminal .warning-message { - color: #ffcc00; -} - -.terminal .success-message { - color: #42bd41; -} diff --git a/vendor/cakephp/debug_kit/webroot/img/cake.icon.png b/vendor/cakephp/debug_kit/webroot/img/cake.icon.png deleted file mode 100644 index 26ba47e..0000000 Binary files a/vendor/cakephp/debug_kit/webroot/img/cake.icon.png and /dev/null differ diff --git a/vendor/cakephp/debug_kit/webroot/js/debug_kit.js b/vendor/cakephp/debug_kit/webroot/js/debug_kit.js deleted file mode 100644 index 7e69952..0000000 --- a/vendor/cakephp/debug_kit/webroot/js/debug_kit.js +++ /dev/null @@ -1,25 +0,0 @@ -var baseUrl, toolbar; - -var elem = document.getElementById('__debug_kit_app'); -if (elem) { - window.__debugKitId = elem.getAttribute('data-id'); - window.__debugKitBaseUrl = elem.getAttribute('data-url'); - window.__debugKitWebroot = elem.getAttribute('data-webroot'); - elem = null; -} - -$(document).ready(function() { - toolbar = new Toolbar({ - toolbar: $('#toolbar'), - content: $('#panel-content-container'), - panelButtons: $('.panel'), - panelClose: $('#panel-close'), - keyboardScope : $(document), - currentRequest: __debugKitId, - originalRequest: __debugKitId, - baseUrl: __debugKitBaseUrl, - webroot: __debugKitWebroot, - }); - - toolbar.initialize(); -}); diff --git a/vendor/cakephp/debug_kit/webroot/js/jquery.js b/vendor/cakephp/debug_kit/webroot/js/jquery.js deleted file mode 100644 index 73f33fb..0000000 --- a/vendor/cakephp/debug_kit/webroot/js/jquery.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery v1.11.0 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */ -!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k="".trim,l={},m="1.11.0",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return n.each(this,a,b)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(n.isPlainObject(c)||(b=n.isArray(c)))?(b?(b=!1,f=a&&n.isArray(a)?a:[]):f=a&&n.isPlainObject(a)?a:{},g[d]=n.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray||function(a){return"array"===n.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return a-parseFloat(a)>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==n.type(a)||a.nodeType||n.isWindow(a))return!1;try{if(a.constructor&&!j.call(a,"constructor")&&!j.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(l.ownLast)for(b in a)return j.call(a,b);for(b in a);return void 0===b||j.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(b){b&&n.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=s(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:k&&!k.call("\ufeff\xa0")?function(a){return null==a?"":k.call(a)}:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(g)return g.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=s(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(f=a[b],b=a,a=f),n.isFunction(a)?(c=d.call(arguments,2),e=function(){return a.apply(b||this,c.concat(d.call(arguments)))},e.guid=a.guid=a.guid||n.guid++,e):void 0},now:function(){return+new Date},support:l}),n.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s="sizzle"+-new Date,t=a.document,u=0,v=0,w=eb(),x=eb(),y=eb(),z=function(a,b){return a===b&&(j=!0),0},A="undefined",B=1<<31,C={}.hasOwnProperty,D=[],E=D.pop,F=D.push,G=D.push,H=D.slice,I=D.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},J="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",K="[\\x20\\t\\r\\n\\f]",L="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",M=L.replace("w","w#"),N="\\["+K+"*("+L+")"+K+"*(?:([*^$|!~]?=)"+K+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+M+")|)|)"+K+"*\\]",O=":("+L+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+N.replace(3,8)+")*)|.*)\\)|)",P=new RegExp("^"+K+"+|((?:^|[^\\\\])(?:\\\\.)*)"+K+"+$","g"),Q=new RegExp("^"+K+"*,"+K+"*"),R=new RegExp("^"+K+"*([>+~]|"+K+")"+K+"*"),S=new RegExp("="+K+"*([^\\]'\"]*?)"+K+"*\\]","g"),T=new RegExp(O),U=new RegExp("^"+M+"$"),V={ID:new RegExp("^#("+L+")"),CLASS:new RegExp("^\\.("+L+")"),TAG:new RegExp("^("+L.replace("w","w*")+")"),ATTR:new RegExp("^"+N),PSEUDO:new RegExp("^"+O),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+K+"*(even|odd|(([+-]|)(\\d*)n|)"+K+"*(?:([+-]|)"+K+"*(\\d+)|))"+K+"*\\)|)","i"),bool:new RegExp("^(?:"+J+")$","i"),needsContext:new RegExp("^"+K+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+K+"*((?:-\\d)?\\d*)"+K+"*\\)|)(?=[^-]|$)","i")},W=/^(?:input|select|textarea|button)$/i,X=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,$=/[+~]/,_=/'|\\/g,ab=new RegExp("\\\\([\\da-f]{1,6}"+K+"?|("+K+")|.)","ig"),bb=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)};try{G.apply(D=H.call(t.childNodes),t.childNodes),D[t.childNodes.length].nodeType}catch(cb){G={apply:D.length?function(a,b){F.apply(a,H.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function db(a,b,d,e){var f,g,h,i,j,m,p,q,u,v;if((b?b.ownerDocument||b:t)!==l&&k(b),b=b||l,d=d||[],!a||"string"!=typeof a)return d;if(1!==(i=b.nodeType)&&9!==i)return[];if(n&&!e){if(f=Z.exec(a))if(h=f[1]){if(9===i){if(g=b.getElementById(h),!g||!g.parentNode)return d;if(g.id===h)return d.push(g),d}else if(b.ownerDocument&&(g=b.ownerDocument.getElementById(h))&&r(b,g)&&g.id===h)return d.push(g),d}else{if(f[2])return G.apply(d,b.getElementsByTagName(a)),d;if((h=f[3])&&c.getElementsByClassName&&b.getElementsByClassName)return G.apply(d,b.getElementsByClassName(h)),d}if(c.qsa&&(!o||!o.test(a))){if(q=p=s,u=b,v=9===i&&a,1===i&&"object"!==b.nodeName.toLowerCase()){m=ob(a),(p=b.getAttribute("id"))?q=p.replace(_,"\\$&"):b.setAttribute("id",q),q="[id='"+q+"'] ",j=m.length;while(j--)m[j]=q+pb(m[j]);u=$.test(a)&&mb(b.parentNode)||b,v=m.join(",")}if(v)try{return G.apply(d,u.querySelectorAll(v)),d}catch(w){}finally{p||b.removeAttribute("id")}}}return xb(a.replace(P,"$1"),b,d,e)}function eb(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function fb(a){return a[s]=!0,a}function gb(a){var b=l.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function hb(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function ib(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||B)-(~a.sourceIndex||B);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function jb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function kb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function lb(a){return fb(function(b){return b=+b,fb(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function mb(a){return a&&typeof a.getElementsByTagName!==A&&a}c=db.support={},f=db.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},k=db.setDocument=function(a){var b,e=a?a.ownerDocument||a:t,g=e.defaultView;return e!==l&&9===e.nodeType&&e.documentElement?(l=e,m=e.documentElement,n=!f(e),g&&g!==g.top&&(g.addEventListener?g.addEventListener("unload",function(){k()},!1):g.attachEvent&&g.attachEvent("onunload",function(){k()})),c.attributes=gb(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=gb(function(a){return a.appendChild(e.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Y.test(e.getElementsByClassName)&&gb(function(a){return a.innerHTML="
",a.firstChild.className="i",2===a.getElementsByClassName("i").length}),c.getById=gb(function(a){return m.appendChild(a).id=s,!e.getElementsByName||!e.getElementsByName(s).length}),c.getById?(d.find.ID=function(a,b){if(typeof b.getElementById!==A&&n){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ab,bb);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ab,bb);return function(a){var c=typeof a.getAttributeNode!==A&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return typeof b.getElementsByTagName!==A?b.getElementsByTagName(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return typeof b.getElementsByClassName!==A&&n?b.getElementsByClassName(a):void 0},p=[],o=[],(c.qsa=Y.test(e.querySelectorAll))&&(gb(function(a){a.innerHTML="",a.querySelectorAll("[t^='']").length&&o.push("[*^$]="+K+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||o.push("\\["+K+"*(?:value|"+J+")"),a.querySelectorAll(":checked").length||o.push(":checked")}),gb(function(a){var b=e.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&o.push("name"+K+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||o.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),o.push(",.*:")})),(c.matchesSelector=Y.test(q=m.webkitMatchesSelector||m.mozMatchesSelector||m.oMatchesSelector||m.msMatchesSelector))&&gb(function(a){c.disconnectedMatch=q.call(a,"div"),q.call(a,"[s!='']:x"),p.push("!=",O)}),o=o.length&&new RegExp(o.join("|")),p=p.length&&new RegExp(p.join("|")),b=Y.test(m.compareDocumentPosition),r=b||Y.test(m.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},z=b?function(a,b){if(a===b)return j=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===e||a.ownerDocument===t&&r(t,a)?-1:b===e||b.ownerDocument===t&&r(t,b)?1:i?I.call(i,a)-I.call(i,b):0:4&d?-1:1)}:function(a,b){if(a===b)return j=!0,0;var c,d=0,f=a.parentNode,g=b.parentNode,h=[a],k=[b];if(!f||!g)return a===e?-1:b===e?1:f?-1:g?1:i?I.call(i,a)-I.call(i,b):0;if(f===g)return ib(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)k.unshift(c);while(h[d]===k[d])d++;return d?ib(h[d],k[d]):h[d]===t?-1:k[d]===t?1:0},e):l},db.matches=function(a,b){return db(a,null,null,b)},db.matchesSelector=function(a,b){if((a.ownerDocument||a)!==l&&k(a),b=b.replace(S,"='$1']"),!(!c.matchesSelector||!n||p&&p.test(b)||o&&o.test(b)))try{var d=q.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return db(b,l,null,[a]).length>0},db.contains=function(a,b){return(a.ownerDocument||a)!==l&&k(a),r(a,b)},db.attr=function(a,b){(a.ownerDocument||a)!==l&&k(a);var e=d.attrHandle[b.toLowerCase()],f=e&&C.call(d.attrHandle,b.toLowerCase())?e(a,b,!n):void 0;return void 0!==f?f:c.attributes||!n?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},db.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},db.uniqueSort=function(a){var b,d=[],e=0,f=0;if(j=!c.detectDuplicates,i=!c.sortStable&&a.slice(0),a.sort(z),j){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return i=null,a},e=db.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=db.selectors={cacheLength:50,createPseudo:fb,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ab,bb),a[3]=(a[4]||a[5]||"").replace(ab,bb),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||db.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&db.error(a[0]),a},PSEUDO:function(a){var b,c=!a[5]&&a[2];return V.CHILD.test(a[0])?null:(a[3]&&void 0!==a[4]?a[2]=a[4]:c&&T.test(c)&&(b=ob(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ab,bb).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=w[a+" "];return b||(b=new RegExp("(^|"+K+")"+a+"("+K+"|$)"))&&w(a,function(a){return b.test("string"==typeof a.className&&a.className||typeof a.getAttribute!==A&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=db.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),t=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&t){k=q[s]||(q[s]={}),j=k[a]||[],n=j[0]===u&&j[1],m=j[0]===u&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[u,n,m];break}}else if(t&&(j=(b[s]||(b[s]={}))[a])&&j[0]===u)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(t&&((l[s]||(l[s]={}))[a]=[u,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||db.error("unsupported pseudo: "+a);return e[s]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?fb(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=I.call(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:fb(function(a){var b=[],c=[],d=g(a.replace(P,"$1"));return d[s]?fb(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:fb(function(a){return function(b){return db(a,b).length>0}}),contains:fb(function(a){return function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:fb(function(a){return U.test(a||"")||db.error("unsupported lang: "+a),a=a.replace(ab,bb).toLowerCase(),function(b){var c;do if(c=n?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===m},focus:function(a){return a===l.activeElement&&(!l.hasFocus||l.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return X.test(a.nodeName)},input:function(a){return W.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:lb(function(){return[0]}),last:lb(function(a,b){return[b-1]}),eq:lb(function(a,b,c){return[0>c?c+b:c]}),even:lb(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:lb(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:lb(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:lb(function(a,b,c){for(var d=0>c?c+b:c;++db;b++)d+=a[b].value;return d}function qb(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=v++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[u,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[s]||(b[s]={}),(h=i[d])&&h[0]===u&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function rb(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function sb(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function tb(a,b,c,d,e,f){return d&&!d[s]&&(d=tb(d)),e&&!e[s]&&(e=tb(e,f)),fb(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||wb(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:sb(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=sb(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?I.call(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=sb(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):G.apply(g,r)})}function ub(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],i=g||d.relative[" "],j=g?1:0,k=qb(function(a){return a===b},i,!0),l=qb(function(a){return I.call(b,a)>-1},i,!0),m=[function(a,c,d){return!g&&(d||c!==h)||((b=c).nodeType?k(a,c,d):l(a,c,d))}];f>j;j++)if(c=d.relative[a[j].type])m=[qb(rb(m),c)];else{if(c=d.filter[a[j].type].apply(null,a[j].matches),c[s]){for(e=++j;f>e;e++)if(d.relative[a[e].type])break;return tb(j>1&&rb(m),j>1&&pb(a.slice(0,j-1).concat({value:" "===a[j-2].type?"*":""})).replace(P,"$1"),c,e>j&&ub(a.slice(j,e)),f>e&&ub(a=a.slice(e)),f>e&&pb(a))}m.push(c)}return rb(m)}function vb(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,i,j,k){var m,n,o,p=0,q="0",r=f&&[],s=[],t=h,v=f||e&&d.find.TAG("*",k),w=u+=null==t?1:Math.random()||.1,x=v.length;for(k&&(h=g!==l&&g);q!==x&&null!=(m=v[q]);q++){if(e&&m){n=0;while(o=a[n++])if(o(m,g,i)){j.push(m);break}k&&(u=w)}c&&((m=!o&&m)&&p--,f&&r.push(m))}if(p+=q,c&&q!==p){n=0;while(o=b[n++])o(r,s,g,i);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=E.call(j));s=sb(s)}G.apply(j,s),k&&!f&&s.length>0&&p+b.length>1&&db.uniqueSort(j)}return k&&(u=w,h=t),r};return c?fb(f):f}g=db.compile=function(a,b){var c,d=[],e=[],f=y[a+" "];if(!f){b||(b=ob(a)),c=b.length;while(c--)f=ub(b[c]),f[s]?d.push(f):e.push(f);f=y(a,vb(e,d))}return f};function wb(a,b,c){for(var d=0,e=b.length;e>d;d++)db(a,b[d],c);return c}function xb(a,b,e,f){var h,i,j,k,l,m=ob(a);if(!f&&1===m.length){if(i=m[0]=m[0].slice(0),i.length>2&&"ID"===(j=i[0]).type&&c.getById&&9===b.nodeType&&n&&d.relative[i[1].type]){if(b=(d.find.ID(j.matches[0].replace(ab,bb),b)||[])[0],!b)return e;a=a.slice(i.shift().value.length)}h=V.needsContext.test(a)?0:i.length;while(h--){if(j=i[h],d.relative[k=j.type])break;if((l=d.find[k])&&(f=l(j.matches[0].replace(ab,bb),$.test(i[0].type)&&mb(b.parentNode)||b))){if(i.splice(h,1),a=f.length&&pb(i),!a)return G.apply(e,f),e;break}}}return g(a,m)(f,b,!n,e,$.test(a)&&mb(b.parentNode)||b),e}return c.sortStable=s.split("").sort(z).join("")===s,c.detectDuplicates=!!j,k(),c.sortDetached=gb(function(a){return 1&a.compareDocumentPosition(l.createElement("div"))}),gb(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||hb("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&gb(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||hb("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),gb(function(a){return null==a.getAttribute("disabled")})||hb(J,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),db}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=n.expr.match.needsContext,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^.[^:#\[\.,]*$/;function x(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(w.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return n.inArray(a,b)>=0!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;e>b;b++)if(n.contains(d[b],this))return!0}));for(b=0;e>b;b++)n.find(a,d[b],c);return c=this.pushStack(e>1?n.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(x(this,a||[],!1))},not:function(a){return this.pushStack(x(this,a||[],!0))},is:function(a){return!!x(this,"string"==typeof a&&u.test(a)?n(a):a||[],!1).length}});var y,z=a.document,A=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,B=n.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:A.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||y).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:z,!0)),v.test(c[1])&&n.isPlainObject(b))for(c in b)n.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}if(d=z.getElementById(c[2]),d&&d.parentNode){if(d.id!==c[2])return y.find(a);this.length=1,this[0]=d}return this.context=z,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof y.ready?y.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};B.prototype=n.fn,y=n(z);var C=/^(?:parents|prev(?:Until|All))/,D={children:!0,contents:!0,next:!0,prev:!0};n.extend({dir:function(a,b,c){var d=[],e=a[b];while(e&&9!==e.nodeType&&(void 0===c||1!==e.nodeType||!n(e).is(c)))1===e.nodeType&&d.push(e),e=e[b];return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),n.fn.extend({has:function(a){var b,c=n(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(n.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=u.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.unique(f):f)},index:function(a){return a?"string"==typeof a?n.inArray(this[0],n(a)):n.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.unique(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function E(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return n.dir(a,"parentNode")},parentsUntil:function(a,b,c){return n.dir(a,"parentNode",c)},next:function(a){return E(a,"nextSibling")},prev:function(a){return E(a,"previousSibling")},nextAll:function(a){return n.dir(a,"nextSibling")},prevAll:function(a){return n.dir(a,"previousSibling")},nextUntil:function(a,b,c){return n.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return n.dir(a,"previousSibling",c)},siblings:function(a){return n.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return n.sibling(a.firstChild)},contents:function(a){return n.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(D[a]||(e=n.unique(e)),C.test(a)&&(e=e.reverse())),this.pushStack(e)}});var F=/\S+/g,G={};function H(a){var b=G[a]={};return n.each(a.match(F)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?G[a]||H(a):n.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(c=a.memory&&l,d=!0,f=g||0,g=0,e=h.length,b=!0;h&&e>f;f++)if(h[f].apply(l[0],l[1])===!1&&a.stopOnFalse){c=!1;break}b=!1,h&&(i?i.length&&j(i.shift()):c?h=[]:k.disable())},k={add:function(){if(h){var d=h.length;!function f(b){n.each(b,function(b,c){var d=n.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&f(c)})}(arguments),b?e=h.length:c&&(g=d,j(c))}return this},remove:function(){return h&&n.each(arguments,function(a,c){var d;while((d=n.inArray(c,h,d))>-1)h.splice(d,1),b&&(e>=d&&e--,f>=d&&f--)}),this},has:function(a){return a?n.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],e=0,this},disable:function(){return h=i=c=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,c||k.disable(),this},locked:function(){return!i},fireWith:function(a,c){return!h||d&&!i||(c=c||[],c=[a,c.slice?c.slice():c],b?i.push(c):j(c)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!d}};return k},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&n.isFunction(a.promise)?e:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var I;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){if(a===!0?!--n.readyWait:!n.isReady){if(!z.body)return setTimeout(n.ready);n.isReady=!0,a!==!0&&--n.readyWait>0||(I.resolveWith(z,[n]),n.fn.trigger&&n(z).trigger("ready").off("ready"))}}});function J(){z.addEventListener?(z.removeEventListener("DOMContentLoaded",K,!1),a.removeEventListener("load",K,!1)):(z.detachEvent("onreadystatechange",K),a.detachEvent("onload",K))}function K(){(z.addEventListener||"load"===event.type||"complete"===z.readyState)&&(J(),n.ready())}n.ready.promise=function(b){if(!I)if(I=n.Deferred(),"complete"===z.readyState)setTimeout(n.ready);else if(z.addEventListener)z.addEventListener("DOMContentLoaded",K,!1),a.addEventListener("load",K,!1);else{z.attachEvent("onreadystatechange",K),a.attachEvent("onload",K);var c=!1;try{c=null==a.frameElement&&z.documentElement}catch(d){}c&&c.doScroll&&!function e(){if(!n.isReady){try{c.doScroll("left")}catch(a){return setTimeout(e,50)}J(),n.ready()}}()}return I.promise(b)};var L="undefined",M;for(M in n(l))break;l.ownLast="0"!==M,l.inlineBlockNeedsLayout=!1,n(function(){var a,b,c=z.getElementsByTagName("body")[0];c&&(a=z.createElement("div"),a.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",b=z.createElement("div"),c.appendChild(a).appendChild(b),typeof b.style.zoom!==L&&(b.style.cssText="border:0;margin:0;width:1px;padding:1px;display:inline;zoom:1",(l.inlineBlockNeedsLayout=3===b.offsetWidth)&&(c.style.zoom=1)),c.removeChild(a),a=b=null)}),function(){var a=z.createElement("div");if(null==l.deleteExpando){l.deleteExpando=!0;try{delete a.test}catch(b){l.deleteExpando=!1}}a=null}(),n.acceptData=function(a){var b=n.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b};var N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(O,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}n.data(a,b,c)}else c=void 0}return c}function Q(a){var b;for(b in a)if(("data"!==b||!n.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;return!0}function R(a,b,d,e){if(n.acceptData(a)){var f,g,h=n.expando,i=a.nodeType,j=i?n.cache:a,k=i?a[h]:a[h]&&h;if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||n.guid++:h),j[k]||(j[k]=i?{}:{toJSON:n.noop}),("object"==typeof b||"function"==typeof b)&&(e?j[k]=n.extend(j[k],b):j[k].data=n.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[n.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[n.camelCase(b)])):f=g,f -}}function S(a,b,c){if(n.acceptData(a)){var d,e,f=a.nodeType,g=f?n.cache:a,h=f?a[n.expando]:n.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){n.isArray(b)?b=b.concat(n.map(b,n.camelCase)):b in d?b=[b]:(b=n.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!Q(d):!n.isEmptyObject(d))return}(c||(delete g[h].data,Q(g[h])))&&(f?n.cleanData([a],!0):l.deleteExpando||g!=g.window?delete g[h]:g[h]=null)}}}n.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?n.cache[a[n.expando]]:a[n.expando],!!a&&!Q(a)},data:function(a,b,c){return R(a,b,c)},removeData:function(a,b){return S(a,b)},_data:function(a,b,c){return R(a,b,c,!0)},_removeData:function(a,b){return S(a,b,!0)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=n.data(f),1===f.nodeType&&!n._data(f,"parsedAttrs"))){c=g.length;while(c--)d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d]));n._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){n.data(this,a)}):arguments.length>1?this.each(function(){n.data(this,a,b)}):f?P(f,a,n.data(f,a)):void 0},removeData:function(a){return this.each(function(){n.removeData(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=n._data(a,b),c&&(!d||n.isArray(c)?d=n._data(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return n._data(a,c)||n._data(a,c,{empty:n.Callbacks("once memory").add(function(){n._removeData(a,b+"queue"),n._removeData(a,c)})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.lengthh;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},X=/^(?:checkbox|radio)$/i;!function(){var a=z.createDocumentFragment(),b=z.createElement("div"),c=z.createElement("input");if(b.setAttribute("className","t"),b.innerHTML="
a",l.leadingWhitespace=3===b.firstChild.nodeType,l.tbody=!b.getElementsByTagName("tbody").length,l.htmlSerialize=!!b.getElementsByTagName("link").length,l.html5Clone="<:nav>"!==z.createElement("nav").cloneNode(!0).outerHTML,c.type="checkbox",c.checked=!0,a.appendChild(c),l.appendChecked=c.checked,b.innerHTML="",l.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue,a.appendChild(b),b.innerHTML="",l.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,l.noCloneEvent=!0,b.attachEvent&&(b.attachEvent("onclick",function(){l.noCloneEvent=!1}),b.cloneNode(!0).click()),null==l.deleteExpando){l.deleteExpando=!0;try{delete b.test}catch(d){l.deleteExpando=!1}}a=b=c=null}(),function(){var b,c,d=z.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(l[b+"Bubbles"]=c in a)||(d.setAttribute(c,"t"),l[b+"Bubbles"]=d.attributes[c].expando===!1);d=null}();var Y=/^(?:input|select|textarea)$/i,Z=/^key/,$=/^(?:mouse|contextmenu)|click/,_=/^(?:focusinfocus|focusoutblur)$/,ab=/^([^.]*)(?:\.(.+)|)$/;function bb(){return!0}function cb(){return!1}function db(){try{return z.activeElement}catch(a){}}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=n.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return typeof n===L||a&&n.event.triggered===a.type?void 0:n.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(F)||[""],h=b.length;while(h--)f=ab.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=n.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=n.event.special[o]||{},l=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},i),(m=g[o])||(m=g[o]=[],m.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,l):m.push(l),n.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n.hasData(a)&&n._data(a);if(r&&(k=r.events)){b=(b||"").match(F)||[""],j=b.length;while(j--)if(h=ab.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=m.length;while(f--)g=m[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(m.splice(f,1),g.selector&&m.delegateCount--,l.remove&&l.remove.call(a,g));i&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(k)&&(delete r.handle,n._removeData(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,l,m,o=[d||z],p=j.call(b,"type")?b.type:b,q=j.call(b,"namespace")?b.namespace.split("."):[];if(h=l=d=d||z,3!==d.nodeType&&8!==d.nodeType&&!_.test(p+n.event.triggered)&&(p.indexOf(".")>=0&&(q=p.split("."),p=q.shift(),q.sort()),g=p.indexOf(":")<0&&"on"+p,b=b[n.expando]?b:new n.Event(p,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=q.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:n.makeArray(c,[b]),k=n.event.special[p]||{},e||!k.trigger||k.trigger.apply(d,c)!==!1)){if(!e&&!k.noBubble&&!n.isWindow(d)){for(i=k.delegateType||p,_.test(i+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),l=h;l===(d.ownerDocument||z)&&o.push(l.defaultView||l.parentWindow||a)}m=0;while((h=o[m++])&&!b.isPropagationStopped())b.type=m>1?i:k.bindType||p,f=(n._data(h,"events")||{})[b.type]&&n._data(h,"handle"),f&&f.apply(h,c),f=g&&h[g],f&&f.apply&&n.acceptData(h)&&(b.result=f.apply(h,c),b.result===!1&&b.preventDefault());if(b.type=p,!e&&!b.isDefaultPrevented()&&(!k._default||k._default.apply(o.pop(),c)===!1)&&n.acceptData(d)&&g&&d[p]&&!n.isWindow(d)){l=d[g],l&&(d[g]=null),n.event.triggered=p;try{d[p]()}catch(r){}n.event.triggered=void 0,l&&(d[g]=l)}return b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(n._data(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,g=0;while((e=f.handlers[g++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(e.namespace))&&(a.handleObj=e,a.data=e.data,c=((n.event.special[e.origType]||{}).handle||e.handler).apply(f.elem,i),void 0!==c&&(a.result=c)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(e=[],f=0;h>f;f++)d=b[f],c=d.selector+" ",void 0===e[c]&&(e[c]=d.needsContext?n(c,this).index(i)>=0:n.find(c,this,null,[i]).length),e[c]&&e.push(d);e.length&&g.push({elem:i,handlers:e})}return h]","i"),ib=/^\s+/,jb=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,kb=/<([\w:]+)/,lb=/\s*$/g,sb={option:[1,""],legend:[1,"
","
"],area:[1,"",""],param:[1,"",""],thead:[1,"","
"],tr:[2,"","
"],col:[2,"","
"],td:[3,"","
"],_default:l.htmlSerialize?[0,"",""]:[1,"X
","
"]},tb=eb(z),ub=tb.appendChild(z.createElement("div"));sb.optgroup=sb.option,sb.tbody=sb.tfoot=sb.colgroup=sb.caption=sb.thead,sb.th=sb.td;function vb(a,b){var c,d,e=0,f=typeof a.getElementsByTagName!==L?a.getElementsByTagName(b||"*"):typeof a.querySelectorAll!==L?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||n.nodeName(d,b)?f.push(d):n.merge(f,vb(d,b));return void 0===b||b&&n.nodeName(a,b)?n.merge([a],f):f}function wb(a){X.test(a.type)&&(a.defaultChecked=a.checked)}function xb(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function yb(a){return a.type=(null!==n.find.attr(a,"type"))+"/"+a.type,a}function zb(a){var b=qb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function Ab(a,b){for(var c,d=0;null!=(c=a[d]);d++)n._data(c,"globalEval",!b||n._data(b[d],"globalEval"))}function Bb(a,b){if(1===b.nodeType&&n.hasData(a)){var c,d,e,f=n._data(a),g=n._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)n.event.add(b,c,h[c][d])}g.data&&(g.data=n.extend({},g.data))}}function Cb(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!l.noCloneEvent&&b[n.expando]){e=n._data(b);for(d in e.events)n.removeEvent(b,d,e.handle);b.removeAttribute(n.expando)}"script"===c&&b.text!==a.text?(yb(b).text=a.text,zb(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),l.html5Clone&&a.innerHTML&&!n.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&X.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}n.extend({clone:function(a,b,c){var d,e,f,g,h,i=n.contains(a.ownerDocument,a);if(l.html5Clone||n.isXMLDoc(a)||!hb.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(ub.innerHTML=a.outerHTML,ub.removeChild(f=ub.firstChild)),!(l.noCloneEvent&&l.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(d=vb(f),h=vb(a),g=0;null!=(e=h[g]);++g)d[g]&&Cb(e,d[g]);if(b)if(c)for(h=h||vb(a),d=d||vb(f),g=0;null!=(e=h[g]);g++)Bb(e,d[g]);else Bb(a,f);return d=vb(f,"script"),d.length>0&&Ab(d,!i&&vb(a,"script")),d=h=e=null,f},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,k,m=a.length,o=eb(b),p=[],q=0;m>q;q++)if(f=a[q],f||0===f)if("object"===n.type(f))n.merge(p,f.nodeType?[f]:f);else if(mb.test(f)){h=h||o.appendChild(b.createElement("div")),i=(kb.exec(f)||["",""])[1].toLowerCase(),k=sb[i]||sb._default,h.innerHTML=k[1]+f.replace(jb,"<$1>")+k[2],e=k[0];while(e--)h=h.lastChild;if(!l.leadingWhitespace&&ib.test(f)&&p.push(b.createTextNode(ib.exec(f)[0])),!l.tbody){f="table"!==i||lb.test(f)?""!==k[1]||lb.test(f)?0:h:h.firstChild,e=f&&f.childNodes.length;while(e--)n.nodeName(j=f.childNodes[e],"tbody")&&!j.childNodes.length&&f.removeChild(j)}n.merge(p,h.childNodes),h.textContent="";while(h.firstChild)h.removeChild(h.firstChild);h=o.lastChild}else p.push(b.createTextNode(f));h&&o.removeChild(h),l.appendChecked||n.grep(vb(p,"input"),wb),q=0;while(f=p[q++])if((!d||-1===n.inArray(f,d))&&(g=n.contains(f.ownerDocument,f),h=vb(o.appendChild(f),"script"),g&&Ab(h),c)){e=0;while(f=h[e++])pb.test(f.type||"")&&c.push(f)}return h=null,o},cleanData:function(a,b){for(var d,e,f,g,h=0,i=n.expando,j=n.cache,k=l.deleteExpando,m=n.event.special;null!=(d=a[h]);h++)if((b||n.acceptData(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)m[e]?n.event.remove(d,e):n.removeEvent(d,e,g.handle);j[f]&&(delete j[f],k?delete d[i]:typeof d.removeAttribute!==L?d.removeAttribute(i):d[i]=null,c.push(f))}}}),n.fn.extend({text:function(a){return W(this,function(a){return void 0===a?n.text(this):this.empty().append((this[0]&&this[0].ownerDocument||z).createTextNode(a))},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=xb(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=xb(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?n.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||n.cleanData(vb(c)),c.parentNode&&(b&&n.contains(c.ownerDocument,c)&&Ab(vb(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&n.cleanData(vb(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&n.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return W(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(gb,""):void 0;if(!("string"!=typeof a||nb.test(a)||!l.htmlSerialize&&hb.test(a)||!l.leadingWhitespace&&ib.test(a)||sb[(kb.exec(a)||["",""])[1].toLowerCase()])){a=a.replace(jb,"<$1>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(vb(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,n.cleanData(vb(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,k=this.length,m=this,o=k-1,p=a[0],q=n.isFunction(p);if(q||k>1&&"string"==typeof p&&!l.checkClone&&ob.test(p))return this.each(function(c){var d=m.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(k&&(i=n.buildFragment(a,this[0].ownerDocument,!1,this),c=i.firstChild,1===i.childNodes.length&&(i=c),c)){for(g=n.map(vb(i,"script"),yb),f=g.length;k>j;j++)d=i,j!==o&&(d=n.clone(d,!0,!0),f&&n.merge(g,vb(d,"script"))),b.call(this[j],d,j);if(f)for(h=g[g.length-1].ownerDocument,n.map(g,zb),j=0;f>j;j++)d=g[j],pb.test(d.type||"")&&!n._data(d,"globalEval")&&n.contains(h,d)&&(d.src?n._evalUrl&&n._evalUrl(d.src):n.globalEval((d.text||d.textContent||d.innerHTML||"").replace(rb,"")));i=c=null}return this}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=0,e=[],g=n(a),h=g.length-1;h>=d;d++)c=d===h?this:this.clone(!0),n(g[d])[b](c),f.apply(e,c.get());return this.pushStack(e)}});var Db,Eb={};function Fb(b,c){var d=n(c.createElement(b)).appendTo(c.body),e=a.getDefaultComputedStyle?a.getDefaultComputedStyle(d[0]).display:n.css(d[0],"display");return d.detach(),e}function Gb(a){var b=z,c=Eb[a];return c||(c=Fb(a,b),"none"!==c&&c||(Db=(Db||n("