diff --git a/.gitignore b/.gitignore index c6597e4e..f4178924 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,52 @@ +# CakePHP 4 +# User specific & automatically generated files # +################################################# +/build +/dist +/tags +/composer.lock +/phpunit.xml +/vendor +/vendors +/composer.phar +*.mo +debug.log +error.log +.phpunit.result.cache + +# OS generated files # +###################### +.DS_Store +.DS_Store? +._* +.Spotlight-V100 +.Trashes +Icon? +ehthumbs.db +Thumbs.db + +# Tool specific files # +####################### +# vim +*~ +*.swp +*.swo +# sublime text & textmate +*.sublime-* +*.stTheme.cache +*.tmlanguage.cache +*.tmPreferences.cache +# Eclipse +.settings/* +/.project +/.buildpath +# JetBrains, aka PHPStorm, IntelliJ IDEA +.idea/* +# NetBeans +nbproject/* +# Visual Studio Code +.vscode + # CakePHP 3 /vendor/* diff --git a/app/composer.json b/app/composer.json index 97b9d520..4f2ec1d9 100644 --- a/app/composer.json +++ b/app/composer.json @@ -5,19 +5,21 @@ "type": "project", "license": "MIT", "require": { - "php": ">=5.6", + "php": ">=7.2", "adodb/adodb-php": "^5.20", - "cakephp/cakephp": "3.10.*", - "cakephp/migrations": "^1.0", + "cakephp/cakephp": "4.0.*", + "cakephp/migrations": "^3.0.0", "cakephp/plugin-installer": "^1.0", "doctrine/dbal": "^2.9", "josegonzalez/dotenv": "2.*", "mobiledetect/mobiledetectlib": "2.*" }, "require-dev": { - "cakephp/bake": "^1.1", + "cakephp/bake": "^2.0.10", "cakephp/cakephp-codesniffer": "^3.0", - "cakephp/debug_kit": "^3.6", + "cakephp/debug_kit": "^4.0.6", + "phpstan/phpstan": "^0.12.18", + "phpunit/phpunit": "^8.0", "psy/psysh": "@stable" }, "suggest": { @@ -40,7 +42,6 @@ "scripts": { "post-install-cmd": "App\\Console\\Installer::postInstall", "post-create-project-cmd": "App\\Console\\Installer::postInstall", - "post-autoload-dump": "Cake\\Composer\\Installer\\PluginInstaller::postAutoloadDump", "check": [ "@test", "@cs-check" diff --git a/app/composer.lock b/app/composer.lock index a107ccd9..891a7509 100644 --- a/app/composer.lock +++ b/app/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "18bc2276e368023a5a640a707d6102dc", + "content-hash": "fd5988586d5d9d91062852addfcc0c0d", "packages": [ { "name": "adodb/adodb-php", @@ -119,41 +119,45 @@ }, { "name": "cakephp/cakephp", - "version": "3.10.0", + "version": "4.0.10", "source": { "type": "git", "url": "https://github.com/cakephp/cakephp.git", - "reference": "084963bd27984e50174fadcbdee91048112231a0" + "reference": "5c6d72bc9bb1be6eec1b00b3930f9e5054ee6d76" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cakephp/cakephp/zipball/084963bd27984e50174fadcbdee91048112231a0", - "reference": "084963bd27984e50174fadcbdee91048112231a0", + "url": "https://api.github.com/repos/cakephp/cakephp/zipball/5c6d72bc9bb1be6eec1b00b3930f9e5054ee6d76", + "reference": "5c6d72bc9bb1be6eec1b00b3930f9e5054ee6d76", "shasum": "" }, "require": { "aura/intl": "^3.0.0", - "cakephp/chronos": "^1.0.1", + "cakephp/chronos": "^2.0", + "composer/ca-bundle": "^1.2", "ext-intl": "*", + "ext-json": "*", "ext-mbstring": "*", - "laminas/laminas-diactoros": "^1.4.0", - "paragonie/random_compat": "^1.4|^2.0|9.99.99", - "php": ">=5.6.0,<8.0.0", + "laminas/laminas-diactoros": "^2.2.2", + "laminas/laminas-httphandlerrunner": "^1.1", + "php": ">=7.2.0", + "psr/http-client": "^1.0", + "psr/http-server-handler": "^1.0", + "psr/http-server-middleware": "^1.0", "psr/log": "^1.0.0", "psr/simple-cache": "^1.0.0" }, - "conflict": { - "phpunit/phpunit": "<5.7" - }, "replace": { "cakephp/cache": "self.version", "cakephp/collection": "self.version", + "cakephp/console": "self.version", "cakephp/core": "self.version", "cakephp/database": "self.version", "cakephp/datasource": "self.version", "cakephp/event": "self.version", "cakephp/filesystem": "self.version", "cakephp/form": "self.version", + "cakephp/http": "self.version", "cakephp/i18n": "self.version", "cakephp/log": "self.version", "cakephp/orm": "self.version", @@ -161,10 +165,10 @@ "cakephp/validation": "self.version" }, "require-dev": { - "cakephp/cakephp-codesniffer": "^3.0", - "cakephp/chronos": "^1.2.1", - "paragonie/csp-builder": "^1.4|^2.3", - "phpunit/phpunit": "^5.7.14|^6.0" + "cakephp/cakephp-codesniffer": "^4.0", + "mikey179/vfsstream": "^1.6", + "paragonie/csp-builder": "^2.3", + "phpunit/phpunit": "~8.5.0" }, "suggest": { "ext-curl": "To enable more efficient network calls in Http\\Client.", @@ -213,30 +217,28 @@ "issues": "https://github.com/cakephp/cakephp/issues", "source": "https://github.com/cakephp/cakephp" }, - "time": "2021-06-20T01:14:53+00:00" + "time": "2020-12-08T03:04:12+00:00" }, { "name": "cakephp/chronos", - "version": "1.3.0", + "version": "2.2.0", "source": { "type": "git", "url": "https://github.com/cakephp/chronos.git", - "reference": "ba2bab98849e7bf29b02dd634ada49ab36472959" + "reference": "556e14da67307ffc2e68beeb7df0694dc8d1207d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cakephp/chronos/zipball/ba2bab98849e7bf29b02dd634ada49ab36472959", - "reference": "ba2bab98849e7bf29b02dd634ada49ab36472959", + "url": "https://api.github.com/repos/cakephp/chronos/zipball/556e14da67307ffc2e68beeb7df0694dc8d1207d", + "reference": "556e14da67307ffc2e68beeb7df0694dc8d1207d", "shasum": "" }, "require": { - "php": ">=5.6" + "php": ">=7.2" }, "require-dev": { - "athletic/athletic": "~0.1", - "cakephp/cakephp-codesniffer": "^3.0", - "phpbench/phpbench": "@dev", - "phpunit/phpunit": "<6.0 || ^7.0" + "cakephp/cakephp-codesniffer": "^4.5", + "phpunit/phpunit": "^8.0 || ^9.0" }, "type": "library", "autoload": { @@ -274,41 +276,42 @@ "issues": "https://github.com/cakephp/chronos/issues", "source": "https://github.com/cakephp/chronos" }, - "time": "2019-11-30T02:33:19+00:00" + "time": "2021-06-17T13:49:10+00:00" }, { "name": "cakephp/migrations", - "version": "1.8.1", + "version": "3.1.0", "source": { "type": "git", "url": "https://github.com/cakephp/migrations.git", - "reference": "cd65daa9fae933bc0ccc69d5b5d92460375da9e2" + "reference": "d22737c31243db89774abfe6a077d254c0eae75a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cakephp/migrations/zipball/cd65daa9fae933bc0ccc69d5b5d92460375da9e2", - "reference": "cd65daa9fae933bc0ccc69d5b5d92460375da9e2", + "url": "https://api.github.com/repos/cakephp/migrations/zipball/d22737c31243db89774abfe6a077d254c0eae75a", + "reference": "d22737c31243db89774abfe6a077d254c0eae75a", "shasum": "" }, "require": { - "cakephp/cache": "^3.6.0", - "cakephp/orm": "^3.6.0", - "php": ">=5.6.0", - "robmorgan/phinx": "0.8.1" + "cakephp/cache": "^4.0.5", + "cakephp/orm": "^4.0.5", + "php": ">=7.2.0", + "robmorgan/phinx": "^0.12" }, "require-dev": { - "cakephp/bake": "^1.7.0", - "cakephp/cakephp": "^3.6.0", - "cakephp/cakephp-codesniffer": "^3.0", - "phpunit/phpunit": "^5.7.14" + "cakephp/bake": "^2.1.0", + "cakephp/cakephp": "^4.0.5", + "cakephp/cakephp-codesniffer": "~4.1.0", + "phpunit/phpunit": "~8.5.0" }, "suggest": { - "cakephp/bake": "Required if you want to generate migrations." + "cakephp/bake": "If you want to generate migrations.", + "dereuromark/cakephp-ide-helper": "If you want to have IDE suggest/autocomplete when creating migrations." }, "type": "cakephp-plugin", "autoload": { "psr-4": { - "Migrations\\": "src" + "Migrations\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -321,19 +324,19 @@ "homepage": "https://github.com/cakephp/migrations/graphs/contributors" } ], - "description": "Database Migration plugin for CakePHP 3.0 based on Phinx", + "description": "Database Migration plugin for CakePHP based on Phinx", "homepage": "https://github.com/cakephp/migrations", "keywords": [ "cakephp", "migrations" ], "support": { - "forum": "http://stackoverflow.com/tags/cakephp", + "forum": "https://stackoverflow.com/tags/cakephp", "irc": "irc://irc.freenode.org/cakephp", "issues": "https://github.com/cakephp/migrations/issues", "source": "https://github.com/cakephp/migrations" }, - "time": "2018-04-16T01:35:59+00:00" + "time": "2021-05-20T13:57:37+00:00" }, { "name": "cakephp/plugin-installer", @@ -384,6 +387,82 @@ }, "time": "2020-10-29T04:00:42+00:00" }, + { + "name": "composer/ca-bundle", + "version": "1.2.10", + "source": { + "type": "git", + "url": "https://github.com/composer/ca-bundle.git", + "reference": "9fdb22c2e97a614657716178093cd1da90a64aa8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/9fdb22c2e97a614657716178093cd1da90a64aa8", + "reference": "9fdb22c2e97a614657716178093cd1da90a64aa8", + "shasum": "" + }, + "require": { + "ext-openssl": "*", + "ext-pcre": "*", + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^0.12.55", + "psr/log": "^1.0", + "symfony/phpunit-bridge": "^4.2 || ^5", + "symfony/process": "^2.5 || ^3.0 || ^4.0 || ^5.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\CaBundle\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "Lets you find a path to the system CA bundle, and includes a fallback to the Mozilla CA bundle.", + "keywords": [ + "cabundle", + "cacert", + "certificate", + "ssl", + "tls" + ], + "support": { + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/ca-bundle/issues", + "source": "https://github.com/composer/ca-bundle/tree/1.2.10" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2021-06-07T13:58:28+00:00" + }, { "name": "doctrine/cache", "version": "2.1.1", @@ -787,40 +866,49 @@ }, { "name": "laminas/laminas-diactoros", - "version": "1.8.7p2", + "version": "2.7.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-diactoros.git", - "reference": "6991c1af7c8d2c8efee81b22ba97024781824aaa" + "reference": "8b5792b7c81465efb14780c2d4787f158bd96183" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-diactoros/zipball/6991c1af7c8d2c8efee81b22ba97024781824aaa", - "reference": "6991c1af7c8d2c8efee81b22ba97024781824aaa", + "url": "https://api.github.com/repos/laminas/laminas-diactoros/zipball/8b5792b7c81465efb14780c2d4787f158bd96183", + "reference": "8b5792b7c81465efb14780c2d4787f158bd96183", "shasum": "" }, "require": { - "laminas/laminas-zendframework-bridge": "^1.0", - "php": "^5.6 || ^7.0", + "php": "^7.3 || ~8.0.0 || ~8.1.0", + "psr/http-factory": "^1.0", "psr/http-message": "^1.0" }, + "conflict": { + "phpspec/prophecy": "<1.9.0", + "zendframework/zend-diactoros": "*" + }, "provide": { + "psr/http-factory-implementation": "1.0", "psr/http-message-implementation": "1.0" }, - "replace": { - "zendframework/zend-diactoros": "~1.8.7.0" - }, "require-dev": { + "ext-curl": "*", "ext-dom": "*", + "ext-gd": "*", "ext-libxml": "*", - "laminas/laminas-coding-standard": "~1.0", - "php-http/psr7-integration-tests": "dev-master", - "phpunit/phpunit": "^5.7.16 || ^6.0.8 || ^7.2.7" + "http-interop/http-factory-tests": "^0.8.0", + "laminas/laminas-coding-standard": "~1.0.0", + "php-http/psr7-integration-tests": "^1.1", + "phpspec/prophecy-phpunit": "^2.0", + "phpunit/phpunit": "^9.1", + "psalm/plugin-phpunit": "^0.14.0", + "vimeo/psalm": "^4.3" }, "type": "library", "extra": { - "branch-alias": { - "dev-release-1.8": "1.8.x-dev" + "laminas": { + "config-provider": "Laminas\\Diactoros\\ConfigProvider", + "module": "Laminas\\Diactoros" } }, "autoload": { @@ -856,6 +944,7 @@ "http", "laminas", "psr", + "psr-17", "psr-7" ], "support": { @@ -866,7 +955,84 @@ "rss": "https://github.com/laminas/laminas-diactoros/releases.atom", "source": "https://github.com/laminas/laminas-diactoros" }, - "time": "2020-03-23T15:28:28+00:00" + "funding": [ + { + "url": "https://funding.communitybridge.org/projects/laminas-project", + "type": "community_bridge" + } + ], + "time": "2021-09-15T08:41:12+00:00" + }, + { + "name": "laminas/laminas-httphandlerrunner", + "version": "1.4.0", + "source": { + "type": "git", + "url": "https://github.com/laminas/laminas-httphandlerrunner.git", + "reference": "6a2dd33e4166469ade07ad1283b45924383b224b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laminas/laminas-httphandlerrunner/zipball/6a2dd33e4166469ade07ad1283b45924383b224b", + "reference": "6a2dd33e4166469ade07ad1283b45924383b224b", + "shasum": "" + }, + "require": { + "laminas/laminas-zendframework-bridge": "^1.0", + "php": "^7.3 || ~8.0.0", + "psr/http-message": "^1.0", + "psr/http-message-implementation": "^1.0", + "psr/http-server-handler": "^1.0" + }, + "replace": { + "zendframework/zend-httphandlerrunner": "^1.1.0" + }, + "require-dev": { + "laminas/laminas-coding-standard": "~1.0.0", + "laminas/laminas-diactoros": "^2.1.1", + "phpunit/phpunit": "^9.3", + "psalm/plugin-phpunit": "^0.15.1", + "vimeo/psalm": "^4.6" + }, + "type": "library", + "extra": { + "laminas": { + "config-provider": "Laminas\\HttpHandlerRunner\\ConfigProvider" + } + }, + "autoload": { + "psr-4": { + "Laminas\\HttpHandlerRunner\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "Execute PSR-15 RequestHandlerInterface instances and emit responses they generate.", + "homepage": "https://laminas.dev", + "keywords": [ + "components", + "laminas", + "mezzio", + "psr-15", + "psr-7" + ], + "support": { + "chat": "https://laminas.dev/chat", + "docs": "https://docs.laminas.dev/laminas-httphandlerrunner/", + "forum": "https://discourse.laminas.dev", + "issues": "https://github.com/laminas/laminas-httphandlerrunner/issues", + "rss": "https://github.com/laminas/laminas-httphandlerrunner/releases.atom", + "source": "https://github.com/laminas/laminas-httphandlerrunner" + }, + "funding": [ + { + "url": "https://funding.communitybridge.org/projects/laminas-project", + "type": "community_bridge" + } + ], + "time": "2021-04-08T13:52:56+00:00" }, { "name": "laminas/laminas-zendframework-bridge", @@ -1055,71 +1221,75 @@ "time": "2021-02-19T21:22:57+00:00" }, { - "name": "paragonie/random_compat", - "version": "v9.99.99", + "name": "psr/container", + "version": "2.0.1", "source": { "type": "git", - "url": "https://github.com/paragonie/random_compat.git", - "reference": "84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95" + "url": "https://github.com/php-fig/container.git", + "reference": "2ae37329ee82f91efadc282cc2d527fd6065a5ef" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paragonie/random_compat/zipball/84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95", - "reference": "84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95", + "url": "https://api.github.com/repos/php-fig/container/zipball/2ae37329ee82f91efadc282cc2d527fd6065a5ef", + "reference": "2ae37329ee82f91efadc282cc2d527fd6065a5ef", "shasum": "" }, "require": { - "php": "^7" + "php": ">=7.2.0" }, - "require-dev": { - "phpunit/phpunit": "4.*|5.*", - "vimeo/psalm": "^1" + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } }, - "suggest": { - "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes." + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } }, - "type": "library", "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ { - "name": "Paragon Initiative Enterprises", - "email": "security@paragonie.com", - "homepage": "https://paragonie.com" + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" } ], - "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7", + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", "keywords": [ - "csprng", - "polyfill", - "pseudorandom", - "random" + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" ], "support": { - "email": "info@paragonie.com", - "issues": "https://github.com/paragonie/random_compat/issues", - "source": "https://github.com/paragonie/random_compat" + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/2.0.1" }, - "time": "2018-07-02T15:55:56+00:00" + "time": "2021-03-24T13:40:57+00:00" }, { - "name": "psr/http-message", + "name": "psr/http-client", "version": "1.0.1", "source": { "type": "git", - "url": "https://github.com/php-fig/http-message.git", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" + "url": "https://github.com/php-fig/http-client.git", + "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", + "url": "https://api.github.com/repos/php-fig/http-client/zipball/2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", + "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": "^7.0 || ^8.0", + "psr/http-message": "^1.0" }, "type": "library", "extra": { @@ -1129,7 +1299,7 @@ }, "autoload": { "psr-4": { - "Psr\\Http\\Message\\": "src/" + "Psr\\Http\\Client\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -1142,47 +1312,46 @@ "homepage": "http://www.php-fig.org/" } ], - "description": "Common interface for HTTP messages", - "homepage": "https://github.com/php-fig/http-message", + "description": "Common interface for HTTP clients", + "homepage": "https://github.com/php-fig/http-client", "keywords": [ "http", - "http-message", + "http-client", "psr", - "psr-7", - "request", - "response" + "psr-18" ], "support": { - "source": "https://github.com/php-fig/http-message/tree/master" + "source": "https://github.com/php-fig/http-client/tree/master" }, - "time": "2016-08-06T14:39:51+00:00" + "time": "2020-06-29T06:28:15+00:00" }, { - "name": "psr/log", - "version": "1.1.4", + "name": "psr/http-factory", + "version": "1.0.1", "source": { "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "d49695b909c3b7628b6289db5479a1c204601f11" + "url": "https://github.com/php-fig/http-factory.git", + "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", - "reference": "d49695b909c3b7628b6289db5479a1c204601f11", + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/12ac7fcd07e5b077433f5f2bee95b3a771bf61be", + "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": ">=7.0.0", + "psr/http-message": "^1.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1.x-dev" + "dev-master": "1.0.x-dev" } }, "autoload": { "psr-4": { - "Psr\\Log\\": "Psr/Log/" + "Psr\\Http\\Message\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -1192,33 +1361,37 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" + "homepage": "http://www.php-fig.org/" } ], - "description": "Common interface for logging libraries", - "homepage": "https://github.com/php-fig/log", + "description": "Common interfaces for PSR-7 HTTP message factories", "keywords": [ - "log", + "factory", + "http", + "message", "psr", - "psr-3" + "psr-17", + "psr-7", + "request", + "response" ], "support": { - "source": "https://github.com/php-fig/log/tree/1.1.4" + "source": "https://github.com/php-fig/http-factory/tree/master" }, - "time": "2021-05-03T11:20:27+00:00" + "time": "2019-04-30T12:38:16+00:00" }, { - "name": "psr/simple-cache", + "name": "psr/http-message", "version": "1.0.1", "source": { "type": "git", - "url": "https://github.com/php-fig/simple-cache.git", - "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b" + "url": "https://github.com/php-fig/http-message.git", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", - "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", "shasum": "" }, "require": { @@ -1232,7 +1405,7 @@ }, "autoload": { "psr-4": { - "Psr\\SimpleCache\\": "src/" + "Psr\\Http\\Message\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -1245,49 +1418,48 @@ "homepage": "http://www.php-fig.org/" } ], - "description": "Common interfaces for simple caching", + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", "keywords": [ - "cache", - "caching", + "http", + "http-message", "psr", - "psr-16", - "simple-cache" + "psr-7", + "request", + "response" ], "support": { - "source": "https://github.com/php-fig/simple-cache/tree/master" + "source": "https://github.com/php-fig/http-message/tree/master" }, - "time": "2017-10-23T01:57:42+00:00" + "time": "2016-08-06T14:39:51+00:00" }, { - "name": "robmorgan/phinx", - "version": "v0.8.1", + "name": "psr/http-server-handler", + "version": "1.0.1", "source": { "type": "git", - "url": "https://github.com/cakephp/phinx.git", - "reference": "7a19de5bebc59321edd9613bc2a667e7f96224ec" + "url": "https://github.com/php-fig/http-server-handler.git", + "reference": "aff2f80e33b7f026ec96bb42f63242dc50ffcae7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cakephp/phinx/zipball/7a19de5bebc59321edd9613bc2a667e7f96224ec", - "reference": "7a19de5bebc59321edd9613bc2a667e7f96224ec", + "url": "https://api.github.com/repos/php-fig/http-server-handler/zipball/aff2f80e33b7f026ec96bb42f63242dc50ffcae7", + "reference": "aff2f80e33b7f026ec96bb42f63242dc50ffcae7", "shasum": "" }, "require": { - "php": ">=5.4", - "symfony/config": "~2.8|~3.0", - "symfony/console": "~2.8|~3.0", - "symfony/yaml": "~2.8|~3.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.26|^5.0" + "php": ">=7.0", + "psr/http-message": "^1.0" }, - "bin": [ - "bin/phinx" - ], "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, "autoload": { "psr-4": { - "Phinx\\": "src/Phinx" + "Psr\\Http\\Server\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -1296,21 +1468,255 @@ ], "authors": [ { - "name": "Woody Gilk", - "email": "woody.gilk@gmail.com", - "homepage": "http://shadowhand.me", - "role": "Developer" - }, - { - "name": "Rob Morgan", - "email": "robbym@gmail.com", - "homepage": "https://robmorgan.id.au", - "role": "Lead Developer" - }, - { - "name": "Richard Quadling", - "email": "rquadling@gmail.com", - "role": "Developer" + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP server-side request handler", + "keywords": [ + "handler", + "http", + "http-interop", + "psr", + "psr-15", + "psr-7", + "request", + "response", + "server" + ], + "support": { + "issues": "https://github.com/php-fig/http-server-handler/issues", + "source": "https://github.com/php-fig/http-server-handler/tree/master" + }, + "time": "2018-10-30T16:46:14+00:00" + }, + { + "name": "psr/http-server-middleware", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-server-middleware.git", + "reference": "2296f45510945530b9dceb8bcedb5cb84d40c5f5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-server-middleware/zipball/2296f45510945530b9dceb8bcedb5cb84d40c5f5", + "reference": "2296f45510945530b9dceb8bcedb5cb84d40c5f5", + "shasum": "" + }, + "require": { + "php": ">=7.0", + "psr/http-message": "^1.0", + "psr/http-server-handler": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Server\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP server-side middleware", + "keywords": [ + "http", + "http-interop", + "middleware", + "psr", + "psr-15", + "psr-7", + "request", + "response" + ], + "support": { + "issues": "https://github.com/php-fig/http-server-middleware/issues", + "source": "https://github.com/php-fig/http-server-middleware/tree/master" + }, + "time": "2018-10-30T17:12:04+00:00" + }, + { + "name": "psr/log", + "version": "1.1.4", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "d49695b909c3b7628b6289db5479a1c204601f11" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", + "reference": "d49695b909c3b7628b6289db5479a1c204601f11", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "Psr/Log/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "support": { + "source": "https://github.com/php-fig/log/tree/1.1.4" + }, + "time": "2021-05-03T11:20:27+00:00" + }, + { + "name": "psr/simple-cache", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/simple-cache.git", + "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", + "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\SimpleCache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interfaces for simple caching", + "keywords": [ + "cache", + "caching", + "psr", + "psr-16", + "simple-cache" + ], + "support": { + "source": "https://github.com/php-fig/simple-cache/tree/master" + }, + "time": "2017-10-23T01:57:42+00:00" + }, + { + "name": "robmorgan/phinx", + "version": "0.12.8", + "source": { + "type": "git", + "url": "https://github.com/cakephp/phinx.git", + "reference": "d2ed1b452cc90f4cae4ea6b5976b94fb9e5ed2a2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/cakephp/phinx/zipball/d2ed1b452cc90f4cae4ea6b5976b94fb9e5ed2a2", + "reference": "d2ed1b452cc90f4cae4ea6b5976b94fb9e5ed2a2", + "shasum": "" + }, + "require": { + "cakephp/database": "^4.0", + "php": ">=7.2", + "psr/container": "^1.0 || ^2.0", + "symfony/config": "^3.4|^4.0|^5.0", + "symfony/console": "^3.4|^4.0|^5.0" + }, + "require-dev": { + "cakephp/cakephp-codesniffer": "^4.0", + "ext-json": "*", + "ext-pdo": "*", + "phpunit/phpunit": "^8.5|^9.3", + "sebastian/comparator": ">=1.2.3", + "symfony/yaml": "^3.4|^4.0|^5.0" + }, + "suggest": { + "ext-json": "Install if using JSON configuration format", + "ext-pdo": "PDO extension is needed", + "symfony/yaml": "Install if using YAML configuration format" + }, + "bin": [ + "bin/phinx" + ], + "type": "library", + "autoload": { + "psr-4": { + "Phinx\\": "src/Phinx/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Rob Morgan", + "email": "robbym@gmail.com", + "homepage": "https://robmorgan.id.au", + "role": "Lead Developer" + }, + { + "name": "Woody Gilk", + "email": "woody.gilk@gmail.com", + "homepage": "https://shadowhand.me", + "role": "Developer" + }, + { + "name": "Richard Quadling", + "email": "rquadling@gmail.com", + "role": "Developer" + }, + { + "name": "CakePHP Community", + "homepage": "https://github.com/cakephp/phinx/graphs/contributors", + "role": "Developer" } ], "description": "Phinx makes it ridiculously easy to manage the database migrations for your PHP app.", @@ -1324,38 +1730,41 @@ ], "support": { "issues": "https://github.com/cakephp/phinx/issues", - "source": "https://github.com/cakephp/phinx/tree/v0.8.1" + "source": "https://github.com/cakephp/phinx/tree/0.12.8" }, - "time": "2017-06-05T13:30:19+00:00" + "time": "2021-07-28T15:31:39+00:00" }, { "name": "symfony/config", - "version": "v3.4.47", + "version": "v5.3.4", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "bc6b3fd3930d4b53a60b42fe2ed6fc466b75f03f" + "reference": "4268f3059c904c61636275182707f81645517a37" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/bc6b3fd3930d4b53a60b42fe2ed6fc466b75f03f", - "reference": "bc6b3fd3930d4b53a60b42fe2ed6fc466b75f03f", + "url": "https://api.github.com/repos/symfony/config/zipball/4268f3059c904c61636275182707f81645517a37", + "reference": "4268f3059c904c61636275182707f81645517a37", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/filesystem": "~2.8|~3.0|~4.0", - "symfony/polyfill-ctype": "~1.8" + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1", + "symfony/filesystem": "^4.4|^5.0", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-php80": "^1.16", + "symfony/polyfill-php81": "^1.22" }, "conflict": { - "symfony/dependency-injection": "<3.3", - "symfony/finder": "<3.3" + "symfony/finder": "<4.4" }, "require-dev": { - "symfony/dependency-injection": "~3.3|~4.0", - "symfony/event-dispatcher": "~3.3|~4.0", - "symfony/finder": "~3.3|~4.0", - "symfony/yaml": "~3.0|~4.0" + "symfony/event-dispatcher": "^4.4|^5.0", + "symfony/finder": "^4.4|^5.0", + "symfony/messenger": "^4.4|^5.0", + "symfony/service-contracts": "^1.1|^2", + "symfony/yaml": "^4.4|^5.0" }, "suggest": { "symfony/yaml": "To use the yaml reference dumper" @@ -1383,10 +1792,10 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Config Component", + "description": "Helps you find, load, combine, autofill and validate configuration values of any kind", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/config/tree/v3.4.47" + "source": "https://github.com/symfony/config/tree/v5.3.4" }, "funding": [ { @@ -1402,41 +1811,50 @@ "type": "tidelift" } ], - "time": "2020-10-24T10:57:07+00:00" + "time": "2021-07-21T12:40:44+00:00" }, { "name": "symfony/console", - "version": "v3.4.47", + "version": "v5.3.7", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "a10b1da6fc93080c180bba7219b5ff5b7518fe81" + "reference": "8b1008344647462ae6ec57559da166c2bfa5e16a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/a10b1da6fc93080c180bba7219b5ff5b7518fe81", - "reference": "a10b1da6fc93080c180bba7219b5ff5b7518fe81", + "url": "https://api.github.com/repos/symfony/console/zipball/8b1008344647462ae6ec57559da166c2bfa5e16a", + "reference": "8b1008344647462ae6ec57559da166c2bfa5e16a", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/debug": "~2.8|~3.0|~4.0", - "symfony/polyfill-mbstring": "~1.0" + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php73": "^1.8", + "symfony/polyfill-php80": "^1.16", + "symfony/service-contracts": "^1.1|^2", + "symfony/string": "^5.1" }, "conflict": { - "symfony/dependency-injection": "<3.4", - "symfony/process": "<3.3" + "psr/log": ">=3", + "symfony/dependency-injection": "<4.4", + "symfony/dotenv": "<5.1", + "symfony/event-dispatcher": "<4.4", + "symfony/lock": "<4.4", + "symfony/process": "<4.4" }, "provide": { - "psr/log-implementation": "1.0" + "psr/log-implementation": "1.0|2.0" }, "require-dev": { - "psr/log": "~1.0", - "symfony/config": "~3.3|~4.0", - "symfony/dependency-injection": "~3.4|~4.0", - "symfony/event-dispatcher": "~2.8|~3.0|~4.0", - "symfony/lock": "~3.4|~4.0", - "symfony/process": "~3.3|~4.0" + "psr/log": "^1|^2", + "symfony/config": "^4.4|^5.0", + "symfony/dependency-injection": "^4.4|^5.0", + "symfony/event-dispatcher": "^4.4|^5.0", + "symfony/lock": "^4.4|^5.0", + "symfony/process": "^4.4|^5.0", + "symfony/var-dumper": "^4.4|^5.0" }, "suggest": { "psr/log": "For using the console logger", @@ -1467,10 +1885,16 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Console Component", + "description": "Eases the creation of beautiful and testable command line interfaces", "homepage": "https://symfony.com", + "keywords": [ + "cli", + "command line", + "console", + "terminal" + ], "support": { - "source": "https://github.com/symfony/console/tree/v3.4.47" + "source": "https://github.com/symfony/console/tree/v5.3.7" }, "funding": [ { @@ -1486,39 +1910,38 @@ "type": "tidelift" } ], - "time": "2020-10-24T10:57:07+00:00" + "time": "2021-08-25T20:02:16+00:00" }, { - "name": "symfony/debug", - "version": "v4.4.27", + "name": "symfony/deprecation-contracts", + "version": "v2.4.0", "source": { "type": "git", - "url": "https://github.com/symfony/debug.git", - "reference": "2f9160e92eb64c95da7368c867b663a8e34e980c" + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "5f38c8804a9e97d23e0c8d63341088cd8a22d627" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/2f9160e92eb64c95da7368c867b663a8e34e980c", - "reference": "2f9160e92eb64c95da7368c867b663a8e34e980c", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/5f38c8804a9e97d23e0c8d63341088cd8a22d627", + "reference": "5f38c8804a9e97d23e0c8d63341088cd8a22d627", "shasum": "" }, "require": { - "php": ">=7.1.3", - "psr/log": "^1|^2|^3" - }, - "conflict": { - "symfony/http-kernel": "<3.4" - }, - "require-dev": { - "symfony/http-kernel": "^3.4|^4.0|^5.0" + "php": ">=7.1" }, "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Debug\\": "" + "extra": { + "branch-alias": { + "dev-main": "2.4-dev" }, - "exclude-from-classmap": [ - "/Tests/" + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "files": [ + "function.php" ] }, "notification-url": "https://packagist.org/downloads/", @@ -1527,18 +1950,18 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Provides tools to ease debugging PHP code", + "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/debug/tree/v4.4.27" + "source": "https://github.com/symfony/deprecation-contracts/tree/v2.4.0" }, "funding": [ { @@ -1554,24 +1977,24 @@ "type": "tidelift" } ], - "time": "2021-07-22T07:21:39+00:00" + "time": "2021-03-23T23:28:01+00:00" }, { "name": "symfony/filesystem", - "version": "v4.4.27", + "version": "v5.3.4", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "517fb795794faf29086a77d99eb8f35e457837a7" + "reference": "343f4fe324383ca46792cae728a3b6e2f708fb32" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/517fb795794faf29086a77d99eb8f35e457837a7", - "reference": "517fb795794faf29086a77d99eb8f35e457837a7", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/343f4fe324383ca46792cae728a3b6e2f708fb32", + "reference": "343f4fe324383ca46792cae728a3b6e2f708fb32", "shasum": "" }, "require": { - "php": ">=7.1.3", + "php": ">=7.2.5", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-php80": "^1.16" }, @@ -1601,7 +2024,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v4.4.27" + "source": "https://github.com/symfony/filesystem/tree/v5.3.4" }, "funding": [ { @@ -1617,7 +2040,7 @@ "type": "tidelift" } ], - "time": "2021-07-21T12:19:41+00:00" + "time": "2021-07-21T12:40:44+00:00" }, { "name": "symfony/polyfill-ctype", @@ -1699,24 +2122,24 @@ "time": "2021-02-19T12:13:01+00:00" }, { - "name": "symfony/polyfill-mbstring", + "name": "symfony/polyfill-intl-grapheme", "version": "v1.23.1", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6" + "url": "https://github.com/symfony/polyfill-intl-grapheme.git", + "reference": "16880ba9c5ebe3642d1995ab866db29270b36535" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9174a3d80210dca8daa7f31fec659150bbeabfc6", - "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/16880ba9c5ebe3642d1995ab866db29270b36535", + "reference": "16880ba9c5ebe3642d1995ab866db29270b36535", "shasum": "" }, "require": { "php": ">=7.1" }, "suggest": { - "ext-mbstring": "For best performance" + "ext-intl": "For best performance" }, "type": "library", "extra": { @@ -1730,7 +2153,7 @@ }, "autoload": { "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" + "Symfony\\Polyfill\\Intl\\Grapheme\\": "" }, "files": [ "bootstrap.php" @@ -1750,17 +2173,18 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill for the Mbstring extension", + "description": "Symfony polyfill for intl's grapheme_* functions", "homepage": "https://symfony.com", "keywords": [ "compatibility", - "mbstring", + "grapheme", + "intl", "polyfill", "portable", "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.23.1" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.23.1" }, "funding": [ { @@ -1779,22 +2203,25 @@ "time": "2021-05-27T12:26:48+00:00" }, { - "name": "symfony/polyfill-php80", - "version": "v1.23.1", + "name": "symfony/polyfill-intl-normalizer", + "version": "v1.23.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be" + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/1100343ed1a92e3a38f9ae122fc0eb21602547be", - "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8590a5f561694770bdcd3f9b5c69dde6945028e8", + "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8", "shasum": "" }, "require": { "php": ">=7.1" }, + "suggest": { + "ext-intl": "For best performance" + }, "type": "library", "extra": { "branch-alias": { @@ -1807,7 +2234,7 @@ }, "autoload": { "psr-4": { - "Symfony\\Polyfill\\Php80\\": "" + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" }, "files": [ "bootstrap.php" @@ -1821,10 +2248,6 @@ "MIT" ], "authors": [ - { - "name": "Ion Bazan", - "email": "ion.bazan@gmail.com" - }, { "name": "Nicolas Grekas", "email": "p@tchwork.com" @@ -1834,16 +2257,18 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "description": "Symfony polyfill for intl's Normalizer class and related functions", "homepage": "https://symfony.com", "keywords": [ "compatibility", + "intl", + "normalizer", "polyfill", "portable", "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.23.1" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.23.0" }, "funding": [ { @@ -1859,42 +2284,44 @@ "type": "tidelift" } ], - "time": "2021-07-28T13:41:28+00:00" + "time": "2021-02-19T12:13:01+00:00" }, { - "name": "symfony/yaml", - "version": "v3.4.47", + "name": "symfony/polyfill-mbstring", + "version": "v1.23.1", "source": { "type": "git", - "url": "https://github.com/symfony/yaml.git", - "reference": "88289caa3c166321883f67fe5130188ebbb47094" + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/88289caa3c166321883f67fe5130188ebbb47094", - "reference": "88289caa3c166321883f67fe5130188ebbb47094", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9174a3d80210dca8daa7f31fec659150bbeabfc6", + "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/polyfill-ctype": "~1.8" - }, - "conflict": { - "symfony/console": "<3.4" - }, - "require-dev": { - "symfony/console": "~3.4|~4.0" + "php": ">=7.1" }, "suggest": { - "symfony/console": "For validating YAML files using the lint command" + "ext-mbstring": "For best performance" }, "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, "autoload": { "psr-4": { - "Symfony\\Component\\Yaml\\": "" + "Symfony\\Polyfill\\Mbstring\\": "" }, - "exclude-from-classmap": [ - "/Tests/" + "files": [ + "bootstrap.php" ] }, "notification-url": "https://packagist.org/downloads/", @@ -1903,18 +2330,25 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Yaml Component", + "description": "Symfony polyfill for the Mbstring extension", "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], "support": { - "source": "https://github.com/symfony/yaml/tree/v3.4.47" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.23.1" }, "funding": [ { @@ -1930,49 +2364,45 @@ "type": "tidelift" } ], - "time": "2020-10-24T10:57:07+00:00" - } - ], - "packages-dev": [ + "time": "2021-05-27T12:26:48+00:00" + }, { - "name": "ajgl/breakpoint-twig-extension", - "version": "0.3.5", + "name": "symfony/polyfill-php73", + "version": "v1.23.0", "source": { "type": "git", - "url": "https://github.com/ajgarlag/AjglBreakpointTwigExtension.git", - "reference": "9875feea0ac4bc3c9f308c62bae4727669d6052a" + "url": "https://github.com/symfony/polyfill-php73.git", + "reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ajgarlag/AjglBreakpointTwigExtension/zipball/9875feea0ac4bc3c9f308c62bae4727669d6052a", - "reference": "9875feea0ac4bc3c9f308c62bae4727669d6052a", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/fba8933c384d6476ab14fb7b8526e5287ca7e010", + "reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010", "shasum": "" }, "require": { - "php": ">=5.6", - "twig/twig": "^1.34|^2.0|^3.0" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "^2.18", - "symfony/framework-bundle": "^2.7|^3.4|^4.4|^5.2", - "symfony/phpunit-bridge": "^4.4|^5.2", - "symfony/twig-bundle": "^2.7|^3.4|^4.4|^5.2" - }, - "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" + "php": ">=7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "0.3.x-dev" + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { "psr-4": { - "Ajgl\\Twig\\Extension\\": "src/" - } + "Symfony\\Polyfill\\Php73\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1980,121 +2410,161 @@ ], "authors": [ { - "name": "Antonio J. García Lagar", - "email": "aj@garcialagar.es", - "homepage": "http://aj.garcialagar.es", - "role": "developer" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Twig extension to set breakpoints", - "homepage": "https://github.com/ajgarlag/AjglBreakpointTwigExtension", + "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", + "homepage": "https://symfony.com", "keywords": [ - "Xdebug", - "breakpoint", - "twig" + "compatibility", + "polyfill", + "portable", + "shim" ], "support": { - "issues": "https://github.com/ajgarlag/AjglBreakpointTwigExtension/issues", - "source": "https://github.com/ajgarlag/AjglBreakpointTwigExtension/tree/0.3.5" + "source": "https://github.com/symfony/polyfill-php73/tree/v1.23.0" }, - "time": "2021-02-08T10:48:05+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-02-19T12:13:01+00:00" }, { - "name": "aptoma/twig-markdown", - "version": "2.0.0", + "name": "symfony/polyfill-php80", + "version": "v1.23.1", "source": { "type": "git", - "url": "https://github.com/aptoma/twig-markdown.git", - "reference": "64a9c5c7418c08faf91c4410b34bdb65fb25c23d" + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aptoma/twig-markdown/zipball/64a9c5c7418c08faf91c4410b34bdb65fb25c23d", - "reference": "64a9c5c7418c08faf91c4410b34bdb65fb25c23d", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/1100343ed1a92e3a38f9ae122fc0eb21602547be", + "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be", "shasum": "" }, "require": { - "twig/twig": "~1.12" - }, - "require-dev": { - "codeclimate/php-test-reporter": "dev-master", - "erusev/parsedown": "^1.6", - "knplabs/github-api": "~1.2", - "league/commonmark": "~0.5", - "michelf/php-markdown": "~1", - "phpunit/phpunit": "~4.0", - "satooshi/php-coveralls": "~0.6" - }, - "suggest": { - "knplabs/github-api": "Needed for using GitHub's Markdown engine provided through their API.", - "michelf/php-markdown": "Original Markdown engine with MarkdownExtra." + "php": ">=7.1" }, "type": "library", - "autoload": { - "psr-0": { - "Aptoma": "src/" + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ { - "name": "Joris Berthelot", - "email": "joris@berthelot.tel" + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { - "name": "Gunnar Lium", - "email": "gunnar@aptoma.com" + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Twig extension to work with Markdown content", + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", "keywords": [ - "markdown", - "twig" + "compatibility", + "polyfill", + "portable", + "shim" ], "support": { - "issues": "https://github.com/aptoma/twig-markdown/issues", - "source": "https://github.com/aptoma/twig-markdown/tree/master" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.23.1" }, - "time": "2015-10-23T20:27:08+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-07-28T13:41:28+00:00" }, { - "name": "asm89/twig-cache-extension", - "version": "1.4.0", + "name": "symfony/polyfill-php81", + "version": "v1.23.0", "source": { "type": "git", - "url": "https://github.com/asm89/twig-cache-extension.git", - "reference": "13787226956ec766f4770722082288097aebaaf3" + "url": "https://github.com/symfony/polyfill-php81.git", + "reference": "e66119f3de95efc359483f810c4c3e6436279436" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/asm89/twig-cache-extension/zipball/13787226956ec766f4770722082288097aebaaf3", - "reference": "13787226956ec766f4770722082288097aebaaf3", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/e66119f3de95efc359483f810c4c3e6436279436", + "reference": "e66119f3de95efc359483f810c4c3e6436279436", "shasum": "" }, "require": { - "php": ">=5.3.2", - "twig/twig": "^1.0|^2.0" - }, - "require-dev": { - "doctrine/cache": "~1.0", - "phpunit/phpunit": "^5.0 || ^4.8.10" - }, - "suggest": { - "psr/cache-implementation": "To make use of PSR-6 cache implementation via PsrCacheAdapter." + "php": ">=7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4-dev" + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { "psr-4": { - "": "lib/" - } + "Symfony\\Polyfill\\Php81\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -2102,52 +2572,71 @@ ], "authors": [ { - "name": "Alexander", - "email": "iam.asm89@gmail.com" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Cache fragments of templates directly within Twig.", - "homepage": "https://github.com/asm89/twig-cache-extension", + "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions", + "homepage": "https://symfony.com", "keywords": [ - "cache", - "extension", - "twig" + "compatibility", + "polyfill", + "portable", + "shim" ], "support": { - "issues": "https://github.com/asm89/twig-cache-extension/issues", - "source": "https://github.com/asm89/twig-cache-extension/tree/1.4.0" + "source": "https://github.com/symfony/polyfill-php81/tree/v1.23.0" }, - "abandoned": "twig/cache-extension", - "time": "2020-01-01T20:47:37+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-05-21T13:25:03+00:00" }, { - "name": "cakephp/bake", - "version": "1.12.0", + "name": "symfony/service-contracts", + "version": "v1.1.2", "source": { "type": "git", - "url": "https://github.com/cakephp/bake.git", - "reference": "33e8ee8419ba36c13fa4074c208c93352b5530cf" + "url": "https://github.com/symfony/service-contracts.git", + "reference": "191afdcb5804db960d26d8566b7e9a2843cab3a0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cakephp/bake/zipball/33e8ee8419ba36c13fa4074c208c93352b5530cf", - "reference": "33e8ee8419ba36c13fa4074c208c93352b5530cf", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/191afdcb5804db960d26d8566b7e9a2843cab3a0", + "reference": "191afdcb5804db960d26d8566b7e9a2843cab3a0", "shasum": "" }, "require": { - "cakephp/cakephp": "^3.8.0", - "cakephp/plugin-installer": "^1.0", - "php": ">=5.6.0", - "wyrihaximus/twig-view": "^4.3.7" + "php": "^7.1.3" }, - "require-dev": { - "cakephp/cakephp-codesniffer": "^3.0", - "phpunit/phpunit": "^5.7.14|^6.0" + "suggest": { + "psr/container": "", + "symfony/service-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } }, - "type": "cakephp-plugin", "autoload": { "psr-4": { - "Bake\\": "src/" + "Symfony\\Contracts\\Service\\": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -2156,50 +2645,194 @@ ], "authors": [ { - "name": "CakePHP Community", - "homepage": "https://github.com/cakephp/bake/graphs/contributors" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Bake plugin for CakePHP 3", - "homepage": "https://github.com/cakephp/bake", + "description": "Generic abstractions related to writing services", + "homepage": "https://symfony.com", "keywords": [ - "bake", - "cakephp" + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" ], "support": { - "forum": "https://stackoverflow.com/tags/cakephp", - "irc": "irc://irc.freenode.org/cakephp", - "issues": "https://github.com/cakephp/bake/issues", - "source": "https://github.com/cakephp/bake" + "source": "https://github.com/symfony/service-contracts/tree/v1.1.2" }, - "time": "2019-12-07T20:34:43+00:00" + "time": "2019-05-28T07:50:59+00:00" }, { - "name": "cakephp/cakephp-codesniffer", - "version": "3.3.0", + "name": "symfony/string", + "version": "v5.3.7", "source": { "type": "git", - "url": "https://github.com/cakephp/cakephp-codesniffer.git", - "reference": "7998a191e787fd5b68cb635d7050cb0d7b55e1a1" + "url": "https://github.com/symfony/string.git", + "reference": "8d224396e28d30f81969f083a58763b8b9ceb0a5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cakephp/cakephp-codesniffer/zipball/7998a191e787fd5b68cb635d7050cb0d7b55e1a1", - "reference": "7998a191e787fd5b68cb635d7050cb0d7b55e1a1", + "url": "https://api.github.com/repos/symfony/string/zipball/8d224396e28d30f81969f083a58763b8b9ceb0a5", + "reference": "8d224396e28d30f81969f083a58763b8b9ceb0a5", "shasum": "" }, "require": { - "php": ">=5.6", - "squizlabs/php_codesniffer": "^3.0.0" + "php": ">=7.2.5", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-intl-grapheme": "~1.0", + "symfony/polyfill-intl-normalizer": "~1.0", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php80": "~1.15" }, "require-dev": { - "phpunit/phpunit": "<6.0" + "symfony/error-handler": "^4.4|^5.0", + "symfony/http-client": "^4.4|^5.0", + "symfony/translation-contracts": "^1.1|^2", + "symfony/var-exporter": "^4.4|^5.0" }, - "type": "phpcodesniffer-standard", + "type": "library", "autoload": { "psr-4": { - "CakePHP\\": "CakePHP/" - } + "Symfony\\Component\\String\\": "" + }, + "files": [ + "Resources/functions.php" + ], + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", + "homepage": "https://symfony.com", + "keywords": [ + "grapheme", + "i18n", + "string", + "unicode", + "utf-8", + "utf8" + ], + "support": { + "source": "https://github.com/symfony/string/tree/v5.3.7" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-08-26T08:00:08+00:00" + } + ], + "packages-dev": [ + { + "name": "cakephp/bake", + "version": "2.2.0", + "source": { + "type": "git", + "url": "https://github.com/cakephp/bake.git", + "reference": "f1c297c4e903a15188389011b93ce46119849d01" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/cakephp/bake/zipball/f1c297c4e903a15188389011b93ce46119849d01", + "reference": "f1c297c4e903a15188389011b93ce46119849d01", + "shasum": "" + }, + "require": { + "cakephp/cakephp": "^4.0", + "cakephp/twig-view": "^1.0", + "php": ">=7.2" + }, + "require-dev": { + "cakephp/cakephp-codesniffer": "^4.0", + "cakephp/debug_kit": "^4.1", + "phpunit/phpunit": "~8.5.0" + }, + "type": "cakephp-plugin", + "autoload": { + "psr-4": { + "Bake\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "CakePHP Community", + "homepage": "https://github.com/cakephp/bake/graphs/contributors" + } + ], + "description": "Bake plugin for CakePHP", + "homepage": "https://github.com/cakephp/bake", + "keywords": [ + "bake", + "cakephp" + ], + "support": { + "forum": "https://stackoverflow.com/tags/cakephp", + "irc": "irc://irc.freenode.org/cakephp", + "issues": "https://github.com/cakephp/bake/issues", + "source": "https://github.com/cakephp/bake" + }, + "time": "2020-10-23T01:17:19+00:00" + }, + { + "name": "cakephp/cakephp-codesniffer", + "version": "3.3.0", + "source": { + "type": "git", + "url": "https://github.com/cakephp/cakephp-codesniffer.git", + "reference": "7998a191e787fd5b68cb635d7050cb0d7b55e1a1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/cakephp/cakephp-codesniffer/zipball/7998a191e787fd5b68cb635d7050cb0d7b55e1a1", + "reference": "7998a191e787fd5b68cb635d7050cb0d7b55e1a1", + "shasum": "" + }, + "require": { + "php": ">=5.6", + "squizlabs/php_codesniffer": "^3.0.0" + }, + "require-dev": { + "phpunit/phpunit": "<6.0" + }, + "type": "phpcodesniffer-standard", + "autoload": { + "psr-4": { + "CakePHP\\": "CakePHP/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -2227,30 +2860,29 @@ }, { "name": "cakephp/debug_kit", - "version": "3.23.0", + "version": "4.2.0", "source": { "type": "git", "url": "https://github.com/cakephp/debug_kit.git", - "reference": "49506b55d0b7becf4803e895b07a8cd8599ab1e4" + "reference": "940a0214947e85bbaa0724acfda852f64831f04f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cakephp/debug_kit/zipball/49506b55d0b7becf4803e895b07a8cd8599ab1e4", - "reference": "49506b55d0b7becf4803e895b07a8cd8599ab1e4", + "url": "https://api.github.com/repos/cakephp/debug_kit/zipball/940a0214947e85bbaa0724acfda852f64831f04f", + "reference": "940a0214947e85bbaa0724acfda852f64831f04f", "shasum": "" }, "require": { - "cakephp/cakephp": "^3.7.0", - "cakephp/chronos": "^1.0.0", - "composer/composer": "^1.3 | ^2.0", - "jdorn/sql-formatter": "^1.2.0", - "php": ">=5.6.0" + "cakephp/cakephp": "^4.0", + "cakephp/chronos": "^2.0", + "composer/composer": "^1.3", + "jdorn/sql-formatter": "^1.2", + "php": ">=7.2" }, "require-dev": { - "cakephp/authorization": "^1.3.2", - "cakephp/cakephp-codesniffer": "^3.0", - "cakephp/plugin-installer": "^1.3", - "phpunit/phpunit": "^5.7.14|^6.0" + "cakephp/authorization": "^2.0", + "cakephp/cakephp-codesniffer": "^4.0", + "phpunit/phpunit": "^8.0" }, "suggest": { "ext-pdo_sqlite": "DebugKit needs to store panel data in a database. SQLite is simple and easy to use." @@ -2290,42 +2922,44 @@ "issues": "https://github.com/cakephp/debug_kit/issues", "source": "https://github.com/cakephp/debug_kit" }, - "time": "2021-05-16T04:58:57+00:00" + "time": "2020-06-10T01:37:18+00:00" }, { - "name": "composer/ca-bundle", - "version": "1.2.10", + "name": "cakephp/twig-view", + "version": "1.2.0", "source": { "type": "git", - "url": "https://github.com/composer/ca-bundle.git", - "reference": "9fdb22c2e97a614657716178093cd1da90a64aa8" + "url": "https://github.com/cakephp/twig-view.git", + "reference": "668dd6aee43dd616b1e83cb9ba166f094c10fbce" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/9fdb22c2e97a614657716178093cd1da90a64aa8", - "reference": "9fdb22c2e97a614657716178093cd1da90a64aa8", + "url": "https://api.github.com/repos/cakephp/twig-view/zipball/668dd6aee43dd616b1e83cb9ba166f094c10fbce", + "reference": "668dd6aee43dd616b1e83cb9ba166f094c10fbce", "shasum": "" }, "require": { - "ext-openssl": "*", - "ext-pcre": "*", - "php": "^5.3.2 || ^7.0 || ^8.0" + "cakephp/cakephp": "^4.0", + "jasny/twig-extensions": "^1.3", + "php": ">=7.2", + "twig/markdown-extra": "^3.0", + "twig/twig": "^3.0" }, - "require-dev": { - "phpstan/phpstan": "^0.12.55", - "psr/log": "^1.0", - "symfony/phpunit-bridge": "^4.2 || ^5", - "symfony/process": "^2.5 || ^3.0 || ^4.0 || ^5.0" + "conflict": { + "wyrihaximus/twig-view": "*" }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.x-dev" - } + "require-dev": { + "cakephp/cakephp-codesniffer": "^4.0", + "cakephp/debug_kit": "^4.0", + "cakephp/plugin-installer": "^1.3", + "michelf/php-markdown": "^1.9", + "mikey179/vfsstream": "^1.6", + "phpunit/phpunit": "^8.5 || ^9.3" }, + "type": "cakephp-plugin", "autoload": { "psr-4": { - "Composer\\CaBundle\\": "src" + "Cake\\TwigView\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -2334,74 +2968,60 @@ ], "authors": [ { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" + "name": "CakePHP Community", + "homepage": "https://github.com/cakephp/cakephp/graphs/contributors" } ], - "description": "Lets you find a path to the system CA bundle, and includes a fallback to the Mozilla CA bundle.", + "description": "Twig powered View for CakePHP", "keywords": [ - "cabundle", - "cacert", - "certificate", - "ssl", - "tls" + "cakephp", + "template", + "twig", + "view" ], "support": { - "irc": "irc://irc.freenode.org/composer", - "issues": "https://github.com/composer/ca-bundle/issues", - "source": "https://github.com/composer/ca-bundle/tree/1.2.10" + "forum": "https://stackoverflow.com/tags/cakephp", + "irc": "irc://irc.freenode.org/cakephp", + "issues": "https://github.com/cakephp/twig-view/issues", + "source": "https://github.com/cakephp/twig-view" }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2021-06-07T13:58:28+00:00" + "time": "2020-12-13T19:57:31+00:00" }, { "name": "composer/composer", - "version": "2.1.8", + "version": "1.10.22", "source": { "type": "git", "url": "https://github.com/composer/composer.git", - "reference": "24d38e9686092de05214cafa187dc282a5d89497" + "reference": "28c9dfbe2351635961f670773e8d7b17bc5eda25" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/composer/zipball/24d38e9686092de05214cafa187dc282a5d89497", - "reference": "24d38e9686092de05214cafa187dc282a5d89497", + "url": "https://api.github.com/repos/composer/composer/zipball/28c9dfbe2351635961f670773e8d7b17bc5eda25", + "reference": "28c9dfbe2351635961f670773e8d7b17bc5eda25", "shasum": "" }, "require": { "composer/ca-bundle": "^1.0", - "composer/metadata-minifier": "^1.0", - "composer/semver": "^3.0", + "composer/semver": "^1.0", "composer/spdx-licenses": "^1.2", - "composer/xdebug-handler": "^2.0", - "justinrainbow/json-schema": "^5.2.11", + "composer/xdebug-handler": "^1.1", + "justinrainbow/json-schema": "^5.2.10", "php": "^5.3.2 || ^7.0 || ^8.0", "psr/log": "^1.0", - "react/promise": "^1.2 || ^2.7", "seld/jsonlint": "^1.4", "seld/phar-utils": "^1.0", - "symfony/console": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0 || ^6.0", - "symfony/filesystem": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0 || ^6.0", - "symfony/finder": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0 || ^6.0", - "symfony/process": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0 || ^6.0" + "symfony/console": "^2.7 || ^3.0 || ^4.0 || ^5.0", + "symfony/filesystem": "^2.7 || ^3.0 || ^4.0 || ^5.0", + "symfony/finder": "^2.7 || ^3.0 || ^4.0 || ^5.0", + "symfony/process": "^2.7 || ^3.0 || ^4.0 || ^5.0" + }, + "conflict": { + "symfony/console": "2.8.38" }, "require-dev": { "phpspec/prophecy": "^1.10", - "symfony/phpunit-bridge": "^4.2 || ^5.0 || ^6.0" + "symfony/phpunit-bridge": "^4.2" }, "suggest": { "ext-openssl": "Enabling the openssl extension allows you to access https URLs for repositories and packages", @@ -2414,7 +3034,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.1-dev" + "dev-master": "1.10-dev" } }, "autoload": { @@ -2430,12 +3050,12 @@ { "name": "Nils Adermann", "email": "naderman@naderman.de", - "homepage": "https://www.naderman.de" + "homepage": "http://www.naderman.de" }, { "name": "Jordi Boggiano", "email": "j.boggiano@seld.be", - "homepage": "https://seld.be" + "homepage": "http://seld.be" } ], "description": "Composer helps you declare, manage and install dependencies of PHP projects. It ensures you have the right stack everywhere.", @@ -2446,78 +3066,9 @@ "package" ], "support": { - "irc": "ircs://irc.libera.chat:6697/composer", + "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/composer/issues", - "source": "https://github.com/composer/composer/tree/2.1.8" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2021-09-15T11:55:15+00:00" - }, - { - "name": "composer/metadata-minifier", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/composer/metadata-minifier.git", - "reference": "c549d23829536f0d0e984aaabbf02af91f443207" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/metadata-minifier/zipball/c549d23829536f0d0e984aaabbf02af91f443207", - "reference": "c549d23829536f0d0e984aaabbf02af91f443207", - "shasum": "" - }, - "require": { - "php": "^5.3.2 || ^7.0 || ^8.0" - }, - "require-dev": { - "composer/composer": "^2", - "phpstan/phpstan": "^0.12.55", - "symfony/phpunit-bridge": "^4.2 || ^5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Composer\\MetadataMinifier\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - } - ], - "description": "Small utility library that handles metadata minification and expansion.", - "keywords": [ - "composer", - "compression" - ], - "support": { - "issues": "https://github.com/composer/metadata-minifier/issues", - "source": "https://github.com/composer/metadata-minifier/tree/1.0.0" + "source": "https://github.com/composer/composer/tree/1.10.22" }, "funding": [ { @@ -2533,33 +3084,32 @@ "type": "tidelift" } ], - "time": "2021-04-07T13:37:33+00:00" + "time": "2021-04-27T11:10:45+00:00" }, { "name": "composer/semver", - "version": "3.2.5", + "version": "1.7.2", "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "31f3ea725711245195f62e54ffa402d8ef2fdba9" + "reference": "647490bbcaf7fc4891c58f47b825eb99d19c377a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/31f3ea725711245195f62e54ffa402d8ef2fdba9", - "reference": "31f3ea725711245195f62e54ffa402d8ef2fdba9", + "url": "https://api.github.com/repos/composer/semver/zipball/647490bbcaf7fc4891c58f47b825eb99d19c377a", + "reference": "647490bbcaf7fc4891c58f47b825eb99d19c377a", "shasum": "" }, "require": { "php": "^5.3.2 || ^7.0 || ^8.0" }, "require-dev": { - "phpstan/phpstan": "^0.12.54", - "symfony/phpunit-bridge": "^4.2 || ^5" + "phpunit/phpunit": "^4.5 || ^5.0.5" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "3.x-dev" + "dev-master": "1.x-dev" } }, "autoload": { @@ -2598,7 +3148,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/3.2.5" + "source": "https://github.com/composer/semver/tree/1.7.2" }, "funding": [ { @@ -2614,7 +3164,7 @@ "type": "tidelift" } ], - "time": "2021-05-24T12:41:47+00:00" + "time": "2020-12-03T15:47:16+00:00" }, { "name": "composer/spdx-licenses", @@ -2697,21 +3247,21 @@ }, { "name": "composer/xdebug-handler", - "version": "2.0.2", + "version": "1.4.6", "source": { "type": "git", "url": "https://github.com/composer/xdebug-handler.git", - "reference": "84674dd3a7575ba617f5a76d7e9e29a7d3891339" + "reference": "f27e06cd9675801df441b3656569b328e04aa37c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/84674dd3a7575ba617f5a76d7e9e29a7d3891339", - "reference": "84674dd3a7575ba617f5a76d7e9e29a7d3891339", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/f27e06cd9675801df441b3656569b328e04aa37c", + "reference": "f27e06cd9675801df441b3656569b328e04aa37c", "shasum": "" }, "require": { "php": "^5.3.2 || ^7.0 || ^8.0", - "psr/log": "^1 || ^2 || ^3" + "psr/log": "^1.0" }, "require-dev": { "phpstan/phpstan": "^0.12.55", @@ -2741,7 +3291,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/xdebug-handler/issues", - "source": "https://github.com/composer/xdebug-handler/tree/2.0.2" + "source": "https://github.com/composer/xdebug-handler/tree/1.4.6" }, "funding": [ { @@ -2757,40 +3307,38 @@ "type": "tidelift" } ], - "time": "2021-07-31T17:03:58+00:00" + "time": "2021-03-25T17:01:18+00:00" }, { - "name": "jasny/twig-extensions", - "version": "v1.2.0", + "name": "doctrine/instantiator", + "version": "1.4.0", "source": { "type": "git", - "url": "https://github.com/jasny/twig-extensions.git", - "reference": "30bdf3a3903c021544f36332c9d5d4d563527da4" + "url": "https://github.com/doctrine/instantiator.git", + "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/jasny/twig-extensions/zipball/30bdf3a3903c021544f36332c9d5d4d563527da4", - "reference": "30bdf3a3903c021544f36332c9d5d4d563527da4", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/d56bf6102915de5702778fe20f2de3b2fe570b5b", + "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b", "shasum": "" }, "require": { - "php": ">=7.0.0 | >=5.6.0", - "twig/twig": "^2.0 | ^1.12" + "php": "^7.1 || ^8.0" }, "require-dev": { - "ext-intl": "*", - "ext-pcre": "*", - "jasny/php-code-quality": "^2.1", - "phpunit/phpunit": "^5.0" - }, - "suggest": { - "ext-intl": "Required for the use of the LocalDate Twig extension", - "ext-pcre": "Required for the use of the PCRE Twig extension" + "doctrine/coding-standard": "^8.0", + "ext-pdo": "*", + "ext-phar": "*", + "phpbench/phpbench": "^0.13 || 1.0.0-alpha2", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-phpunit": "^0.12", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" }, "type": "library", "autoload": { "psr-4": { - "Jasny\\Twig\\": "src/" + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" } }, "notification-url": "https://packagist.org/downloads/", @@ -2799,12 +3347,83 @@ ], "authors": [ { - "name": "Arnold Daniels", - "email": "arnold@jasny.net", - "homepage": "http://www.jasny.net" + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "https://ocramius.github.io/" } ], - "description": "A set of useful Twig filters", + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://www.doctrine-project.org/projects/instantiator.html", + "keywords": [ + "constructor", + "instantiate" + ], + "support": { + "issues": "https://github.com/doctrine/instantiator/issues", + "source": "https://github.com/doctrine/instantiator/tree/1.4.0" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", + "type": "tidelift" + } + ], + "time": "2020-11-10T18:47:58+00:00" + }, + { + "name": "jasny/twig-extensions", + "version": "v1.3.0", + "source": { + "type": "git", + "url": "https://github.com/jasny/twig-extensions.git", + "reference": "a694eb02f6fc14ff8e2fceb8b80882c0c926102b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/jasny/twig-extensions/zipball/a694eb02f6fc14ff8e2fceb8b80882c0c926102b", + "reference": "a694eb02f6fc14ff8e2fceb8b80882c0c926102b", + "shasum": "" + }, + "require": { + "php": ">=7.0.0", + "twig/twig": "^2.0 | ^3.0" + }, + "require-dev": { + "ext-intl": "*", + "ext-pcre": "*", + "jasny/php-code-quality": "^2.5", + "php": ">=7.2.0" + }, + "suggest": { + "ext-intl": "Required for the use of the LocalDate Twig extension", + "ext-pcre": "Required for the use of the PCRE Twig extension" + }, + "type": "library", + "autoload": { + "psr-4": { + "Jasny\\Twig\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Arnold Daniels", + "email": "arnold@jasny.net", + "homepage": "http://www.jasny.net" + } + ], + "description": "A set of useful Twig filters", "homepage": "http://github.com/jasny/twig-extensions#README", "keywords": [ "PCRE", @@ -2821,7 +3440,7 @@ "issues": "https://github.com/jasny/twig-extensions/issues", "source": "https://github.com/jasny/twig-extensions" }, - "time": "2017-09-13T07:38:01+00:00" + "time": "2019-12-10T16:04:23+00:00" }, { "name": "jdorn/sql-formatter", @@ -2947,6 +3566,64 @@ }, "time": "2021-07-22T09:24:00+00:00" }, + { + "name": "myclabs/deep-copy", + "version": "1.10.2", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/776f831124e9c62e1a2c601ecc52e776d8bb7220", + "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "replace": { + "myclabs/deep-copy": "self.version" + }, + "require-dev": { + "doctrine/collections": "^1.0", + "doctrine/common": "^2.6", + "phpunit/phpunit": "^7.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + }, + "files": [ + "src/DeepCopy/deep_copy.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Create deep copies (clones) of your objects", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "support": { + "issues": "https://github.com/myclabs/DeepCopy/issues", + "source": "https://github.com/myclabs/DeepCopy/tree/1.10.2" + }, + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", + "type": "tidelift" + } + ], + "time": "2020-11-13T09:40:50+00:00" + }, { "name": "nikic/php-parser", "version": "v4.12.0", @@ -3004,129 +3681,1603 @@ "time": "2021-07-21T10:44:31+00:00" }, { - "name": "psy/psysh", - "version": "v0.10.8", + "name": "phar-io/manifest", + "version": "2.0.3", "source": { "type": "git", - "url": "https://github.com/bobthecow/psysh.git", - "reference": "e4573f47750dd6c92dca5aee543fa77513cbd8d3" + "url": "https://github.com/phar-io/manifest.git", + "reference": "97803eca37d319dfa7826cc2437fc020857acb53" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bobthecow/psysh/zipball/e4573f47750dd6c92dca5aee543fa77513cbd8d3", - "reference": "e4573f47750dd6c92dca5aee543fa77513cbd8d3", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53", + "reference": "97803eca37d319dfa7826cc2437fc020857acb53", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-phar": "*", + "ext-xmlwriter": "*", + "phar-io/version": "^3.0.1", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "support": { + "issues": "https://github.com/phar-io/manifest/issues", + "source": "https://github.com/phar-io/manifest/tree/2.0.3" + }, + "time": "2021-07-20T11:28:43+00:00" + }, + { + "name": "phar-io/version", + "version": "3.1.0", + "source": { + "type": "git", + "url": "https://github.com/phar-io/version.git", + "reference": "bae7c545bef187884426f042434e561ab1ddb182" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/version/zipball/bae7c545bef187884426f042434e561ab1ddb182", + "reference": "bae7c545bef187884426f042434e561ab1ddb182", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Library for handling version information and constraints", + "support": { + "issues": "https://github.com/phar-io/version/issues", + "source": "https://github.com/phar-io/version/tree/3.1.0" + }, + "time": "2021-02-23T14:00:09+00:00" + }, + { + "name": "phpdocumentor/reflection-common", + "version": "2.2.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-2.x": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" + } + ], + "description": "Common reflection classes used by phpdocumentor to reflect the code structure", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "FQSEN", + "phpDocumentor", + "phpdoc", + "reflection", + "static analysis" + ], + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", + "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x" + }, + "time": "2020-06-27T09:03:43+00:00" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "5.2.2", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "069a785b2141f5bcf49f3e353548dc1cce6df556" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/069a785b2141f5bcf49f3e353548dc1cce6df556", + "reference": "069a785b2141f5bcf49f3e353548dc1cce6df556", + "shasum": "" + }, + "require": { + "ext-filter": "*", + "php": "^7.2 || ^8.0", + "phpdocumentor/reflection-common": "^2.2", + "phpdocumentor/type-resolver": "^1.3", + "webmozart/assert": "^1.9.1" + }, + "require-dev": { + "mockery/mockery": "~1.3.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + }, + { + "name": "Jaap van Otterdijk", + "email": "account@ijaap.nl" + } + ], + "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/master" + }, + "time": "2020-09-03T19:13:55+00:00" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "1.5.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "30f38bffc6f24293dadd1823936372dfa9e86e2f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/30f38bffc6f24293dadd1823936372dfa9e86e2f", + "reference": "30f38bffc6f24293dadd1823936372dfa9e86e2f", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0", + "phpdocumentor/reflection-common": "^2.0" + }, + "require-dev": { + "ext-tokenizer": "*", + "psalm/phar": "^4.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-1.x": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", + "support": { + "issues": "https://github.com/phpDocumentor/TypeResolver/issues", + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.5.0" + }, + "time": "2021-09-17T15:28:14+00:00" + }, + { + "name": "phpspec/prophecy", + "version": "1.14.0", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e", + "reference": "d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.2", + "php": "^7.2 || ~8.0, <8.2", + "phpdocumentor/reflection-docblock": "^5.2", + "sebastian/comparator": "^3.0 || ^4.0", + "sebastian/recursion-context": "^3.0 || ^4.0" + }, + "require-dev": { + "phpspec/phpspec": "^6.0 || ^7.0", + "phpunit/phpunit": "^8.0 || ^9.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Prophecy\\": "src/Prophecy" + } + }, + "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" + ], + "support": { + "issues": "https://github.com/phpspec/prophecy/issues", + "source": "https://github.com/phpspec/prophecy/tree/1.14.0" + }, + "time": "2021-09-10T09:02:12+00:00" + }, + { + "name": "phpstan/phpstan", + "version": "0.12.99", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpstan.git", + "reference": "b4d40f1d759942f523be267a1bab6884f46ca3f7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/b4d40f1d759942f523be267a1bab6884f46ca3f7", + "reference": "b4d40f1d759942f523be267a1bab6884f46ca3f7", + "shasum": "" + }, + "require": { + "php": "^7.1|^8.0" + }, + "conflict": { + "phpstan/phpstan-shim": "*" + }, + "bin": [ + "phpstan", + "phpstan.phar" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.12-dev" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPStan - PHP Static Analysis Tool", + "support": { + "issues": "https://github.com/phpstan/phpstan/issues", + "source": "https://github.com/phpstan/phpstan/tree/0.12.99" + }, + "funding": [ + { + "url": "https://github.com/ondrejmirtes", + "type": "github" + }, + { + "url": "https://github.com/phpstan", + "type": "github" + }, + { + "url": "https://www.patreon.com/phpstan", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpstan/phpstan", + "type": "tidelift" + } + ], + "time": "2021-09-12T20:09:55+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "7.0.15", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "819f92bba8b001d4363065928088de22f25a3a48" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/819f92bba8b001d4363065928088de22f25a3a48", + "reference": "819f92bba8b001d4363065928088de22f25a3a48", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-xmlwriter": "*", + "php": ">=7.2", + "phpunit/php-file-iterator": "^2.0.2", + "phpunit/php-text-template": "^1.2.1", + "phpunit/php-token-stream": "^3.1.3 || ^4.0", + "sebastian/code-unit-reverse-lookup": "^1.0.1", + "sebastian/environment": "^4.2.2", + "sebastian/version": "^2.0.1", + "theseer/tokenizer": "^1.1.3" + }, + "require-dev": { + "phpunit/phpunit": "^8.2.2" + }, + "suggest": { + "ext-xdebug": "^2.7.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "7.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/7.0.15" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-07-26T12:20:09+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "28af674ff175d0768a5a978e6de83f697d4a7f05" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/28af674ff175d0768a5a978e6de83f697d4a7f05", + "reference": "28af674ff175d0768a5a978e6de83f697d4a7f05", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "require-dev": { + "phpunit/phpunit": "^8.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/2.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-07-19T06:46:01+00:00" + }, + { + "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" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-text-template/issues", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/1.2.1" + }, + "time": "2015-06-21T13:50:34+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "2.1.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "2454ae1765516d20c4ffe103d85a58a9a3bd5662" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/2454ae1765516d20c4ffe103d85a58a9a3bd5662", + "reference": "2454ae1765516d20c4ffe103d85a58a9a3bd5662", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "require-dev": { + "phpunit/phpunit": "^8.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-timer/issues", + "source": "https://github.com/sebastianbergmann/php-timer/tree/2.1.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-11-30T08:20:02+00:00" + }, + { + "name": "phpunit/php-token-stream", + "version": "4.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-token-stream.git", + "reference": "a853a0e183b9db7eed023d7933a858fa1c8d25a3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/a853a0e183b9db7eed023d7933a858fa1c8d25a3", + "reference": "a853a0e183b9db7eed023d7933a858fa1c8d25a3", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": "^7.3 || ^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Wrapper around PHP's tokenizer extension.", + "homepage": "https://github.com/sebastianbergmann/php-token-stream/", + "keywords": [ + "tokenizer" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-token-stream/issues", + "source": "https://github.com/sebastianbergmann/php-token-stream/tree/master" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "abandoned": true, + "time": "2020-08-04T08:28:15+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "8.5.20", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "9deefba183198398a09b927a6ac6bc1feb0b7b70" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/9deefba183198398a09b927a6ac6bc1feb0b7b70", + "reference": "9deefba183198398a09b927a6ac6bc1feb0b7b70", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.3.1", + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "ext-xmlwriter": "*", + "myclabs/deep-copy": "^1.10.0", + "phar-io/manifest": "^2.0.3", + "phar-io/version": "^3.0.2", + "php": ">=7.2", + "phpspec/prophecy": "^1.10.3", + "phpunit/php-code-coverage": "^7.0.12", + "phpunit/php-file-iterator": "^2.0.4", + "phpunit/php-text-template": "^1.2.1", + "phpunit/php-timer": "^2.1.2", + "sebastian/comparator": "^3.0.2", + "sebastian/diff": "^3.0.2", + "sebastian/environment": "^4.2.3", + "sebastian/exporter": "^3.1.2", + "sebastian/global-state": "^3.0.0", + "sebastian/object-enumerator": "^3.0.3", + "sebastian/resource-operations": "^2.0.1", + "sebastian/type": "^1.1.3", + "sebastian/version": "^2.0.1" + }, + "require-dev": { + "ext-pdo": "*" + }, + "suggest": { + "ext-soap": "*", + "ext-xdebug": "*", + "phpunit/php-invoker": "^2.0.0" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "8.5-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" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/phpunit/issues", + "source": "https://github.com/sebastianbergmann/phpunit/tree/8.5.20" + }, + "funding": [ + { + "url": "https://phpunit.de/donate.html", + "type": "custom" + }, + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-08-31T06:44:38+00:00" + }, + { + "name": "psy/psysh", + "version": "v0.10.8", + "source": { + "type": "git", + "url": "https://github.com/bobthecow/psysh.git", + "reference": "e4573f47750dd6c92dca5aee543fa77513cbd8d3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/bobthecow/psysh/zipball/e4573f47750dd6c92dca5aee543fa77513cbd8d3", + "reference": "e4573f47750dd6c92dca5aee543fa77513cbd8d3", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-tokenizer": "*", + "nikic/php-parser": "~4.0|~3.0|~2.0|~1.3", + "php": "^8.0 || ^7.0 || ^5.5.9", + "symfony/console": "~5.0|~4.0|~3.0|^2.4.2|~2.3.10", + "symfony/var-dumper": "~5.0|~4.0|~3.0|~2.7" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.2", + "hoa/console": "3.17.*" + }, + "suggest": { + "ext-pcntl": "Enabling the PCNTL extension makes PsySH a lot happier :)", + "ext-pdo-sqlite": "The doc command requires SQLite to work.", + "ext-posix": "If you have PCNTL, you'll want the POSIX extension as well.", + "ext-readline": "Enables support for arrow-key history navigation, and showing and manipulating command history.", + "hoa/console": "A pure PHP readline implementation. You'll want this if your PHP install doesn't already support readline or libedit." + }, + "bin": [ + "bin/psysh" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "0.10.x-dev" + } + }, + "autoload": { + "files": [ + "src/functions.php" + ], + "psr-4": { + "Psy\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Justin Hileman", + "email": "justin@justinhileman.info", + "homepage": "http://justinhileman.com" + } + ], + "description": "An interactive shell for modern PHP.", + "homepage": "http://psysh.org", + "keywords": [ + "REPL", + "console", + "interactive", + "shell" + ], + "support": { + "issues": "https://github.com/bobthecow/psysh/issues", + "source": "https://github.com/bobthecow/psysh/tree/v0.10.8" + }, + "time": "2021-04-10T16:23:39+00:00" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "1de8cd5c010cb153fcd68b8d0f64606f523f7619" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/1de8cd5c010cb153fcd68b8d0f64606f523f7619", + "reference": "1de8cd5c010cb153fcd68b8d0f64606f523f7619", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "require-dev": { + "phpunit/phpunit": "^8.5" + }, + "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": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/1.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-11-30T08:15:22+00:00" + }, + { + "name": "sebastian/comparator", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "1071dfcef776a57013124ff35e1fc41ccd294758" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/1071dfcef776a57013124ff35e1fc41ccd294758", + "reference": "1071dfcef776a57013124ff35e1fc41ccd294758", + "shasum": "" + }, + "require": { + "php": ">=7.1", + "sebastian/diff": "^3.0", + "sebastian/exporter": "^3.1" + }, + "require-dev": { + "phpunit/phpunit": "^8.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "https://github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/comparator/issues", + "source": "https://github.com/sebastianbergmann/comparator/tree/3.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-11-30T08:04:30+00:00" + }, + { + "name": "sebastian/diff", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "14f72dd46eaf2f2293cbe79c93cc0bc43161a211" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/14f72dd46eaf2f2293cbe79c93cc0bc43161a211", + "reference": "14f72dd46eaf2f2293cbe79c93cc0bc43161a211", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "require-dev": { + "phpunit/phpunit": "^7.5 || ^8.0", + "symfony/process": "^2 || ^3.3 || ^4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff", + "udiff", + "unidiff", + "unified diff" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/diff/issues", + "source": "https://github.com/sebastianbergmann/diff/tree/3.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-11-30T07:59:04+00:00" + }, + { + "name": "sebastian/environment", + "version": "4.2.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "d47bbbad83711771f167c72d4e3f25f7fcc1f8b0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/d47bbbad83711771f167c72d4e3f25f7fcc1f8b0", + "reference": "d47bbbad83711771f167c72d4e3f25f7fcc1f8b0", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "require-dev": { + "phpunit/phpunit": "^7.5" + }, + "suggest": { + "ext-posix": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.2-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/environment/issues", + "source": "https://github.com/sebastianbergmann/environment/tree/4.2.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-11-30T07:53:42+00:00" + }, + { + "name": "sebastian/exporter", + "version": "3.1.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "6b853149eab67d4da22291d36f5b0631c0fd856e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/6b853149eab67d4da22291d36f5b0631c0fd856e", + "reference": "6b853149eab67d4da22291d36f5b0631c0fd856e", + "shasum": "" + }, + "require": { + "php": ">=7.0", + "sebastian/recursion-context": "^3.0" + }, + "require-dev": { + "ext-mbstring": "*", + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "http://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/exporter/issues", + "source": "https://github.com/sebastianbergmann/exporter/tree/3.1.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-11-30T07:47:53+00:00" + }, + { + "name": "sebastian/global-state", + "version": "3.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "474fb9edb7ab891665d3bfc6317f42a0a150454b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/474fb9edb7ab891665d3bfc6317f42a0a150454b", + "reference": "474fb9edb7ab891665d3bfc6317f42a0a150454b", + "shasum": "" + }, + "require": { + "php": ">=7.2", + "sebastian/object-reflector": "^1.1.1", + "sebastian/recursion-context": "^3.0" + }, + "require-dev": { + "ext-dom": "*", + "phpunit/phpunit": "^8.0" + }, + "suggest": { + "ext-uopz": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/global-state/issues", + "source": "https://github.com/sebastianbergmann/global-state/tree/3.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-11-30T07:43:24+00:00" + }, + { + "name": "sebastian/object-enumerator", + "version": "3.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "e67f6d32ebd0c749cf9d1dbd9f226c727043cdf2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/e67f6d32ebd0c749cf9d1dbd9f226c727043cdf2", + "reference": "e67f6d32ebd0c749cf9d1dbd9f226c727043cdf2", + "shasum": "" + }, + "require": { + "php": ">=7.0", + "sebastian/object-reflector": "^1.1.1", + "sebastian/recursion-context": "^3.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/3.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-11-30T07:40:27+00:00" + }, + { + "name": "sebastian/object-reflector", + "version": "1.1.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "9b8772b9cbd456ab45d4a598d2dd1a1bced6363d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/9b8772b9cbd456ab45d4a598d2dd1a1bced6363d", + "reference": "9b8772b9cbd456ab45d4a598d2dd1a1bced6363d", + "shasum": "" + }, + "require": { + "php": ">=7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Allows reflection of object attributes, including inherited and non-public ones", + "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-reflector/issues", + "source": "https://github.com/sebastianbergmann/object-reflector/tree/1.1.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-11-30T07:37:18+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "3.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "367dcba38d6e1977be014dc4b22f47a484dac7fb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/367dcba38d6e1977be014dc4b22f47a484dac7fb", + "reference": "367dcba38d6e1977be014dc4b22f47a484dac7fb", + "shasum": "" + }, + "require": { + "php": ">=7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "support": { + "issues": "https://github.com/sebastianbergmann/recursion-context/issues", + "source": "https://github.com/sebastianbergmann/recursion-context/tree/3.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-11-30T07:34:24+00:00" + }, + { + "name": "sebastian/resource-operations", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "31d35ca87926450c44eae7e2611d45a7a65ea8b3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/31d35ca87926450c44eae7e2611d45a7a65ea8b3", + "reference": "31d35ca87926450c44eae7e2611d45a7a65ea8b3", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "support": { + "issues": "https://github.com/sebastianbergmann/resource-operations/issues", + "source": "https://github.com/sebastianbergmann/resource-operations/tree/2.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-11-30T07:30:19+00:00" + }, + { + "name": "sebastian/type", + "version": "1.1.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/type.git", + "reference": "0150cfbc4495ed2df3872fb31b26781e4e077eb4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/0150cfbc4495ed2df3872fb31b26781e4e077eb4", + "reference": "0150cfbc4495ed2df3872fb31b26781e4e077eb4", "shasum": "" }, "require": { - "ext-json": "*", - "ext-tokenizer": "*", - "nikic/php-parser": "~4.0|~3.0|~2.0|~1.3", - "php": "^8.0 || ^7.0 || ^5.5.9", - "symfony/console": "~5.0|~4.0|~3.0|^2.4.2|~2.3.10", - "symfony/var-dumper": "~5.0|~4.0|~3.0|~2.7" + "php": ">=7.2" }, "require-dev": { - "bamarni/composer-bin-plugin": "^1.2", - "hoa/console": "3.17.*" - }, - "suggest": { - "ext-pcntl": "Enabling the PCNTL extension makes PsySH a lot happier :)", - "ext-pdo-sqlite": "The doc command requires SQLite to work.", - "ext-posix": "If you have PCNTL, you'll want the POSIX extension as well.", - "ext-readline": "Enables support for arrow-key history navigation, and showing and manipulating command history.", - "hoa/console": "A pure PHP readline implementation. You'll want this if your PHP install doesn't already support readline or libedit." + "phpunit/phpunit": "^8.2" }, - "bin": [ - "bin/psysh" - ], "type": "library", "extra": { "branch-alias": { - "dev-main": "0.10.x-dev" + "dev-master": "1.1-dev" } }, "autoload": { - "files": [ - "src/functions.php" - ], - "psr-4": { - "Psy\\": "src/" - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Justin Hileman", - "email": "justin@justinhileman.info", - "homepage": "http://justinhileman.com" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "An interactive shell for modern PHP.", - "homepage": "http://psysh.org", - "keywords": [ - "REPL", - "console", - "interactive", - "shell" - ], + "description": "Collection of value objects that represent the types of the PHP type system", + "homepage": "https://github.com/sebastianbergmann/type", "support": { - "issues": "https://github.com/bobthecow/psysh/issues", - "source": "https://github.com/bobthecow/psysh/tree/v0.10.8" + "issues": "https://github.com/sebastianbergmann/type/issues", + "source": "https://github.com/sebastianbergmann/type/tree/1.1.4" }, - "time": "2021-04-10T16:23:39+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-11-30T07:25:11+00:00" }, { - "name": "react/promise", - "version": "v2.8.0", + "name": "sebastian/version", + "version": "2.0.1", "source": { "type": "git", - "url": "https://github.com/reactphp/promise.git", - "reference": "f3cff96a19736714524ca0dd1d4130de73dbbbc4" + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/reactphp/promise/zipball/f3cff96a19736714524ca0dd1d4130de73dbbbc4", - "reference": "f3cff96a19736714524ca0dd1d4130de73dbbbc4", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", "shasum": "" }, "require": { - "php": ">=5.4.0" - }, - "require-dev": { - "phpunit/phpunit": "^7.0 || ^6.5 || ^5.7 || ^4.8.36" + "php": ">=5.6" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, "autoload": { - "psr-4": { - "React\\Promise\\": "src/" - }, - "files": [ - "src/functions_include.php" + "classmap": [ + "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Jan Sorgalla", - "email": "jsorgalla@gmail.com" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "A lightweight implementation of CommonJS Promises/A for PHP", - "keywords": [ - "promise", - "promises" - ], + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", "support": { - "issues": "https://github.com/reactphp/promise/issues", - "source": "https://github.com/reactphp/promise/tree/v2.8.0" + "issues": "https://github.com/sebastianbergmann/version/issues", + "source": "https://github.com/sebastianbergmann/version/tree/master" }, - "time": "2020-05-12T15:16:56+00:00" + "time": "2016-10-03T07:35:21+00:00" }, { "name": "seld/jsonlint", @@ -3357,82 +5508,6 @@ ], "time": "2021-08-04T21:20:46+00:00" }, - { - "name": "symfony/polyfill-php72", - "version": "v1.23.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "9a142215a36a3888e30d0a9eeea9766764e96976" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/9a142215a36a3888e30d0a9eeea9766764e96976", - "reference": "9a142215a36a3888e30d0a9eeea9766764e96976", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php72\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php72/tree/v1.23.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-05-27T09:17:38+00:00" - }, { "name": "symfony/process", "version": "v5.3.7", @@ -3497,33 +5572,32 @@ }, { "name": "symfony/var-dumper", - "version": "v4.4.30", + "version": "v5.3.7", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "7f65c44c2ce80d3a0fcdb6385ee0ad535e45660c" + "reference": "3ad5af4aed07d0a0201bbcfc42658fe6c5b2fb8f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/7f65c44c2ce80d3a0fcdb6385ee0ad535e45660c", - "reference": "7f65c44c2ce80d3a0fcdb6385ee0ad535e45660c", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/3ad5af4aed07d0a0201bbcfc42658fe6c5b2fb8f", + "reference": "3ad5af4aed07d0a0201bbcfc42658fe6c5b2fb8f", "shasum": "" }, "require": { - "php": ">=7.1.3", + "php": ">=7.2.5", "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php72": "~1.5", "symfony/polyfill-php80": "^1.16" }, "conflict": { - "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0", - "symfony/console": "<3.4" + "phpunit/phpunit": "<5.4.3", + "symfony/console": "<4.4" }, "require-dev": { "ext-iconv": "*", - "symfony/console": "^3.4|^4.0|^5.0", + "symfony/console": "^4.4|^5.0", "symfony/process": "^4.4|^5.0", - "twig/twig": "^1.43|^2.13|^3.0.4" + "twig/twig": "^2.13|^3.0.4" }, "suggest": { "ext-iconv": "To convert non-UTF-8 strings to UTF-8 (or symfony/polyfill-iconv in case ext-iconv cannot be used).", @@ -3566,7 +5640,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v4.4.30" + "source": "https://github.com/symfony/var-dumper/tree/v5.3.7" }, "funding": [ { @@ -3582,47 +5656,100 @@ "type": "tidelift" } ], - "time": "2021-08-04T20:31:23+00:00" + "time": "2021-08-04T23:19:25+00:00" }, { - "name": "twig/twig", - "version": "v1.44.5", + "name": "theseer/tokenizer", + "version": "1.2.1", "source": { "type": "git", - "url": "https://github.com/twigphp/Twig.git", - "reference": "dd4353357c5a116322e92a00d16043a31881a81e" + "url": "https://github.com/theseer/tokenizer.git", + "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/dd4353357c5a116322e92a00d16043a31881a81e", - "reference": "dd4353357c5a116322e92a00d16043a31881a81e", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e", + "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/polyfill-ctype": "^1.8" + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + } + ], + "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "support": { + "issues": "https://github.com/theseer/tokenizer/issues", + "source": "https://github.com/theseer/tokenizer/tree/1.2.1" + }, + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2021-07-28T10:34:58+00:00" + }, + { + "name": "twig/markdown-extra", + "version": "v3.3.3", + "source": { + "type": "git", + "url": "https://github.com/twigphp/markdown-extra.git", + "reference": "725a4ef89d93bb80fc63c67cf261bf7512649290" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/twigphp/markdown-extra/zipball/725a4ef89d93bb80fc63c67cf261bf7512649290", + "reference": "725a4ef89d93bb80fc63c67cf261bf7512649290", + "shasum": "" + }, + "require": { + "php": ">=7.1.3", + "twig/twig": "^2.4|^3.0" }, "require-dev": { - "psr/container": "^1.0", - "symfony/phpunit-bridge": "^4.4.9|^5.0.9" + "erusev/parsedown": "^1.7", + "league/commonmark": "^1.0", + "league/html-to-markdown": "^4.8|^5.0", + "michelf/php-markdown": "^1.8", + "symfony/phpunit-bridge": "^4.4.9|^5.0.9|^6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.44-dev" + "dev-master": "3.2-dev" } }, "autoload": { - "psr-0": { - "Twig_": "lib/" - }, "psr-4": { - "Twig\\": "src/" - } + "Twig\\Extra\\Markdown\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { @@ -3630,25 +5757,17 @@ "email": "fabien@symfony.com", "homepage": "http://fabien.potencier.org", "role": "Lead Developer" - }, - { - "name": "Twig Team", - "role": "Contributors" - }, - { - "name": "Armin Ronacher", - "email": "armin.ronacher@active-4.com", - "role": "Project Founder" } ], - "description": "Twig, the flexible, fast, and secure template language for PHP", + "description": "A Twig extension for Markdown", "homepage": "https://twig.symfony.com", "keywords": [ - "templating" + "html", + "markdown", + "twig" ], "support": { - "issues": "https://github.com/twigphp/Twig/issues", - "source": "https://github.com/twigphp/Twig/tree/v1.44.5" + "source": "https://github.com/twigphp/markdown-extra/tree/v3.3.3" }, "funding": [ { @@ -3660,89 +5779,118 @@ "type": "tidelift" } ], - "time": "2021-09-17T08:35:19+00:00" + "time": "2021-07-07T07:08:18+00:00" }, { - "name": "umpirsky/twig-php-function", - "version": "v0.1", + "name": "twig/twig", + "version": "v3.3.3", "source": { "type": "git", - "url": "https://github.com/umpirsky/twig-php-function.git", - "reference": "53b4b1eb0c5eacbd7d66c504b7d809c79b4bedbc" + "url": "https://github.com/twigphp/Twig.git", + "reference": "a27fa056df8a6384316288ca8b0fa3a35fdeb569" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/umpirsky/twig-php-function/zipball/53b4b1eb0c5eacbd7d66c504b7d809c79b4bedbc", - "reference": "53b4b1eb0c5eacbd7d66c504b7d809c79b4bedbc", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/a27fa056df8a6384316288ca8b0fa3a35fdeb569", + "reference": "a27fa056df8a6384316288ca8b0fa3a35fdeb569", "shasum": "" }, "require": { - "php": ">=5.3.3", - "twig/twig": "~1.12" + "php": ">=7.2.5", + "symfony/polyfill-ctype": "^1.8", + "symfony/polyfill-mbstring": "^1.3" }, "require-dev": { - "phpspec/phpspec": "~2.0", - "phpunit/phpunit": "~4.4" + "psr/container": "^1.0", + "symfony/phpunit-bridge": "^4.4.9|^5.0.9|^6.0" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.3-dev" + } + }, "autoload": { - "psr-0": { - "Umpirsky\\": "src/" + "psr-4": { + "Twig\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Saša Stamenković", - "email": "umpirsky@gmail.com" + "name": "Fabien Potencier", + "email": "fabien@symfony.com", + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" + }, + { + "name": "Twig Team", + "role": "Contributors" + }, + { + "name": "Armin Ronacher", + "email": "armin.ronacher@active-4.com", + "role": "Project Founder" } ], - "description": "Call (almost) any PHP function from your Twig templates.", + "description": "Twig, the flexible, fast, and secure template language for PHP", + "homepage": "https://twig.symfony.com", + "keywords": [ + "templating" + ], "support": { - "issues": "https://github.com/umpirsky/twig-php-function/issues", - "source": "https://github.com/umpirsky/twig-php-function/tree/master" + "issues": "https://github.com/twigphp/Twig/issues", + "source": "https://github.com/twigphp/Twig/tree/v3.3.3" }, - "time": "2016-03-12T16:36:32+00:00" + "funding": [ + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/twig/twig", + "type": "tidelift" + } + ], + "time": "2021-09-17T08:44:23+00:00" }, { - "name": "wyrihaximus/twig-view", - "version": "4.4.0", + "name": "webmozart/assert", + "version": "1.10.0", "source": { "type": "git", - "url": "https://github.com/cakephp/legacy-twig-view.git", - "reference": "463e1a6ed493d4fe99eaeaaf39d80172b51fc0fb" + "url": "https://github.com/webmozarts/assert.git", + "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cakephp/legacy-twig-view/zipball/463e1a6ed493d4fe99eaeaaf39d80172b51fc0fb", - "reference": "463e1a6ed493d4fe99eaeaaf39d80172b51fc0fb", + "url": "https://api.github.com/repos/webmozarts/assert/zipball/6964c76c7804814a842473e0c8fd15bab0f18e25", + "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25", "shasum": "" }, "require": { - "ajgl/breakpoint-twig-extension": "^0.3.0", - "aptoma/twig-markdown": "^2.0", - "asm89/twig-cache-extension": "^1.0", - "cakephp/cakephp": "^3.7", - "jasny/twig-extensions": "^1.0", - "php": "^5.6 || ^7.0", - "twig/twig": "^1.27", - "umpirsky/twig-php-function": "0.1" + "php": "^7.2 || ^8.0", + "symfony/polyfill-ctype": "^1.8" + }, + "conflict": { + "phpstan/phpstan": "<0.12.20", + "vimeo/psalm": "<4.6.1 || 4.6.2" }, "require-dev": { - "cakephp/bake": "^1.5", - "cakephp/debug_kit": "^3.0", - "phake/phake": "^2.3.2", - "phpunit/phpunit": "^5.7.14", - "squizlabs/php_codesniffer": "^3.4.0", - "wyrihaximus/phpunit-class-reflection-helpers": "dev-master" + "phpunit/phpunit": "^8.5.13" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.10-dev" + } }, - "type": "cakephp-plugin", "autoload": { "psr-4": { - "WyriHaximus\\TwigView\\": "src/" + "Webmozart\\Assert\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -3751,23 +5899,21 @@ ], "authors": [ { - "name": "Cees-Jan Kiewiet", - "email": "ceesjank@gmail.com", - "homepage": "http://wyrihaximus.net/" + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" } ], - "description": "Twig powered View for CakePHP3", + "description": "Assertions to validate method input/output with nice error messages.", "keywords": [ - "cakephp", - "cakephp3", - "twig", - "view" + "assert", + "check", + "validate" ], "support": { - "issues": "https://github.com/cakephp/legacy-twig-view/issues", - "source": "https://github.com/cakephp/legacy-twig-view/tree/4.4.0" + "issues": "https://github.com/webmozarts/assert/issues", + "source": "https://github.com/webmozarts/assert/tree/1.10.0" }, - "time": "2021-04-06T15:42:50+00:00" + "time": "2021-03-09T10:59:23+00:00" } ], "aliases": [], @@ -3778,7 +5924,7 @@ "prefer-stable": true, "prefer-lowest": false, "platform": { - "php": ">=5.6" + "php": ">=7.2" }, "platform-dev": [], "plugin-api-version": "2.1.0" diff --git a/app/config/app.php b/app/config/app.php index 6b7c82a1..9f35ce8b 100644 --- a/app/config/app.php +++ b/app/config/app.php @@ -25,6 +25,13 @@ * @license Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0) */ +use Cake\Cache\Engine\FileEngine; +use Cake\Database\Connection; +use Cake\Database\Driver\Mysql; +use Cake\Error\ExceptionRenderer; +use Cake\Log\Engine\FileLog; +use Cake\Mailer\Transport\MailTransport; + return [ /** * Debug Level: @@ -37,7 +44,7 @@ */ 'debug' => filter_var(env('DEBUG', false), FILTER_VALIDATE_BOOLEAN), - /** + /* * Configure basic information about the application. * * - namespace - The namespace to find app classes under. @@ -54,7 +61,10 @@ * /.htaccess * /webroot/.htaccess * And uncomment the baseUrl key below. - * - fullBaseUrl - A base URL to use for absolute links. + * - fullBaseUrl - A base URL to use for absolute links. When set to false (default) + * CakePHP generates required value based on `HTTP_HOST` environment variable. + * However, you can define it manually to optimize performance or if you + * are concerned about people manipulating the `Host` header. * - imageBaseUrl - Web path to the public images directory under webroot. * - cssBaseUrl - Web path to the public css directory under webroot. * - jsBaseUrl - Web path to the public js directory under webroot. @@ -66,36 +76,36 @@ 'namespace' => 'App', 'encoding' => env('APP_ENCODING', 'UTF-8'), 'defaultLocale' => env('APP_DEFAULT_LOCALE', 'en_US'), + 'defaultTimezone' => env('APP_DEFAULT_TIMEZONE', 'UTC'), 'base' => false, 'dir' => 'src', 'webroot' => 'webroot', 'wwwRoot' => WWW_ROOT, - // 'baseUrl' => env('SCRIPT_NAME'), + //'baseUrl' => env('SCRIPT_NAME'), 'fullBaseUrl' => false, 'imageBaseUrl' => 'img/', 'cssBaseUrl' => 'css/', 'jsBaseUrl' => 'js/', 'paths' => [ 'plugins' => [ROOT . DS . 'plugins' . DS], - 'templates' => [APP . 'Template' . DS], - 'locales' => [APP . 'Locale' . DS], + 'templates' => [ROOT . DS . 'templates' . DS], + 'locales' => [RESOURCES . 'locales' . DS], ], ], - /** + /* * Security and encryption configuration * * - salt - A random string used in security hashing methods. * The salt value is also used as the encryption key. * You should treat it as extremely sensitive data. */ - 'Security' => [ // Note that we (COmanage) override this in bootstrap.php 'salt' => env('SECURITY_SALT', '22a0feb8115478995505ee6275de27f42ff79e9876794c6762cb75ea853986af'), ], - /** + /* * Apply timestamps with the last modified time to static assets (js, css, images). * Will append a querystring parameter containing the time the file was modified. * This is useful for busting browser caches. @@ -104,51 +114,66 @@ * enable timestamping regardless of debug value. */ 'Asset' => [ - 'timestamp' => true, + 'timestamp' => true, + // 'cacheTime' => '+1 year' ], - /** + /* * Configure the cache adapters. */ 'Cache' => [ 'default' => [ - 'className' => 'File', + 'className' => FileEngine::class, 'path' => CACHE, 'url' => env('CACHE_DEFAULT_URL', null), ], - /** + /* * Configure the cache used for general framework caching. * Translation cache files are stored with this configuration. * Duration will be set to '+2 minutes' in bootstrap.php when debug = true * If you set 'className' => 'Null' core cache will be disabled. */ '_cake_core_' => [ - 'className' => 'Null', // 'File', + 'className' => 'Null', // FileEngine::class 'prefix' => 'myapp_cake_core_', - 'path' => CACHE . 'persistent/', + 'path' => CACHE . 'persistent' . DS, 'serialize' => true, 'duration' => '+1 years', 'url' => env('CACHE_CAKECORE_URL', null), ], - /** + /* * Configure the cache for model and datasource caches. This cache * configuration is used to store schema descriptions, and table listings * in connections. * Duration will be set to '+2 minutes' in bootstrap.php when debug = true */ '_cake_model_' => [ - 'className' => 'Null', //'File', + 'className' => 'Null', // FileEngine::class 'prefix' => 'myapp_cake_model_', - 'path' => CACHE . 'models/', + 'path' => CACHE . 'models' . DS, 'serialize' => true, 'duration' => '+1 years', 'url' => env('CACHE_CAKEMODEL_URL', null), ], + + /* + * Configure the cache for routes. The cached routes collection is built the + * first time the routes are processed through `config/routes.php`. + * Duration will be set to '+2 seconds' in bootstrap.php when debug = true + */ + '_cake_routes_' => [ + 'className' => 'Null', // FileEngine::class + 'prefix' => 'myapp_cake_routes_', + 'path' => CACHE, + 'serialize' => true, + 'duration' => '+1 years', + 'url' => env('CACHE_CAKEROUTES_URL', null), + ], ], - /** + /* * Configure the Error and Exception handlers used by your application. * * By default errors are displayed using Debugger, when debug is true and logged @@ -172,20 +197,40 @@ * - `skipLog` - array - List of exceptions to skip for logging. Exceptions that * extend one of the listed exceptions will also be skipped for logging. * E.g.: - * `'skipLog' => ['Cake\Network\Exception\NotFoundException', 'Cake\Network\Exception\UnauthorizedException']` + * `'skipLog' => ['Cake\Http\Exception\NotFoundException', 'Cake\Http\Exception\UnauthorizedException']` * - `extraFatalErrorMemory` - int - The number of megabytes to increase * the memory limit by when a fatal error is encountered. This allows * breathing room to complete logging or error handling. + * - `ignoredDeprecationPaths` - array - A list of glob compatible file paths that deprecations + * should be ignored in. Use this to ignore deprecations for plugins or parts of + * your application that still emit deprecations. */ 'Error' => [ 'errorLevel' => E_ALL, - 'exceptionRenderer' => 'Cake\Error\ExceptionRenderer', + 'exceptionRenderer' => ExceptionRenderer::class, 'skipLog' => [], 'log' => true, 'trace' => true, + 'ignoredDeprecationPaths' => [], ], - /** + /* + * Debugger configuration + * + * Define development error values for Cake\Error\Debugger + * + * - `editor` Set the editor URL format you want to use. + * By default atom, emacs, macvim, phpstorm, sublime, textmate, and vscode are + * available. You can add additional editor link formats using + * `Debugger::addEditor()` during your application bootstrap. + * - `outputMask` A mapping of `key` to `replacement` values that + * `Debugger` should replace in dumped data and logs generated by `Debugger`. + */ + 'Debugger' => [ + 'editor' => 'phpstorm', + ], + + /* * Email configuration. * * By defining transports separately from delivery profiles you can easily @@ -208,20 +253,23 @@ * 'EmailTransport' => [ 'default' => [ - 'className' => 'Mail', - // The following keys are used in SMTP transports + 'className' => MailTransport::class, + * The keys host, port, timeout, username, password, client and tls + * are used in SMTP transports 'host' => 'localhost', 'port' => 25, 'timeout' => 30, - 'username' => null, - 'password' => null, + * It is recommended to set these options through your environment or app_local.php + //'username' => null, + //'password' => null, 'client' => null, - 'tls' => null, + 'tls' => false, 'url' => env('EMAIL_TRANSPORT_DEFAULT_URL', null), ], ], + */ - /** + /* * Email delivery profiles * * Delivery profiles allow you to predefine various properties about email @@ -234,44 +282,46 @@ 'default' => [ 'transport' => 'default', 'from' => 'you@localhost', + * Will by default be set to config value of App.encoding, if that exists otherwise to UTF-8. //'charset' => 'utf-8', //'headerCharset' => 'utf-8', ], ], */ - /** + /* * Connection information used by the ORM to connect * to your application's datastores. - * Do not use periods in database name - it may lead to error. - * See https://github.com/cakephp/cakephp/issues/6471 for details. - * Drivers include Mysql Postgres Sqlite Sqlserver - * See vendor\cakephp\cakephp\src\Database\Driver for complete list * + * ### Notes + * - Drivers include Mysql Postgres Sqlite Sqlserver + * See vendor\cakephp\cakephp\src\Database\Driver for complete list + * - Do not use periods in database name - it may lead to error. + * See https://github.com/cakephp/cakephp/issues/6471 for details. + * - 'encoding' is recommended to be set to full UTF-8 4-Byte support. + * E.g set it to 'utf8mb4' in MariaDB and MySQL and 'utf8' for any + * other RDBMS. * Note for COmanage we read in local/Config/database.php instead * 'Datasources' => [ 'default' => [ - 'className' => 'Cake\Database\Connection', - 'driver' => 'Cake\Database\Driver\Postgres', + 'className' => Connection::class, + 'driver' => Mysql::class, 'persistent' => false, - 'host' => 'localhost', - /** - * CakePHP will use the default DB port based on the driver selected - * MySQL on MAMP uses port 8889, MAMP users will want to uncomment - * the following line and set the port accordingly - * - //'port' => 'non_standard_port_number', - 'username' => 'comatch', - 'password' => '', - 'database' => 'matchtest', - 'encoding' => 'utf8', 'timezone' => 'UTC', + + * For MariaDB/MySQL the internal default changed from utf8 to utf8mb4, aka full utf-8 support, in CakePHP 3.6 + //'encoding' => 'utf8mb4', + + * If your MySQL server is configured with `skip-character-set-client-handshake` + * then you MUST use the `flags` config to set your charset encoding. + * For e.g. `'flags' => [\PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8mb4']` + 'flags' => [], 'cacheMetadata' => true, 'log' => true, //false, - /** + /* * Set identifier quoting to true if you are using reserved words or * special characters in your table or column names. Enabling this * setting will result in queries built using the Query Builder having @@ -292,36 +342,32 @@ 'url' => env('DATABASE_URL', null), ], + */ - /** + /* * The test connection is used during the test suite. * 'test' => [ - 'className' => 'Cake\Database\Connection', - 'driver' => 'Cake\Database\Driver\Postgres', + 'className' => Connection::class, + 'driver' => Mysql::class, 'persistent' => false, - 'host' => 'localhost', - //'port' => 'non_standard_port_number', - 'username' => 'my_app', - 'password' => 'secret', - 'database' => 'test_myapp', - 'encoding' => 'utf8', 'timezone' => 'UTC', + //'encoding' => 'utf8mb4', + 'flags' => [], 'cacheMetadata' => true, 'quoteIdentifiers' => false, 'log' => false, //'init' => ['SET GLOBAL innodb_stats_on_metadata = 0'], - 'url' => env('DATABASE_TEST_URL', null), ], ], */ - /** + /* * Configures logging options */ 'Log' => [ 'debug' => [ - 'className' => 'Cake\Log\Engine\FileLog', + 'className' => FileLog::class, 'path' => LOGS, 'file' => 'debug', 'url' => env('LOG_DEBUG_URL', null), @@ -329,7 +375,7 @@ 'levels' => ['notice', 'info', 'debug'], ], 'error' => [ - 'className' => 'Cake\Log\Engine\FileLog', + 'className' => FileLog::class, 'path' => LOGS, 'file' => 'error', 'url' => env('LOG_ERROR_URL', null), @@ -338,7 +384,7 @@ ], // To enable this dedicated query log, you need set your datasource's log flag to true 'queries' => [ - 'className' => 'Cake\Log\Engine\FileLog', + 'className' => FileLog::class, 'path' => LOGS, 'file' => 'queries', 'url' => env('LOG_QUERIES_URL', null), @@ -346,7 +392,7 @@ ], ], - /** + /* * Session configuration. * * Contains an array of settings to use for session configuration. The @@ -355,8 +401,8 @@ * * ## Options * - * - `cookie` - The name of the cookie to use. Defaults to 'CAKEPHP'. Avoid using `.` in cookie names, - * as PHP will drop sessions from cookies with `.` in the name. + * - `cookie` - The name of the cookie to use. Defaults to value set for `session.name` php.ini config. + * Avoid using `.` in cookie names, as PHP will drop sessions from cookies with `.` in the name. * - `cookiePath` - The url path for which session cookie is set. Maps to the * `session.cookie_path` php.ini config. Defaults to base path of app. * - `timeout` - The time in minutes the session should be valid for. diff --git a/app/config/bootstrap.php b/app/config/bootstrap.php index 667287a4..b4731833 100644 --- a/app/config/bootstrap.php +++ b/app/config/bootstrap.php @@ -1,4 +1,6 @@ parse() @@ -78,14 +89,12 @@ } /* - * Load an environment local configuration file. - * You can use a file like app_local.php to provide local overrides to your - * shared configuration. + * Load an environment local configuration file to provide overrides to your configuration. + * Notice: For security reasons app_local.php **should not** be included in your git repo. */ -//Configure::load('app_local', 'default'); - -// This is set in app.php -//Configure::write('debug', false); +if (file_exists(CONFIG . 'app_local.php')) { + Configure::load('app_local', 'default'); +} /* * When debug = true the metadata cache should only last @@ -95,14 +104,14 @@ Cache::disable(); // Configure::write('Cache._cake_model_.duration', '+2 minutes'); // Configure::write('Cache._cake_core_.duration', '+2 minutes'); +// Configure::write('Cache._cake_routes_.duration', '+2 seconds'); } /* - * Set server timezone to UTC. You can change it to another timezone of your - * choice but using UTC makes time calculations / conversions easier. + * Set the default server timezone. Using UTC makes time calculations / conversions easier. * Check http://php.net/manual/en/timezones.php for list of valid timezone strings. */ -date_default_timezone_set('UTC'); +date_default_timezone_set(Configure::read('App.defaultTimezone')); /* * Configure the mbstring extension to use the correct encoding. @@ -129,16 +138,15 @@ * Include the CLI bootstrap overrides. */ if ($isCli) { - require __DIR__ . '/bootstrap_cli.php'; + require CONFIG . 'bootstrap_cli.php'; } /* * Set the full base URL. * This URL is used as the base of all absolute links. - * - * If you define fullBaseUrl in your config file you can remove this. */ -if (!Configure::read('App.fullBaseUrl')) { +$fullBaseUrl = Configure::read('App.fullBaseUrl'); +if (!$fullBaseUrl) { $s = null; if (env('HTTPS')) { $s = 's'; @@ -146,15 +154,19 @@ $httpHost = env('HTTP_HOST'); if (isset($httpHost)) { - Configure::write('App.fullBaseUrl', 'http' . $s . '://' . $httpHost); + $fullBaseUrl = 'http' . $s . '://' . $httpHost; } unset($httpHost, $s); } +if ($fullBaseUrl) { + Router::fullBaseUrl($fullBaseUrl); +} +unset($fullBaseUrl); Cache::setConfig(Configure::consume('Cache')); ConnectionManager::setConfig(Configure::consume('Datasources')); TransportFactory::setConfig(Configure::consume('EmailTransport')); -Email::setConfig(Configure::consume('Email')); +Mailer::setConfig(Configure::consume('Email')); Log::setConfig(Configure::consume('Log')); // Set the salt based on our local configuration $securitySaltFile = LOCAL . DS . "Config" . DS . "security.salt"; @@ -187,21 +199,34 @@ }); /* - * Enable immutable time objects in the ORM. + * You can set whether the ORM uses immutable or mutable Time types. + * The default changed in 4.0 to immutable types. You can uncomment + * below to switch back to mutable types. * * You can enable default locale format parsing by adding calls * to `useLocaleParser()`. This enables the automatic conversion of * locale specific date formats. For details see - * @link https://book.cakephp.org/3.0/en/core-libraries/internationalization-and-localization.html#parsing-localized-datetime-data - */ -Type::build('time') - ->useImmutable(); -Type::build('date') - ->useImmutable(); -Type::build('datetime') - ->useImmutable(); -Type::build('timestamp') - ->useImmutable(); + * @link https://book.cakephp.org/4/en/core-libraries/internationalization-and-localization.html#parsing-localized-datetime-data + */ + \Cake\Database\TypeFactory::build('time') + ->useMutable(); + \Cake\Database\TypeFactory::build('date') + ->useMutable(); + \Cake\Database\TypeFactory::build('datetime') + ->useMutable(); + \Cake\Database\TypeFactory::build('timestamp') + ->useMutable(); +// \Cake\Database\TypeFactory::build('datetimefractional') +// ->useMutable(); +// \Cake\Database\TypeFactory::build('timestampfractional') +// ->useMutable(); +// \Cake\Database\TypeFactory::build('datetimetimezone') +// ->useMutable(); +// \Cake\Database\TypeFactory::build('timestamptimezone') +// ->useMutable(); + +// There is no time-specific type in Cake +TypeFactory::map('time', StringType::class); /* * Custom Inflector rules, can be set to correctly pluralize or singularize diff --git a/app/config/bootstrap_cli.php b/app/config/bootstrap_cli.php index 8f67c453..fc0dc30b 100644 --- a/app/config/bootstrap_cli.php +++ b/app/config/bootstrap_cli.php @@ -1,4 +1,6 @@ = 50.1 is needed to use CakePHP. Please update the `libicu` package of your system.' . PHP_EOL, E_USER_ERROR); } /* * You can remove this if you are confident you have mbstring installed. */ if (!extension_loaded('mbstring')) { - trigger_error('You must enable the mbstring extension to use CakePHP.' . PHP_EOL, E_USER_ERROR); + trigger_error('You must enable the mbstring extension to use CakePHP.', E_USER_ERROR); } diff --git a/app/config/routes.php b/app/config/routes.php index 31198f02..ae555ec0 100644 --- a/app/config/routes.php +++ b/app/config/routes.php @@ -1,11 +1,14 @@ setRouteClass(DashedRoute::class); -Router::scope('/', function (RouteBuilder $routes) { - /** +$routes->scope('/', function (RouteBuilder $builder) { + /* * Here, we are connecting '/' (base path) to a controller called 'Pages', * its action called 'display', and we pass a param to select the view file - * to use (in this case, src/Template/Pages/home.ctp)... + * to use (in this case, templates/Pages/home.php)... */ - $routes->connect('/', ['controller' => 'Pages', 'action' => 'display', 'home']); + $builder->connect('/', ['controller' => 'Pages', 'action' => 'display', 'home']); - /** + /* * ...and connect the rest of 'Pages' controller's URLs. */ - $routes->connect('/pages/*', ['controller' => 'Pages', 'action' => 'display']); + $builder->connect('/pages/*', 'Pages::display'); /** * TIER ID Match API Routes */ // Match Request - $routes->get('/api/:matchgrid_id/v1/matchRequests/:id', ['controller' => 'TierApi', 'action' => 'viewMatchRequest']); - $routes->get('/api/:matchgrid_id/v1/matchRequests', ['controller' => 'TierApi', 'action' => 'viewMatchRequests']); - $routes->put('/api/:matchgrid_id/v1/people/:sor/:sorid', ['controller' => 'TierApi', 'action' => 'match']); - $routes->post('/api/:matchgrid_id/v1/people/:sor/:sorid', ['controller' => 'TierApi', 'action' => 'search']); + $builder->get('/api/:matchgrid_id/v1/matchRequests/:id', ['controller' => 'TierApi', 'action' => 'viewMatchRequest']); + $builder->get('/api/:matchgrid_id/v1/matchRequests', ['controller' => 'TierApi', 'action' => 'viewMatchRequests']); + $builder->put('/api/:matchgrid_id/v1/people/:sor/:sorid', ['controller' => 'TierApi', 'action' => 'match']); + $builder->post('/api/:matchgrid_id/v1/people/:sor/:sorid', ['controller' => 'TierApi', 'action' => 'search']); // This doesn't match and we end up in current(), so we just check there // Also, as of API v1.0.0, search over GET has been removed -// $routes->get('/api/:matchgrid_id/v1/people/:sor/:sorid?*', ['controller' => 'TierApi', 'action' => 'search']); - $routes->delete('/api/:matchgrid_id/v1/people/:sor/:sorid', ['controller' => 'TierApi', 'action' => 'remove']); - $routes->get('/api/:matchgrid_id/v1/people/:sor/:sorid', ['controller' => 'TierApi', 'action' => 'current']); - $routes->get('/api/:matchgrid_id/v1/people/:sor', ['controller' => 'TierApi', 'action' => 'inventory']); - $routes->put('/api/:matchgrid_id/v1/referenceIds/:id', ['controller' => 'TierApi', 'action' => 'merge']); +// $builder->get('/api/:matchgrid_id/v1/people/:sor/:sorid?*', ['controller' => 'TierApi', 'action' => 'search']); + $builder->delete('/api/:matchgrid_id/v1/people/:sor/:sorid', ['controller' => 'TierApi', 'action' => 'remove']); + $builder->get('/api/:matchgrid_id/v1/people/:sor/:sorid', ['controller' => 'TierApi', 'action' => 'current']); + $builder->get('/api/:matchgrid_id/v1/people/:sor', ['controller' => 'TierApi', 'action' => 'inventory']); + $builder->put('/api/:matchgrid_id/v1/referenceIds/:id', ['controller' => 'TierApi', 'action' => 'merge']); /** * Connect catchall routes for all controllers. * - * Using the argument `DashedRoute`, the `fallbacks` method is a shortcut for - * `$routes->connect('/:controller', ['action' => 'index'], ['routeClass' => 'DashedRoute']);` - * `$routes->connect('/:controller/:action/*', [], ['routeClass' => 'DashedRoute']);` + * The `fallbacks` method is a shortcut for * - * Any route class can be used with this method, such as: - * - DashedRoute - * - InflectedRoute - * - Route - * - Or your own route class + * ``` + * $builder->connect('/{controller}', ['action' => 'index']); + * $builder->connect('/{controller}/{action}/*', []); + * ``` * * You can remove these routes once you've connected the * routes you want in your application. */ - $routes->fallbacks(DashedRoute::class); + $builder->fallbacks(); }); -/** - * Load all plugin routes. See the Plugin documentation on - * how to customize the loading of plugin routes. +/* + * If you need a different set of middleware or none at all, + * open new scope and define routes there. + * + * ``` + * $routes->scope('/api', function (RouteBuilder $builder) { + * // No $builder->applyMiddleware() here. + * + * // Parse specified extensions from URLs + * // $builder->setExtensions(['json', 'xml']); * - * As of Cake v3.6 it is no longer necessary to call this - * Plugin::routes(); + * // Connect API actions here. + * }); + * ``` */ diff --git a/app/src/Locale/en_US/default.po b/app/resources/locales/en_US/default.po similarity index 100% rename from app/src/Locale/en_US/default.po rename to app/resources/locales/en_US/default.po diff --git a/app/src/Application.php b/app/src/Application.php index dd259775..987dc775 100644 --- a/app/src/Application.php +++ b/app/src/Application.php @@ -37,7 +37,22 @@ class Application extends BaseApplication { * @return \Cake\Http\MiddlewareQueue The updated middleware queue. */ - public function middleware($middlewareQueue) { + public function middleware($middlewareQueue): \Cake\Http\MiddlewareQueue { + // loading csrf Middleware + $csrf = new CsrfProtectionMiddleware(['cookieName' => 'matchCsrfToken']); + $csrf->whitelistCallback(function (ServerRequestInterface $request) { + // skip controllers + $skipedControllers = ['TierApi']; // Controllers list + if(in_array($request->getParam('controller'), $skipedControllers, true)) { + return true; + } + // skip debugkit + if($request->getParam('plugin') == 'DebugKit') { + return true; + } + return $request; + }); + $middlewareQueue // Catch any exceptions in the lower layers, // and make an error page/response @@ -57,19 +72,7 @@ public function middleware($middlewareQueue) { // https://stackoverflow.com/questions/47714940/cakephp-3-5-6-disable-csrf-middleware-for-controller // https://stackoverflow.com/questions/51931406/post-requests-for-cakephp-3-api-are-not-working - ->add(function(ServerRequestInterface $request, - ResponseInterface $response, - callable $next) { - $params = $request->getAttribute('params'); - - if($params['controller'] == 'TierApi') { - // Do not enable CsrfProtectionMiddleware - return $next($request, $response); - } else { - $csrf = new CsrfProtectionMiddleware(['cookieName' => 'matchCsrfToken']); - return $csrf($request, $response, $next); - } - }); + ->add($csrf); return $middlewareQueue; } diff --git a/app/src/Command/BulkLoadCommand.php b/app/src/Command/BulkLoadCommand.php index 7fa2912f..ec29df1b 100644 --- a/app/src/Command/BulkLoadCommand.php +++ b/app/src/Command/BulkLoadCommand.php @@ -52,7 +52,7 @@ class BulkLoadCommand extends Command { * @return ConsoleOptionParser Console Option Parser */ - public function buildOptionParser(ConsoleOptionParser $parser) { + public function buildOptionParser(ConsoleOptionParser $parser): ConsoleOptionParser { $parser->addOption('matchgrid-id', [ 'help' => __('match.fd.matchgrid_id') ]) diff --git a/app/src/Command/SetupCommand.php b/app/src/Command/SetupCommand.php index f631308e..e40d3dfc 100644 --- a/app/src/Command/SetupCommand.php +++ b/app/src/Command/SetupCommand.php @@ -48,7 +48,7 @@ class SetupCommand extends Command { * @return ConsoleOptionParser Console Option Parser */ - public function buildOptionParser(ConsoleOptionParser $parser) { + public function buildOptionParser(ConsoleOptionParser $parser): ConsoleOptionParser { $parser->addOption('admin-username', [ 'help' => __('match.cmd.opt.admin-username') ])->addOption('force', [ @@ -106,7 +106,7 @@ public function execute(Arguments $args, ConsoleIo $io) { $io->out(__('match.cmd.se.admin')); $permissionsTable = TableRegistry::get('Permissions'); - $permission = $permissionsTable->newEntity(); + $permission = $permissionsTable->newEmptyEntity(); $permission->username = $user; $permission->matchgrid_id = null; diff --git a/app/src/Controller/ApiUsersController.php b/app/src/Controller/ApiUsersController.php index 906565d8..af685ade 100644 --- a/app/src/Controller/ApiUsersController.php +++ b/app/src/Controller/ApiUsersController.php @@ -30,6 +30,7 @@ namespace App\Controller; use Cake\Routing\Router; +use Cake\Event\EventInterface; class ApiUsersController extends StandardController { public $pagination = [ @@ -42,10 +43,10 @@ class ApiUsersController extends StandardController { * Callback run prior to the view rendering. * * @since COmanage Match v1.0.0 - * @param Event $event Cake Event + * @param \Cake\Event\EventInterface $event Cake Event */ - public function beforeRender(\Cake\Event\Event $event) { + public function beforeRender(EventInterface $event) { parent::beforeRender($event); // Populate a pointer to the REST API for configuration purposes diff --git a/app/src/Controller/AppController.php b/app/src/Controller/AppController.php index a412c0d2..9520a197 100644 --- a/app/src/Controller/AppController.php +++ b/app/src/Controller/AppController.php @@ -32,7 +32,7 @@ use Cake\Controller\Controller; use Cake\Datasource\Exception; use Cake\Datasource\Exception\RecordNotFoundException; -use Cake\Event\Event; +use Cake\Event\EventInterface; use Cake\ORM\TableRegistry; use InvalidArgumentException; @@ -50,7 +50,7 @@ class AppController extends Controller { * @since COmanage Match v1.0.0 */ - public function initialize() { + public function initialize(): void { parent::initialize(); // Load Components used by most or all controllers @@ -92,10 +92,10 @@ public function initialize() { * Callback run prior to the request action. * * @since COmanage Match v1.0.0 - * @param Event $event Cake Event + * @param \Cake\Event\EventInterface $event Cake Event */ - public function beforeFilter(\Cake\Event\Event $event) { + public function beforeFilter(EventInterface $event) { parent::beforeFilter($event); // Determine the timezone @@ -109,10 +109,10 @@ public function beforeFilter(\Cake\Event\Event $event) { * Callback run prior to the view rendering. * * @since COmanage Match v1.0.0 - * @param Event $event Cake Event + * @param \Cake\Event\EventInterface $event Cake Event */ - public function beforeRender(\Cake\Event\Event $event) { + public function beforeRender(EventInterface $event) { parent::beforeRender($event); // The current user, if authenticated diff --git a/app/src/Controller/Component/AuthorizationComponent.php b/app/src/Controller/Component/AuthorizationComponent.php index b8204898..21e915b0 100644 --- a/app/src/Controller/Component/AuthorizationComponent.php +++ b/app/src/Controller/Component/AuthorizationComponent.php @@ -43,7 +43,7 @@ class AuthorizationComponent extends Component { * @since COmanage Match v1.0.0 */ - public function initialize(array $config) { + public function initialize(array $config): void { parent::initialize($config); $this->Permissions = TableRegistry::get('Permissions'); diff --git a/app/src/Controller/ErrorController.php b/app/src/Controller/ErrorController.php index b7d4231b..c0778d91 100644 --- a/app/src/Controller/ErrorController.php +++ b/app/src/Controller/ErrorController.php @@ -14,7 +14,7 @@ */ namespace App\Controller; -use Cake\Event\Event; +use Cake\Event\EventInterface; /** * Error Handling Controller @@ -28,7 +28,7 @@ class ErrorController extends AppController * * @return void */ - public function initialize() + public function initialize(): void { $this->loadComponent('RequestHandler'); } @@ -36,20 +36,20 @@ public function initialize() /** * beforeFilter callback. * - * @param \Cake\Event\Event $event Event. + * @param \Cake\Event\EventInterface $event Event. * @return \Cake\Http\Response|null|void */ - public function beforeFilter(Event $event) + public function beforeFilter(EventInterface $event) { } /** * beforeRender callback. * - * @param \Cake\Event\Event $event Event. + * @param \Cake\Event\EventInterface $event Event. * @return \Cake\Http\Response|null|void */ - public function beforeRender(Event $event) + public function beforeRender(EventInterface $event) { parent::beforeRender($event); @@ -59,7 +59,7 @@ public function beforeRender(Event $event) /** * afterFilter callback. * - * @param \Cake\Event\Event $event Event. + * @param \Cake\Event\EventInterface $event Event. * @return \Cake\Http\Response|null|void */ public function afterFilter(Event $event) diff --git a/app/src/Controller/MatchgridRecordsController.php b/app/src/Controller/MatchgridRecordsController.php index ab0c72b9..28db151d 100644 --- a/app/src/Controller/MatchgridRecordsController.php +++ b/app/src/Controller/MatchgridRecordsController.php @@ -32,6 +32,7 @@ use Cake\Log\Log; use Cake\ORM\TableRegistry; use Cake\Utility\Hash; +use Cake\Event\EventInterface; use \App\Lib\Enum\ConfidenceModeEnum; use \App\Lib\Match\AttributeManager; @@ -51,7 +52,7 @@ class MatchgridRecordsController extends StandardController { * @since COmanage Match v1.0.0 */ - public function initialize() { + public function initialize(): void { parent::initialize(); // In order to configure MatchgridRecords with the correct table name, we @@ -131,7 +132,7 @@ public function add() { // We could coerce validation errors into a newEntity, but we probably don't have them // $this->set('vv_obj', $this->MatchgridRecords->newEntity($this->request->getData())); // Create an empty entity for FormHelper - $this->set('vv_obj', $this->MatchgridRecords->newEntity()); + $this->set('vv_obj', $this->MatchgridRecords->newEmptyEntity()); // We can't call parent::add, since it will try to reprocess the save, so we have // to manually make some calls. @@ -156,10 +157,10 @@ public function add() { * Callback run prior to the view rendering. * * @since COmanage Match v1.0.0 - * @param Event $event Cake Event + * @param \Cake\Event\EventInterface $event Cake Event */ - public function beforeRender(\Cake\Event\Event $event) { + public function beforeRender(EventInterface $event) { parent::beforeRender($event); // Pull the Matchgrid configuration in order to pass the attribute configuration. @@ -304,7 +305,7 @@ public function edit($id) { return $this->redirect([ 'action' => 'edit', $id, - 'matchgrid_id' => $this->cur_mg->id + '?' => ['matchgrid_id' => $this->cur_mg->id] ]); } catch(\Exception $e) { @@ -412,7 +413,7 @@ protected function performMatch(MatchService $MatchService, string $sor, string 'controller' => 'matchgrids', 'action' => 'reconcile', $this->cur_mg->id, - 'rowid' => $matchRequest + '?' => ['rowid' => $matchRequest] ]); } @@ -421,7 +422,7 @@ protected function performMatch(MatchService $MatchService, string $sor, string return $this->redirect([ 'action' => 'edit', $id, - 'matchgrid_id' => $this->cur_mg->id + '?' => ['matchgrid_id' => $this->cur_mg->id] ]); } } \ No newline at end of file diff --git a/app/src/Controller/MatchgridSettingsController.php b/app/src/Controller/MatchgridSettingsController.php index c1fadc11..cfc94fa5 100644 --- a/app/src/Controller/MatchgridSettingsController.php +++ b/app/src/Controller/MatchgridSettingsController.php @@ -29,6 +29,8 @@ namespace App\Controller; +use Cake\Event\EventInterface; + class MatchgridSettingsController extends StandardController { public $pagination = [ 'order' => [ @@ -40,10 +42,10 @@ class MatchgridSettingsController extends StandardController { * Callback run prior to the view rendering. * * @since COmanage Match v1.0.0 - * @param Event $event Cake Event + * @param \Cake\Event\EventInterface $event Cake Event */ - public function beforeRender(\Cake\Event\Event $event) { + public function beforeRender(EventInterface $event) { parent::beforeRender($event); // Override page title diff --git a/app/src/Controller/MatchgridsController.php b/app/src/Controller/MatchgridsController.php index 5577c458..03c097ce 100644 --- a/app/src/Controller/MatchgridsController.php +++ b/app/src/Controller/MatchgridsController.php @@ -31,6 +31,7 @@ use Cake\Log\Log; use \App\Lib\Enum\PermissionEnum; +use Cake\Event\EventInterface; class MatchgridsController extends StandardController { public $pagination = [ @@ -43,10 +44,10 @@ class MatchgridsController extends StandardController { * Callback run prior to the request action. * * @since COmanage Match v1.0.0 - * @param Event $event Cake Event + * @param \Cake\Event\EventInterface $event Cake Event */ - public function beforeFilter(\Cake\Event\Event $event) { + public function beforeFilter(EventInterface $event) { // Only certain actions require a matchgrid ID if(in_array($this->request->getParam('action'), ['build', 'manage', 'pending', 'reconcile'])) { @@ -206,7 +207,7 @@ public function reconcile(string $id) { ]); } else { // is get // Find and render the candidates for the pending record - + $rowId = (int)$this->request->getQuery('rowid'); if(!$rowId) { diff --git a/app/src/Controller/PagesController.php b/app/src/Controller/PagesController.php index 58f12067..5d9970d4 100644 --- a/app/src/Controller/PagesController.php +++ b/app/src/Controller/PagesController.php @@ -15,6 +15,7 @@ namespace App\Controller; use Cake\Core\Configure; +use Cake\Event\EventInterface; use Cake\Network\Exception\ForbiddenException; use Cake\Network\Exception\NotFoundException; use Cake\View\Exception\MissingTemplateException; @@ -32,10 +33,10 @@ class PagesController extends AppController * Callback run prior to the request action. * * @since COmanage Match v1.0.0 - * @param Event $event Cake Event + * @param \Cake\Event\EventInterface $event Cake Event */ - public function beforeFilter(\Cake\Event\Event $event) { + public function beforeFilter(EventInterface $event) { parent::beforeFilter($event); $param = $this->request->getParam('pass.0'); diff --git a/app/src/Controller/StandardController.php b/app/src/Controller/StandardController.php index 5552d9bf..6215e5b4 100644 --- a/app/src/Controller/StandardController.php +++ b/app/src/Controller/StandardController.php @@ -64,7 +64,7 @@ public function add() { } else { // Create an empty entity for FormHelper - $this->set('vv_obj', $this->$modelsName->newEntity()); + $this->set('vv_obj', $this->$modelsName->newEmptyEntity()); } // PrimaryLinkTrait @@ -358,7 +358,7 @@ public function index() { $query = $table->whereFilter($query, $attribute, $this->request->getQuery($attribute)); } } - + $this->set('vv_searchable_attributes', $searchableAttributes); } } diff --git a/app/src/Controller/TierApiController.php b/app/src/Controller/TierApiController.php index 4e42cb50..1d1b80f3 100644 --- a/app/src/Controller/TierApiController.php +++ b/app/src/Controller/TierApiController.php @@ -49,7 +49,7 @@ class TierApiController extends AppController { * @since COmanage Match v1.0.0 */ - public function initialize() { + public function initialize(): void { // We have substantial differences from AppController::initialize(), so we // completely override here. diff --git a/app/src/Lib/Match/MatchService.php b/app/src/Lib/Match/MatchService.php index 14689870..c64433b4 100644 --- a/app/src/Lib/Match/MatchService.php +++ b/app/src/Lib/Match/MatchService.php @@ -29,18 +29,15 @@ namespace App\Lib\Match; -use Cake\Datasource\ConnectionInterface; -use Cake\Datasource\ConnectionManager; use Cake\Log\Log; use Cake\ORM\TableRegistry; -use Cake\Utility\Xml; use \App\Lib\Enum\ConfidenceModeEnum; use \App\Lib\Enum\ReferenceIdEnum; use \App\Lib\Enum\SearchTypeEnum; use \App\Lib\Enum\StatusEnum; -require(ROOT . DS . "vendor" . DS . "adodb" . DS . "adodb-php" . DS . "adodb-xmlschema03.inc.php"); +require_once ROOT . DS . "vendor" . DS . "adodb" . DS . "adodb-php" . DS . "adodb-xmlschema03.inc.php"; class MatchService extends PostgresService { protected $mgConfig = null; diff --git a/app/src/Lib/Match/MatchgridBuilder.php b/app/src/Lib/Match/MatchgridBuilder.php index 3fad3c87..956fc5bb 100644 --- a/app/src/Lib/Match/MatchgridBuilder.php +++ b/app/src/Lib/Match/MatchgridBuilder.php @@ -105,7 +105,6 @@ protected function configToSchema($dbc, \Cake\Datasource\EntityInterface $Matchg // Track which attributes need case insensitive indexes $ciAttrs = []; - if($indexes) { // Since index names need to be unique across the schema, we'll use the // matchgrid ID to make the names unique. @@ -128,9 +127,9 @@ protected function configToSchema($dbc, \Cake\Datasource\EntityInterface $Matchg foreach($attributes as $attr) { // We use the Entity ID to provide some level of reproducibility $indexName = 'matchgrid_' . $Matchgrid->id . '_attr_id' . $attr->id; - + $table->addIndex([$attr->name], $indexName, $flags, $options); - + if(!$attr->case_sensitive) { $ciAttrs[$indexName] = $attr->name; } @@ -167,12 +166,10 @@ protected function configToSchema($dbc, \Cake\Datasource\EntityInterface $Matchg $sql = rtrim($sql, ")") . " NULLS FIRST)"; } elseif(preg_match("/^CREATE INDEX (\w+) ON .*/", $sql, $matches)) { $attr = $ciAttrs[ $matches[1] ]; - // Not ideal to hardcode SQL, but this should be pretty portable. // Note the validation rule for table_name and attr is pretty restrictive, // so we don't need to SQL escape them. Similarly, we create the index // name above. - // We use IF NOT EXISTS to avoid errors on rebuilding the matchgrid, // however a better long term solution would be to add native support to // DBAL for expression in index creation (CO-2217). diff --git a/app/src/Lib/Traits/SearchFilterTrait.php b/app/src/Lib/Traits/SearchFilterTrait.php index 54c88abd..1f352470 100644 --- a/app/src/Lib/Traits/SearchFilterTrait.php +++ b/app/src/Lib/Traits/SearchFilterTrait.php @@ -41,24 +41,24 @@ trait SearchFilterTrait { * @return string Label * @todo Merge this with _column_key from index.ctp */ - + public function getLabel($attribute) { if(isset($this->searchFilters[$attribute]['label']) && $this->searchFilters[$attribute]['label'] !== null) { return $this->searchFilters[$attribute]['label']; } - + // Try to construct a label from the language key. $l = __('match.fd.'.$attribute); - + if($l != 'match.fd.'.$attribute) { return $l; } - + // If we make it here, just return $attribute return $attribute; } - + /** * Obtain the set of permitted search attributes. * @@ -69,15 +69,15 @@ public function getLabel($attribute) { public function getSearchableAttributes() { // Not every configuration element is necessary for the search form, and // some need to be calculated, so we do that work here. - + $ret = []; - + foreach(array_keys($this->searchFilters) as $attr) { $ret[ $attr ] = [ 'label' => $this->getLabel($attr) ]; } - + return $ret; } diff --git a/app/src/Model/Table/ApiUsersTable.php b/app/src/Model/Table/ApiUsersTable.php index 44d7f3f5..aa43a16a 100644 --- a/app/src/Model/Table/ApiUsersTable.php +++ b/app/src/Model/Table/ApiUsersTable.php @@ -48,7 +48,7 @@ class ApiUsersTable extends Table { * @param array $config Configuration options passed to constructor */ - public function initialize(array $config) { + public function initialize(array $config): void { $this->addBehavior('Timestamp'); // Define associations @@ -83,7 +83,7 @@ public function initialize(array $config) { * @return RulesChecker Cake RulesChecker */ - public function buildRules(RulesChecker $rules) { + public function buildRules(RulesChecker $rules): RulesChecker { $rules->add( [$this, 'checkUsername'], 'checkUsername', @@ -164,24 +164,24 @@ public function findAuthorization(\Cake\ORM\Query $query, array $options) { * * @since COmanage Match v1.0.0 * @param Validator $validator Validator - * @return $validator Validator + * @return \Cake\Validation\Validator Validator */ - public function validationDefault(Validator $validator) { + public function validationDefault(Validator $validator): Validator { $validator->add( 'username', 'length', [ 'rule' => [ 'maxLength', 128 ] ] ); // notEmpty is old style, use notBlank - $validator->notBlank('username'); + $validator->notEmptyString('username'); $validator->add( 'password', 'length', [ 'rule' => [ 'maxLength', 80 ] ] ); - $validator->notBlank('password'); + $validator->notEmptyString('password'); $validator->add( 'matchgrid_id', diff --git a/app/src/Model/Table/AttributeGroupsTable.php b/app/src/Model/Table/AttributeGroupsTable.php index f54bd1ed..b1c4b86a 100644 --- a/app/src/Model/Table/AttributeGroupsTable.php +++ b/app/src/Model/Table/AttributeGroupsTable.php @@ -43,7 +43,7 @@ class AttributeGroupsTable extends Table { * @param array $config Configuration options passed to constructor */ - public function initialize(array $config) { + public function initialize(array $config): void { $this->addBehavior('Timestamp'); // Define associations @@ -60,10 +60,10 @@ public function initialize(array $config) { * Set validation rules. * * @param Validator $validator Validator - * @return $validator Validator + * @return \Cake\Validation\Validator Validator */ - public function validationDefault(Validator $validator) { + public function validationDefault(Validator $validator): Validator { $validator->add( 'name', 'length', diff --git a/app/src/Model/Table/AttributeMappingsTable.php b/app/src/Model/Table/AttributeMappingsTable.php index 7c2a8117..26c85f8f 100644 --- a/app/src/Model/Table/AttributeMappingsTable.php +++ b/app/src/Model/Table/AttributeMappingsTable.php @@ -44,7 +44,7 @@ class AttributeMappingsTable extends Table { * @param array $config Configuration options passed to constructor */ - public function initialize(array $config) { + public function initialize(array $config): void { $this->addBehavior('Timestamp'); // Define associations @@ -105,7 +105,7 @@ public function install(int $attributeMapId, string $mapping) { foreach($namemap as $q => $vs) { foreach($vs as $v => $status) { if(!isset($curmap[$q][$v])) { - $mapping = $this->newEntity(); + $mapping = $this->newEmptyEntity(); $mapping->attribute_map_id = $attributeMapId; $mapping->query = $q; @@ -126,10 +126,10 @@ public function install(int $attributeMapId, string $mapping) { * * @since COmanage Match v1.0.0 * @param Validator $validator Validator - * @return $validator Validator + * @return \Cake\Validation\Validator Validator */ - public function validationDefault(Validator $validator) { + public function validationDefault(Validator $validator): Validator { $validator->add( 'query', 'length', diff --git a/app/src/Model/Table/AttributeMapsTable.php b/app/src/Model/Table/AttributeMapsTable.php index 1b7aca33..983e1da9 100644 --- a/app/src/Model/Table/AttributeMapsTable.php +++ b/app/src/Model/Table/AttributeMapsTable.php @@ -44,7 +44,7 @@ class AttributeMapsTable extends Table { * @param array $config Configuration options passed to constructor */ - public function initialize(array $config) { + public function initialize(array $config): void { $this->addBehavior('Timestamp'); // Define associations @@ -66,10 +66,10 @@ public function initialize(array $config) { * * @since COmanage Match v1.0.0 * @param Validator $validator Validator - * @return $validator Validator + * @return \Cake\Validation\Validator Validator */ - public function validationDefault(Validator $validator) { + public function validationDefault(Validator $validator): Validator { $validator->add( 'name', 'length', diff --git a/app/src/Model/Table/AttributesTable.php b/app/src/Model/Table/AttributesTable.php index 15d0d4b2..ae075173 100644 --- a/app/src/Model/Table/AttributesTable.php +++ b/app/src/Model/Table/AttributesTable.php @@ -45,7 +45,7 @@ class AttributesTable extends Table { * @param array $config Configuration options passed to constructor */ - public function initialize(array $config) { + public function initialize(array $config): void { $this->addBehavior('Timestamp'); // Define associations @@ -81,10 +81,10 @@ public function initialize(array $config) { * Set validation rules. * * @param Validator $validator Validator - * @return $validator Validator + * @return \Cake\Validation\Validator Validator */ - public function validationDefault(Validator $validator) { + public function validationDefault(Validator $validator): Validator { $validator->add( 'name', 'length', diff --git a/app/src/Model/Table/MatchgridRecordsTable.php b/app/src/Model/Table/MatchgridRecordsTable.php index a89ab45d..7f82b81f 100644 --- a/app/src/Model/Table/MatchgridRecordsTable.php +++ b/app/src/Model/Table/MatchgridRecordsTable.php @@ -45,7 +45,7 @@ class MatchgridRecordsTable extends Table { * @param array $config Configuration options passed to constructor */ - public function initialize(array $config) { + public function initialize(array $config): void { $this->setPrimaryLink('matchgrid_id'); $this->setRequiresMatchgrid(true); // We allow unkeyed primary link here because a record ID is not by itself @@ -75,7 +75,7 @@ public function initialize(array $config) { $this->setSearchFilter('sor', true, null, false); $this->setSearchFilter('sorid', true, null, false); $this->setSearchFilter('referenceid', true, null, false); - + foreach($mgconfig->attributes as $attr) { // XXX for now we permit substring on all fields since we don't have a better way to distinguish $this->setSearchFilter($attr->name, $attr->case_sensitive, null, true); @@ -86,10 +86,10 @@ public function initialize(array $config) { * Set validation rules. * * @param Validator $validator Validator - * @return $validator Validator + * @return \Cake\Validation\Validator Validator * - public function validationDefault(Validator $validator) { + public function validationDefault(Validator $validator): Validator { // We don't do validation here since MatchService should handle that }*/ } \ No newline at end of file diff --git a/app/src/Model/Table/MatchgridSettingsTable.php b/app/src/Model/Table/MatchgridSettingsTable.php index b3c8e87b..e91355f1 100644 --- a/app/src/Model/Table/MatchgridSettingsTable.php +++ b/app/src/Model/Table/MatchgridSettingsTable.php @@ -56,7 +56,7 @@ class MatchgridSettingsTable extends Table { * @param array $config Configuration options passed to constructor */ - public function initialize(array $config) { + public function initialize(array $config): void { // Timestamp behavior handles created/modified updates $this->addBehavior('Timestamp'); @@ -175,10 +175,10 @@ protected function lookupValue(int $matchgridId, string $field) { * * @since COmanage Match v1.0.0 * @param Validator $validator Validator - * @return $validator Validator + * @return \Cake\Validation\Validator Validator */ - public function validationDefault(Validator $validator) { + public function validationDefault(Validator $validator): Validator { $validator->add( 'matchgrid_id', 'content', diff --git a/app/src/Model/Table/MatchgridsTable.php b/app/src/Model/Table/MatchgridsTable.php index 99003e23..c4968bd2 100644 --- a/app/src/Model/Table/MatchgridsTable.php +++ b/app/src/Model/Table/MatchgridsTable.php @@ -50,7 +50,7 @@ class MatchgridsTable extends Table { * @param array $config Configuration options passed to constructor */ - public function initialize(array $config) { + public function initialize(array $config): void { // Timestamp behavior handles created/modified updates $this->addBehavior('Timestamp'); @@ -164,10 +164,10 @@ public function getMatchgridConfig($id) { * * @since COmanage Match v1.0.0 * @param Validator $validator Validator - * @return $validator Validator + * @return \Cake\Validation\Validator Validator */ - public function validationDefault(Validator $validator) { + public function validationDefault(Validator $validator): Validator { $validator->add( 'table_name', 'length', diff --git a/app/src/Model/Table/MetaTable.php b/app/src/Model/Table/MetaTable.php index 512c6781..afdcf3ab 100644 --- a/app/src/Model/Table/MetaTable.php +++ b/app/src/Model/Table/MetaTable.php @@ -46,7 +46,7 @@ class MetaTable extends Table { public function setUpgradeVersion($version) { // XXX log this? print "Setting version to " . $version . "\n"; - $meta = $this->newEntity(); + $meta = $this->newEmptyEntity(); $meta->id = 1; $meta->upgrade_version = $version; @@ -62,10 +62,10 @@ public function setUpgradeVersion($version) { * * @since COmanage Match v1.0.0 * @param Validator $validator Validator - * @return $validator Validator + * @return \Cake\Validation\Validator Validator */ - public function validationDefault(Validator $validator) { + public function validationDefault(Validator $validator): Validator { $validator->add( 'upgrade_version', 'length', diff --git a/app/src/Model/Table/PermissionsTable.php b/app/src/Model/Table/PermissionsTable.php index 0132d35f..285e95b2 100644 --- a/app/src/Model/Table/PermissionsTable.php +++ b/app/src/Model/Table/PermissionsTable.php @@ -45,7 +45,7 @@ class PermissionsTable extends Table { * @param array $config Configuration options passed to constructor */ - public function initialize(array $config) { + public function initialize(array $config): void { $this->addBehavior('Timestamp'); // Define associations @@ -88,10 +88,10 @@ public function findForUser(string $username) { * * @since COmanage Match v1.0.0 * @param Validator $validator Validator - * @return $validator Validator + * @return \Cake\Validation\Validator Validator */ - public function validationDefault(Validator $validator) { + public function validationDefault(Validator $validator): Validator { $validator->add( 'username', 'length', diff --git a/app/src/Model/Table/RuleAttributesTable.php b/app/src/Model/Table/RuleAttributesTable.php index 3bf702c0..444f8299 100644 --- a/app/src/Model/Table/RuleAttributesTable.php +++ b/app/src/Model/Table/RuleAttributesTable.php @@ -47,7 +47,7 @@ class RuleAttributesTable extends Table { * @param array $config Configuration options passed to constructor */ - public function initialize(array $config) { + public function initialize(array $config): void { $this->addBehavior('Timestamp'); // Define associations @@ -89,10 +89,10 @@ public function initialize(array $config) { * * @since COmanage Match v1.0.0 * @param Validator $validator Validator - * @return $validator Validator + * @return \Cake\Validation\Validator Validator */ - public function validationDefault(Validator $validator) { + public function validationDefault(Validator $validator): Validator { $validator->add( 'rule_id', 'content', diff --git a/app/src/Model/Table/RulesTable.php b/app/src/Model/Table/RulesTable.php index 9d34caab..6cd173f3 100644 --- a/app/src/Model/Table/RulesTable.php +++ b/app/src/Model/Table/RulesTable.php @@ -47,7 +47,7 @@ class RulesTable extends Table { * @param array $config Configuration options passed to constructor */ - public function initialize(array $config) { + public function initialize(array $config): void { $this->addBehavior('Timestamp'); // Define associations @@ -76,10 +76,10 @@ public function initialize(array $config) { * * @since COmanage Match v1.0.0 * @param Validator $validator Validator - * @return $validator Validator + * @return \Cake\Validation\Validator Validator */ - public function validationDefault(Validator $validator) { + public function validationDefault(Validator $validator): Validator { $validator->add( 'name', 'length', diff --git a/app/src/Model/Table/SystemsOfRecordTable.php b/app/src/Model/Table/SystemsOfRecordTable.php index 864c8658..53ff8d5e 100644 --- a/app/src/Model/Table/SystemsOfRecordTable.php +++ b/app/src/Model/Table/SystemsOfRecordTable.php @@ -46,7 +46,7 @@ class SystemsOfRecordTable extends Table { * @param array $config Configuration options passed to constructor */ - public function initialize(array $config) { + public function initialize(array $config): void { $this->addBehavior('Timestamp'); // Define associations @@ -72,10 +72,10 @@ public function initialize(array $config) { * * @since COmanage Match v1.0.0 * @param Validator $validator Validator - * @return $validator Validator + * @return \Cake\Validation\Validator Validator */ - public function validationDefault(Validator $validator) { + public function validationDefault(Validator $validator): Validator { $validator->add( 'label', 'length', diff --git a/app/src/Shell/ConsoleShell.php b/app/src/Shell/ConsoleShell.php index 2eb9395e..02097093 100644 --- a/app/src/Shell/ConsoleShell.php +++ b/app/src/Shell/ConsoleShell.php @@ -64,7 +64,7 @@ public function main() * * @return \Cake\Console\ConsoleOptionParser */ - public function getOptionParser() + public function getOptionParser(): ConsoleOptionParser { $parser = new ConsoleOptionParser('console'); $parser->setDescription( diff --git a/app/src/Template/Element/breadcrumbs.ctp b/app/src/Template/Element/breadcrumbs.ctp deleted file mode 100644 index a3aa9270..00000000 --- a/app/src/Template/Element/breadcrumbs.ctp +++ /dev/null @@ -1,127 +0,0 @@ -request->getRequestTarget(false) != '/') { - // Don't bother rendering breadcrumbs if we're already at the top page - - $action = $this->template; - // $this->name = Models - $modelsName = $this->name; - - $this->Breadcrumbs->setTemplates([ - 'wrapper' => '{{content}}', - 'item' => '{{title}}{{separator}}', - 'itemWithoutLink' => '{{title}}{{separator}}', - 'separator' => '{{separator}}' - ]); - - $this->Breadcrumbs->prepend( - __('match.meta.match'), - ['controller' => 'matchgrids', - 'action' => 'select'] - ); - - if(!empty($vv_cur_mg) - && ($modelsName != 'Matchgrids' || $action != 'manage')) { - // Link to matchgrid if set - $this->Breadcrumbs->add( - $vv_cur_mg->table_name, - ['controller' => 'matchgrids', - 'action' => 'manage', - $vv_cur_mg->id ] - ); - } - - if(!empty($vv_primary_link_obj) - && !empty($vv_primary_link_model) - && $vv_primary_link_model != 'Matchgrids') { - // If the primary link is not matchgrid, render a link to it (and the parent index). - // We'll need to calculate the controller name. - - if(!empty($vv_cur_mg->id)) { - // We currently assume the parent of a primary link is matchgrid, which - // might or might not always be true in the future. - $this->Breadcrumbs->add( - __('match.ct.'.$vv_primary_link_model, [99]), - ['controller' => \Cake\Utility\Inflector::dasherize($vv_primary_link_model), - 'action' => 'index', - 'matchgrid_id' => $vv_cur_mg->id] - ); - } - - $this->Breadcrumbs->add( - $vv_primary_link_obj->name, - ['controller' => \Cake\Utility\Inflector::dasherize($vv_primary_link_model), - 'action' => 'edit', - $vv_primary_link_obj->id] - ); - } - - if($action != 'index' && $action != 'manage' - && !($modelsName == 'Matchgrids' && $action == 'pending')) { - - // Default parent is index, to which we might need to append the Primary Link ID - $crumbLinkText = 'match.ct.'.$modelsName; - - $target = [ - 'controller' => Inflector::dasherize($modelsName), - 'action' => 'index' - ]; - - if(!empty($vv_primary_link) && !empty($vv_primary_link_obj->id)) { - $target[$vv_primary_link] = $vv_primary_link_obj->id; - } - - // Non-index special cases - if ($modelsName == 'Matchgrids' && $action == 'reconcile') { - $crumbLinkText = 'match.ac.PendingRequests'; - $target = [ - 'controller' => Inflector::dasherize($modelsName), - 'action' => 'pending', - $vv_cur_mg->id // will always be set for reconcile - ]; - } - - $this->Breadcrumbs->add( - __($crumbLinkText, [99]), - $target - ); - } - - if(!empty($vv_title)) { - $this->Breadcrumbs->add( - $vv_title - ); - } - - print $this->Breadcrumbs->render( - [], - ['separator' => ' > '] - ); -} \ No newline at end of file diff --git a/app/src/Template/Element/javascript.ctp b/app/src/Template/Element/javascript.ctp deleted file mode 100644 index f02d7f71..00000000 --- a/app/src/Template/Element/javascript.ctp +++ /dev/null @@ -1,283 +0,0 @@ - - - - -Flash->render() ?> \ No newline at end of file diff --git a/app/src/Template/Element/menuMain.ctp b/app/src/Template/Element/menuMain.ctp deleted file mode 100644 index 2b83f806..00000000 --- a/app/src/Template/Element/menuMain.ctp +++ /dev/null @@ -1,69 +0,0 @@ - - diff --git a/app/src/Template/Element/menuTop.ctp b/app/src/Template/Element/menuTop.ctp deleted file mode 100644 index ab425158..00000000 --- a/app/src/Template/Element/menuTop.ctp +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - - Html->link(__('match.op.login'), - ['controller' => 'matchgrids', - 'action' => 'select', - 'plugin' => false], - ['escape' => false, - 'id' => 'login', - 'class' => '']); - } - ?> - - - diff --git a/app/src/Template/Element/pagination.ctp b/app/src/Template/Element/pagination.ctp deleted file mode 100644 index ec485f31..00000000 --- a/app/src/Template/Element/pagination.ctp +++ /dev/null @@ -1,114 +0,0 @@ -Paginator->hasPage(2)) { - $paginationClass = "with-pagination-elements"; - } -?> - - - diff --git a/app/src/Template/Element/search.ctp b/app/src/Template/Element/search.ctp deleted file mode 100644 index da31050a..00000000 --- a/app/src/Template/Element/search.ctp +++ /dev/null @@ -1,141 +0,0 @@ -name = Models -$modelsName = $this->name; -// $modelName = Model -$modelName = \Cake\Utility\Inflector::singularize($modelsName); - -// Get the query string and separate the search params from the non-search params -$query = $this->request->getQueryParams(); -$non_search_params = array_diff_key($query, $vv_searchable_attributes); -$search_params = array_intersect_key($query, $vv_searchable_attributes); - -// Begin the form -print $this->Form->create(null, [ - 'id' => 'top-search-form', - 'type' => 'get' -]); - -// Pass back the non-search params as hidden fields, but always exclude the page parameter -// because we need to start new searches on page one (or we're likely to end up with a 404). -if(!empty($non_search_params)) { - foreach($non_search_params as $param => $value) { - if($param != 'page') { - print $this->Form->hidden(filter_var($param, FILTER_SANITIZE_SPECIAL_CHARS), array('default' => filter_var($value, FILTER_SANITIZE_SPECIAL_CHARS))) . "\n"; - } - } -} - -// Boolean to distinguish between search filters and sort parameters -$hasActiveFilters = false; -?> - - - -Form->end(); ?> \ No newline at end of file diff --git a/app/src/Template/Email/text/potential_match.ctp b/app/src/Template/Email/text/potential_match.ctp deleted file mode 100644 index c3771f95..00000000 --- a/app/src/Template/Email/text/potential_match.ctp +++ /dev/null @@ -1,38 +0,0 @@ - - - - -?> -A new potential match is available for your review. You may access the -pending request at this URL: - - - \ No newline at end of file diff --git a/app/src/Template/Matchgrids/manage.ctp b/app/src/Template/Matchgrids/manage.ctp deleted file mode 100644 index 6583b9bd..00000000 --- a/app/src/Template/Matchgrids/manage.ctp +++ /dev/null @@ -1,137 +0,0 @@ - -
-
-

-
-
- -
- -
-
- Html->link('' . __('match.op.display.records'), - ['controller' => 'MatchgridRecords', - 'action' => 'index', - 'matchgrid_id' => $vv_cur_mg->id], - ['escape' => false, 'class' => 'btn btn-default']); - ?> -
-
-
- Html->link('' . __('match.op.reconcile.requests'), - ['controller' => 'Matchgrids', - 'action' => 'pending', - $vv_cur_mg->id], - ['escape' => false, 'class' => 'btn btn-default']); - ?> -
-
-
- - - 'settings', - 'api_users' => 'vpn_key', - 'attributes' => 'edit', - 'attribute_groups' => 'storage', - 'attribute_maps' => 'swap_horiz', - 'rules' => 'assignment', - 'systems_of_record' => 'gavel', - ]; - - // We'll get most users simply by checking for build permission - $renderConfig = $vv_permissions['build']; - - if(!$renderConfig) { - foreach(array_keys($models) as $m) { - if(isset($vv_menu_permissions[$m]) && $vv_menu_permissions[$m]===true) { - $renderConfig = true; - break; - } - } - } - } - ?> - -

-
    - $icon) { - if($vv_menu_permissions[$model]) { - print '
  • '; - - $linkContent = '' - . __('match.ct.'.\Cake\Utility\Inflector::camelize($model), [99]) - . ''; - - print $this->Html->link( - $linkContent, - ['plugin' => null, - 'controller' => $model, - 'action' => 'index', - 'matchgrid_id' => $vv_cur_mg->id], - ['escape' => false] - ); - - print '
  • '; - } - } - - if($vv_permissions['build']) { - print '
  • '; - - $linkContent = '' - . __('match.op.build') - . ''; - - print $this->Html->link( - $linkContent, - ['controller' => 'Matchgrids', - 'action' => 'build', - $vv_cur_mg->id], - ['escape' => false,'confirm' => __('match.op.build.confirm')] - ); - print '
  • '; - } - ?> -
- -
diff --git a/app/src/Template/Matchgrids/pending.ctp b/app/src/Template/Matchgrids/pending.ctp deleted file mode 100644 index 1865746c..00000000 --- a/app/src/Template/Matchgrids/pending.ctp +++ /dev/null @@ -1,62 +0,0 @@ - - -
-
-

-
-
- -

- - - - - - - - - - - - - - -
- - - Html->link( - $p['sorid'], - ['action' => 'reconcile', $vv_matchgrid_id, 'rowid' => $p['id']], - ['class' => 'row-link'] - ); ?> - - -
diff --git a/app/src/Template/Standard/add-edit-view.ctp b/app/src/Template/Standard/add-edit-view.ctp deleted file mode 100644 index cafaeb7e..00000000 --- a/app/src/Template/Standard/add-edit-view.ctp +++ /dev/null @@ -1,89 +0,0 @@ -template; -// $this->name = Models -$modelsName = $this->name; -?> -
-
-

-
-
- - - - -
- info - -
- - - - -Form->create($vv_obj); -} - -$linkId = null; - -if(!empty($vv_primary_link)) { - if(!empty($this->request->getQuery($vv_primary_link))) { - $linkId = $this->request->getQuery($vv_primary_link); - } elseif(!empty($this->request->getData($vv_primary_link))) { - $linkId = $this->request->getData($vv_primary_link); - } elseif(!empty($vv_obj->$vv_primary_link)) { - $linkId = $vv_obj->$vv_primary_link; - } -} - -print $this->Field->startControlSet($vv_obj, $this->name, $action, ($action == 'add' || $action == 'edit')); - -include(APP . "Template/" . $modelsName . "/fields.inc"); - -if($action == 'add' || $action == 'edit') { - if(!empty($linkId)) { - // Hidden values used to link to parent objects (eg: matchgrid_id) - print $this->Form->hidden($vv_primary_link, ['value' => $linkId]); - } - - print $this->Field->submit(__('match.op.save')); - print $this->Form->end(); -} - -print $this->Field->endControlSet(); diff --git a/app/src/Template/Standard/index.ctp b/app/src/Template/Standard/index.ctp deleted file mode 100644 index 2f69b8f8..00000000 --- a/app/src/Template/Standard/index.ctp +++ /dev/null @@ -1,338 +0,0 @@ -name = Models -$modelsName = $this->name; -// $tablefk = model_id -$tableFK = Inflector::singularize($vv_tablename) . "_id"; - -// Do we have records for this index? This will be set to true during render if we do. -// Otherwise, we'll print out a "no records" message. -$recordsExist = false; - -// Our default link actions, in order of preference, unless the column config overrides it -$linkActions = ['edit', 'view']; - -// Read the index configuration ($indexColumns) for this model -include(APP . "Template/" . $modelsName . "/columns.inc"); - -// $linkFilter is used for models that belong to a specific parent model (eg: co_id) -$linkFilter = []; - -if(!empty($vv_primary_link) && !empty($this->request->getQuery($vv_primary_link))) { - $linkFilter = [$vv_primary_link => $this->request->getQuery($vv_primary_link)]; -} - -function _column_key($modelsName, $c, $tz=null) { - $product = __('product.code'); - - if(strpos($c, "_id", strlen($c)-3)) { - // Key is of the form field_id, use .ct label instead - $k = Inflector::camelize(Inflector::pluralize(substr($c, 0, strlen($c)-3))); - - return __($product.'.ct.'.$k, [1]); - } - - // Look for a model specific key first - $label = __($product.'.fd.'.$modelsName.'.'.$c); - - if($label != $product.'.fd.'.$modelsName.'.'.$c) { - return $label; - } - - if($tz) { - // If there is a timezone aware label, use that - $label = __($product.'.fd.'.$c.'.tz', [$tz]); - - if($label != $product.'.fd.'.$c.'.tz') { - return $label; - } - } - - // Otherwise look for the general key - return __($product.'.fd.'.$c); -} -?> -
-
-

-
- - - - -
- - -
- info - -
- - - - - -
- info - -
- - - - - - element('search'); ?> - - - -
- - - $cfg): ?> - - - - - - id]; - - if(isset($forcePrimaryLink) && $forcePrimaryLink) { - $linkArgs = array_merge($linkArgs, $linkFilter); - } - ?> - - $cfg): ?> - - - - - - - - - -
Paginator->sort($cfg['sortable'], $label); - } else { - print $this->Paginator->sort($col, $label); - } - } else { - print $label; - } - ?>
- $col) && $entity->$col) { - print __($product.'.en.'.$cfg['class'].'.1'); - } else { - print __($product.'.en.'.$cfg['class'].'.0'); - } - break; - case 'datetime': - // XXX dates can also be rendered as eg $entity->created->format(DATE_RFC850); - print $this->Time->nice($entity->$col, $vv_tz); - break; - case 'enum': - if($entity->$col) { - print __($product.'.en.'.$cfg['class'].'.'.$entity->$col); - } - break; - case 'fk': - // Assuming $col is of the form foo_id, look to see if the corresponding - // AutoViewVar $foos is set, and if so render the lookup value instead - $f = null; - if(preg_match('/^(.*?)_id$/', $col, $f)) { - $avv = Inflector::variable(Inflector::pluralize($f[1])); - - if(!empty(${$avv}[$entity->$col])) { - // We found the viewvar (eg: $foos), and it has a corresponding value - // (eg: $foos[3]), so render it - print ${$avv}[$entity->$col]; // XXX filter_var? - } else { - // No match, just render the value - print $entity->$col; - } - } else { - // Just print the value - print $entity->$col; - } - break; - case 'link': - case 'echo': - default: - // By default our label is the column value, but it might be overridden - $label = $entity->$col; - - if(!empty($cfg['model']) && !empty($cfg['field'])) { - $m = $cfg['model']; - $f = $cfg['field']; - - if(!empty($entity->$m->$f)) { - $label = $entity->$m->$f; - } - } - - $linked = false; - - if($cfg['type'] == 'link') { - foreach($linkActions as $a) { - // Does this user have permission for this action? - if($vv_permissions[$a]) { - print $this->Html->link($label, ['action' => $a, $entity->id]); - $linked = true; - break 2; - } - } - } - - if(!$linked) { - // Just echo the value - print $label; - } - break; - // XXX dates can be rendered as eg $entity->created->format(DATE_RFC850); - } - ?> - - Html->link( - __($product.'.op.edit'), - array_merge(['action' => 'edit'], $linkArgs), - ['class' => 'editbutton'] - ); - } - - if(isset($vv_permissions['duplicate']) && $vv_permissions['duplicate']) { - print $this->Html->link( - __($product.'.op.duplicate'), - array_merge(['action' => 'duplicate'], $linkArgs), - ['class' => 'copybutton'] - ); - } - - if($vv_permissions['delete']) { - // XXX this is throwing CSRF error even though delete button on edit-record page is working? - // probably because this is using Form helper, but we're outside of a form? - print $this->Form->postLink( - __($product.'.op.delete'), - array_merge(['action' => 'delete'], $linkArgs), - // XXX should be configurable which field we put in, maybe displayField? - ['confirm' => __($product.'.op.delete.confirm', [$entity->id]), - 'class' => 'deletebutton'] - ); - } - - if(!empty($indexActions)) { - // Insert additional actions as per the .inc file - - if(!isset($entity->status) || $entity->status == StatusEnum::Active) { - foreach($indexActions as $a) { - if($vv_permissions[ $a['action'] ]) { - // If we have a .confirm text, use postLink instead - - $confirmKey = $product.'.op.'.$a['action'].'.confirm'; - $confirmTxt = __($confirmKey); - - if($confirmTxt != $confirmKey) { - // We found the localized string - - print $this->Form->postLink( - __($product.'.op.' . $a['action']), - array_merge(['action' => $a['action']], $linkArgs), - // XXX should be configurable which field we put in, maybe displayField? - ['confirm' => __($confirmKey, [$entity->id]), - 'class' => $a['class']] - ); - } elseif(!empty($a['controller'])) { - // We're linking into a related controller - print $this->Html->link( - __('match.ct.' . Inflector::camelize(Inflector::pluralize($a['controller'])), [99]), - ['controller' => $a['controller'], - 'action' => $a['action'], - $tableFK => $entity->id], - ['class' => $a['class']] - ); - } else { - print $this->Html->link( - __($product.'.op.' . $a['action']), - array_merge(['action' => $a['action']], $linkArgs), - ['class' => $a['class']] - ); - } - } - } - } - } - ?> -
-
- -element("pagination"); \ No newline at end of file diff --git a/app/src/View/AjaxView.php b/app/src/View/AjaxView.php index 3cb78692..3d6f1093 100644 --- a/app/src/View/AjaxView.php +++ b/app/src/View/AjaxView.php @@ -40,7 +40,7 @@ class AjaxView extends AppView * * @return void */ - public function initialize() + public function initialize(): void { parent::initialize(); diff --git a/app/src/View/AppView.php b/app/src/View/AppView.php index d35ffc67..1daf083e 100644 --- a/app/src/View/AppView.php +++ b/app/src/View/AppView.php @@ -38,7 +38,7 @@ class AppView extends View { * @since COmanage Match v1.0.0 */ - public function initialize() { + public function initialize(): void { parent::initialize(); $this->loadHelper('Field'); } diff --git a/app/src/Template/ApiUsers/columns.inc b/app/templates/ApiUsers/columns.inc similarity index 100% rename from app/src/Template/ApiUsers/columns.inc rename to app/templates/ApiUsers/columns.inc diff --git a/app/src/Template/ApiUsers/fields.inc b/app/templates/ApiUsers/fields.inc similarity index 100% rename from app/src/Template/ApiUsers/fields.inc rename to app/templates/ApiUsers/fields.inc diff --git a/app/src/Template/AttributeGroups/columns.inc b/app/templates/AttributeGroups/columns.inc similarity index 100% rename from app/src/Template/AttributeGroups/columns.inc rename to app/templates/AttributeGroups/columns.inc diff --git a/app/src/Template/AttributeGroups/fields.inc b/app/templates/AttributeGroups/fields.inc similarity index 100% rename from app/src/Template/AttributeGroups/fields.inc rename to app/templates/AttributeGroups/fields.inc diff --git a/app/src/Template/AttributeMappings/columns.inc b/app/templates/AttributeMappings/columns.inc similarity index 100% rename from app/src/Template/AttributeMappings/columns.inc rename to app/templates/AttributeMappings/columns.inc diff --git a/app/src/Template/AttributeMappings/fields.inc b/app/templates/AttributeMappings/fields.inc similarity index 100% rename from app/src/Template/AttributeMappings/fields.inc rename to app/templates/AttributeMappings/fields.inc diff --git a/app/src/Template/AttributeMaps/columns.inc b/app/templates/AttributeMaps/columns.inc similarity index 100% rename from app/src/Template/AttributeMaps/columns.inc rename to app/templates/AttributeMaps/columns.inc diff --git a/app/src/Template/AttributeMaps/fields.inc b/app/templates/AttributeMaps/fields.inc similarity index 100% rename from app/src/Template/AttributeMaps/fields.inc rename to app/templates/AttributeMaps/fields.inc diff --git a/app/src/Template/Attributes/columns.inc b/app/templates/Attributes/columns.inc similarity index 100% rename from app/src/Template/Attributes/columns.inc rename to app/templates/Attributes/columns.inc diff --git a/app/src/Template/Attributes/fields.inc b/app/templates/Attributes/fields.inc similarity index 100% rename from app/src/Template/Attributes/fields.inc rename to app/templates/Attributes/fields.inc diff --git a/app/src/Template/Error/error400.ctp b/app/templates/Error/error400.php similarity index 100% rename from app/src/Template/Error/error400.ctp rename to app/templates/Error/error400.php diff --git a/app/src/Template/Error/error500.ctp b/app/templates/Error/error500.php similarity index 100% rename from app/src/Template/Error/error500.ctp rename to app/templates/Error/error500.php diff --git a/app/src/Template/MatchgridRecords/columns.inc b/app/templates/MatchgridRecords/columns.inc similarity index 97% rename from app/src/Template/MatchgridRecords/columns.inc rename to app/templates/MatchgridRecords/columns.inc index 91300e34..4c98d35a 100644 --- a/app/src/Template/MatchgridRecords/columns.inc +++ b/app/templates/MatchgridRecords/columns.inc @@ -28,8 +28,8 @@ // We need to add matchgrid ID to all links (since ID is unique only within a matchgrid) // eg: matchgrid-records/edit/48?matchgrid_id=3 $forcePrimaryLink = true; - -// Turn on the search/filter box for this index view + +// Turn on the search/filter box for this index view $enableSearch = true; // Note we don't need to do any special filtering, since MatchgridRecordsController will diff --git a/app/src/Template/MatchgridRecords/fields.inc b/app/templates/MatchgridRecords/fields.inc similarity index 100% rename from app/src/Template/MatchgridRecords/fields.inc rename to app/templates/MatchgridRecords/fields.inc diff --git a/app/src/Template/MatchgridSettings/fields.inc b/app/templates/MatchgridSettings/fields.inc similarity index 100% rename from app/src/Template/MatchgridSettings/fields.inc rename to app/templates/MatchgridSettings/fields.inc diff --git a/app/src/Template/Matchgrids/columns.inc b/app/templates/Matchgrids/columns.inc similarity index 100% rename from app/src/Template/Matchgrids/columns.inc rename to app/templates/Matchgrids/columns.inc diff --git a/app/src/Template/Matchgrids/fields.inc b/app/templates/Matchgrids/fields.inc similarity index 100% rename from app/src/Template/Matchgrids/fields.inc rename to app/templates/Matchgrids/fields.inc diff --git a/app/templates/Matchgrids/manage.php b/app/templates/Matchgrids/manage.php new file mode 100644 index 00000000..274bd7d7 --- /dev/null +++ b/app/templates/Matchgrids/manage.php @@ -0,0 +1,139 @@ + +
+
+

+
+
+ +
+ +
+
+ Html->link('' . __('match.op.display.records'), + ['controller' => 'MatchgridRecords', + 'action' => 'index', + '?' => ['matchgrid_id' => $vv_cur_mg->id] + ], + ['escape' => false, 'class' => 'btn btn-default']); + ?> +
+
+
+ Html->link('' . __('match.op.reconcile.requests'), + ['controller' => 'Matchgrids', + 'action' => 'pending', + $vv_cur_mg->id], + ['escape' => false, 'class' => 'btn btn-default']); + ?> +
+
+
+ + + 'settings', + 'api_users' => 'vpn_key', + 'attributes' => 'edit', + 'attribute_groups' => 'storage', + 'attribute_maps' => 'swap_horiz', + 'rules' => 'assignment', + 'systems_of_record' => 'gavel', + ]; + + // We'll get most users simply by checking for build permission + $renderConfig = $vv_permissions['build']; + + if(!$renderConfig) { + foreach(array_keys($models) as $m) { + if(isset($vv_menu_permissions[$m]) && $vv_menu_permissions[$m]===true) { + $renderConfig = true; + break; + } + } + } + } + ?> + +

+
    + $icon) { + if($vv_menu_permissions[$model]) { + print '
  • '; + + $linkContent = '' + . __('match.ct.'.\Cake\Utility\Inflector::camelize($model), [99]) + . ''; + + print $this->Html->link( + $linkContent, + ['plugin' => null, + 'controller' => $model, + 'action' => 'index', + '?' => ['matchgrid_id' => $vv_cur_mg->id] + ], + ['escape' => false] + ); + + print '
  • '; + } + } + + if($vv_permissions['build']) { + print '
  • '; + + $linkContent = '' + . __('match.op.build') + . ''; + + print $this->Html->link( + $linkContent, + ['controller' => 'Matchgrids', + 'action' => 'build', + $vv_cur_mg->id], + ['escape' => false,'confirm' => __('match.op.build.confirm')] + ); + print '
  • '; + } + ?> +
+ +
diff --git a/app/templates/Matchgrids/pending.php b/app/templates/Matchgrids/pending.php new file mode 100644 index 00000000..96879407 --- /dev/null +++ b/app/templates/Matchgrids/pending.php @@ -0,0 +1,64 @@ + + +
+
+

+
+
+ +

+ + + + + + + + + + + + + + +
+ + + Html->link( + $p['sorid'], + ['action' => 'reconcile', + $vv_matchgrid_id, + '?' => [ 'rowid' => $p['id'] ] ], + ['class' => 'row-link'] + ); ?> + + +
diff --git a/app/src/Template/Matchgrids/reconcile.ctp b/app/templates/Matchgrids/reconcile.php similarity index 100% rename from app/src/Template/Matchgrids/reconcile.ctp rename to app/templates/Matchgrids/reconcile.php diff --git a/app/src/Template/Matchgrids/select.ctp b/app/templates/Matchgrids/select.php similarity index 100% rename from app/src/Template/Matchgrids/select.ctp rename to app/templates/Matchgrids/select.php diff --git a/app/src/Template/Pages/home.ctp b/app/templates/Pages/home.php similarity index 100% rename from app/src/Template/Pages/home.ctp rename to app/templates/Pages/home.php diff --git a/app/src/Template/Permissions/columns.inc b/app/templates/Permissions/columns.inc similarity index 100% rename from app/src/Template/Permissions/columns.inc rename to app/templates/Permissions/columns.inc diff --git a/app/src/Template/Permissions/fields.inc b/app/templates/Permissions/fields.inc similarity index 100% rename from app/src/Template/Permissions/fields.inc rename to app/templates/Permissions/fields.inc diff --git a/app/src/Template/RuleAttributes/columns.inc b/app/templates/RuleAttributes/columns.inc similarity index 100% rename from app/src/Template/RuleAttributes/columns.inc rename to app/templates/RuleAttributes/columns.inc diff --git a/app/src/Template/RuleAttributes/fields.inc b/app/templates/RuleAttributes/fields.inc similarity index 100% rename from app/src/Template/RuleAttributes/fields.inc rename to app/templates/RuleAttributes/fields.inc diff --git a/app/src/Template/Rules/columns.inc b/app/templates/Rules/columns.inc similarity index 100% rename from app/src/Template/Rules/columns.inc rename to app/templates/Rules/columns.inc diff --git a/app/src/Template/Rules/fields.inc b/app/templates/Rules/fields.inc similarity index 100% rename from app/src/Template/Rules/fields.inc rename to app/templates/Rules/fields.inc diff --git a/app/templates/Standard/add-edit-view.php b/app/templates/Standard/add-edit-view.php new file mode 100644 index 00000000..ae8d1850 --- /dev/null +++ b/app/templates/Standard/add-edit-view.php @@ -0,0 +1,89 @@ +request->getParam('action'); +// $this->name = Models +$modelsName = $this->name; +?> +
+
+

+
+
+ + + + +
+ info + +
+ + + + +Form->create($vv_obj); +} + +$linkId = null; + +if(!empty($vv_primary_link)) { + if(!empty($this->request->getQuery($vv_primary_link))) { + $linkId = $this->request->getQuery($vv_primary_link); + } elseif(!empty($this->request->getData($vv_primary_link))) { + $linkId = $this->request->getData($vv_primary_link); + } elseif(!empty($vv_obj->$vv_primary_link)) { + $linkId = $vv_obj->$vv_primary_link; + } +} + +print $this->Field->startControlSet($vv_obj, $this->name, $action, ($action == 'add' || $action == 'edit')); + +include(TEMPLATES . $modelsName . "/fields.inc"); + +if($action == 'add' || $action == 'edit') { + if(!empty($linkId)) { + // Hidden values used to link to parent objects (eg: matchgrid_id) + print $this->Form->hidden($vv_primary_link, ['value' => $linkId]); + } + + print $this->Field->submit(__('match.op.save')); + print $this->Form->end(); +} + +print $this->Field->endControlSet(); diff --git a/app/templates/Standard/index.php b/app/templates/Standard/index.php new file mode 100644 index 00000000..4e3dd1a6 --- /dev/null +++ b/app/templates/Standard/index.php @@ -0,0 +1,338 @@ +name = Models +$modelsName = $this->name; +// $tablefk = model_id +$tableFK = Inflector::singularize($vv_tablename) . "_id"; + +// Do we have records for this index? This will be set to true during render if we do. +// Otherwise, we'll print out a "no records" message. +$recordsExist = false; + +// Our default link actions, in order of preference, unless the column config overrides it +$linkActions = ['edit', 'view']; + +// Read the index configuration ($indexColumns) for this model +include(TEMPLATES . $modelsName . "/columns.inc"); + +// $linkFilter is used for models that belong to a specific parent model (eg: co_id) +$linkFilter = []; + +if(!empty($vv_primary_link) && !empty($this->request->getQuery($vv_primary_link))) { + $linkFilter = ['?' => [$vv_primary_link => $this->request->getQuery($vv_primary_link)]]; +} + +function _column_key($modelsName, $c, $tz=null) { + $product = __('product.code'); + + if(strpos($c, "_id", strlen($c)-3)) { + // Key is of the form field_id, use .ct label instead + $k = Inflector::camelize(Inflector::pluralize(substr($c, 0, strlen($c)-3))); + + return __($product.'.ct.'.$k, [1]); + } + + // Look for a model specific key first + $label = __($product.'.fd.'.$modelsName.'.'.$c); + + if($label != $product.'.fd.'.$modelsName.'.'.$c) { + return $label; + } + + if($tz) { + // If there is a timezone aware label, use that + $label = __($product.'.fd.'.$c.'.tz', [$tz]); + + if($label != $product.'.fd.'.$c.'.tz') { + return $label; + } + } + + // Otherwise look for the general key + return __($product.'.fd.'.$c); +} +?> +
+
+

+
+ + + + +
+ + +
+ info + +
+ + + + + +
+ info + +
+ + + + + + element('search'); ?> + + + +
+ + + $cfg): ?> + + + + + + id]; + + if(isset($forcePrimaryLink) && $forcePrimaryLink) { + $linkArgs = array_merge_recursive($linkArgs, $linkFilter); + } + ?> + + $cfg): ?> + + + + + + + + + +
Paginator->sort($cfg['sortable'], $label); + } else { + print $this->Paginator->sort($col, $label); + } + } else { + print $label; + } + ?>
+ $col) && $entity->$col) { + print __($product.'.en.'.$cfg['class'].'.1'); + } else { + print __($product.'.en.'.$cfg['class'].'.0'); + } + break; + case 'datetime': + // XXX dates can also be rendered as eg $entity->created->format(DATE_RFC850); + print $this->Time->nice($entity->$col, $vv_tz); + break; + case 'enum': + if($entity->$col) { + print __($product.'.en.'.$cfg['class'].'.'.$entity->$col); + } + break; + case 'fk': + // Assuming $col is of the form foo_id, look to see if the corresponding + // AutoViewVar $foos is set, and if so render the lookup value instead + $f = null; + if(preg_match('/^(.*?)_id$/', $col, $f)) { + $avv = Inflector::variable(Inflector::pluralize($f[1])); + + if(!empty(${$avv}[$entity->$col])) { + // We found the viewvar (eg: $foos), and it has a corresponding value + // (eg: $foos[3]), so render it + print ${$avv}[$entity->$col]; // XXX filter_var? + } else { + // No match, just render the value + print $entity->$col; + } + } else { + // Just print the value + print $entity->$col; + } + break; + case 'link': + case 'echo': + default: + // By default our label is the column value, but it might be overridden + $label = $entity->$col; + + if(!empty($cfg['model']) && !empty($cfg['field'])) { + $m = $cfg['model']; + $f = $cfg['field']; + + if(!empty($entity->$m->$f)) { + $label = $entity->$m->$f; + } + } + + $linked = false; + + if($cfg['type'] == 'link') { + foreach($linkActions as $a) { + // Does this user have permission for this action? + if($vv_permissions[$a]) { + print $this->Html->link($label, ['action' => $a, $entity->id]); + $linked = true; + break 2; + } + } + } + + if(!$linked) { + // Just echo the value + print $label; + } + break; + // XXX dates can be rendered as eg $entity->created->format(DATE_RFC850); + } + ?> + + Html->link( + __($product.'.op.edit'), + array_merge_recursive(['action' => 'edit'], $linkArgs), + ['class' => 'editbutton'] + ); + } + + if(isset($vv_permissions['duplicate']) && $vv_permissions['duplicate']) { + print $this->Html->link( + __($product.'.op.duplicate'), + array_merge_recursive(['action' => 'duplicate'], $linkArgs), + ['class' => 'copybutton'] + ); + } + + if($vv_permissions['delete']) { + // XXX this is throwing CSRF error even though delete button on edit-record page is working? + // probably because this is using Form helper, but we're outside of a form? + print $this->Form->postLink( + __($product.'.op.delete'), + array_merge_recursive(['action' => 'delete'], $linkArgs), + // XXX should be configurable which field we put in, maybe displayField? + ['confirm' => __($product.'.op.delete.confirm', [$entity->id]), + 'class' => 'deletebutton'] + ); + } + + if(!empty($indexActions)) { + // Insert additional actions as per the .inc file + + if(!isset($entity->status) || $entity->status == StatusEnum::Active) { + foreach($indexActions as $a) { + if($vv_permissions[ $a['action'] ]) { + // If we have a .confirm text, use postLink instead + + $confirmKey = $product.'.op.'.$a['action'].'.confirm'; + $confirmTxt = __($confirmKey); + + if($confirmTxt != $confirmKey) { + // We found the localized string + + print $this->Form->postLink( + __($product.'.op.' . $a['action']), + array_merge_recursive(['action' => $a['action']], $linkArgs), + // XXX should be configurable which field we put in, maybe displayField? + ['confirm' => __($confirmKey, [$entity->id]), + 'class' => $a['class']] + ); + } elseif(!empty($a['controller'])) { + // We're linking into a related controller + print $this->Html->link( + __('match.ct.' . Inflector::camelize(Inflector::pluralize($a['controller'])), [99]), + ['controller' => $a['controller'], + 'action' => $a['action'], + '?' => [ $tableFK => $entity->id] ], + ['class' => $a['class']] + ); + } else { + print $this->Html->link( + __($product.'.op.' . $a['action']), + array_merge_recursive(['action' => $a['action']], $linkArgs), + ['class' => $a['class']] + ); + } + } + } + } + } + ?> +
+
+ +element("pagination"); \ No newline at end of file diff --git a/app/src/Template/SystemsOfRecord/columns.inc b/app/templates/SystemsOfRecord/columns.inc similarity index 100% rename from app/src/Template/SystemsOfRecord/columns.inc rename to app/templates/SystemsOfRecord/columns.inc diff --git a/app/src/Template/SystemsOfRecord/fields.inc b/app/templates/SystemsOfRecord/fields.inc similarity index 100% rename from app/src/Template/SystemsOfRecord/fields.inc rename to app/templates/SystemsOfRecord/fields.inc diff --git a/app/src/Template/TierApi/response.ctp b/app/templates/TierApi/response.php similarity index 100% rename from app/src/Template/TierApi/response.ctp rename to app/templates/TierApi/response.php diff --git a/app/templates/element/breadcrumbs.php b/app/templates/element/breadcrumbs.php new file mode 100644 index 00000000..74189ee1 --- /dev/null +++ b/app/templates/element/breadcrumbs.php @@ -0,0 +1,127 @@ +request->getRequestTarget(false) != '/') { + // Don't bother rendering breadcrumbs if we're already at the top page + + $action = $this->request->getParam('action'); + // $this->name = Models + $modelsName = $this->name; + + $this->Breadcrumbs->setTemplates([ + 'wrapper' => '{{content}}', + 'item' => '{{title}}{{separator}}', + 'itemWithoutLink' => '{{title}}{{separator}}', + 'separator' => '{{separator}}' + ]); + + $this->Breadcrumbs->prepend( + __('match.meta.match'), + ['controller' => 'matchgrids', + 'action' => 'select'] + ); + + if(!empty($vv_cur_mg) + && ($modelsName != 'Matchgrids' || $action != 'manage')) { + // Link to matchgrid if set + $this->Breadcrumbs->add( + $vv_cur_mg->table_name, + ['controller' => 'matchgrids', + 'action' => 'manage', + $vv_cur_mg->id ] + ); + } + + if(!empty($vv_primary_link_obj) + && !empty($vv_primary_link_model) + && $vv_primary_link_model != 'Matchgrids') { + // If the primary link is not matchgrid, render a link to it (and the parent index). + // We'll need to calculate the controller name. + + if(!empty($vv_cur_mg->id)) { + // We currently assume the parent of a primary link is matchgrid, which + // might or might not always be true in the future. + $this->Breadcrumbs->add( + __('match.ct.'.$vv_primary_link_model, [99]), + ['controller' => \Cake\Utility\Inflector::dasherize($vv_primary_link_model), + 'action' => 'index', + '?' => [ 'matchgrid_id' => $vv_cur_mg->id] ] + ); + } + + $this->Breadcrumbs->add( + $vv_primary_link_obj->name, + ['controller' => \Cake\Utility\Inflector::dasherize($vv_primary_link_model), + 'action' => 'edit', + $vv_primary_link_obj->id] + ); + } + + if($action != 'index' && $action != 'manage' + && !($modelsName == 'Matchgrids' && $action == 'pending')) { + + // Default parent is index, to which we might need to append the Primary Link ID + $crumbLinkText = 'match.ct.'.$modelsName; + + $target = [ + 'controller' => Inflector::dasherize($modelsName), + 'action' => 'index' + ]; + + if(!empty($vv_primary_link) && !empty($vv_primary_link_obj->id)) { + $target['?'] = [$vv_primary_link => $vv_primary_link_obj->id]; + } + + // Non-index special cases + if ($modelsName == 'Matchgrids' && $action == 'reconcile') { + $crumbLinkText = 'match.ac.PendingRequests'; + $target = [ + 'controller' => Inflector::dasherize($modelsName), + 'action' => 'pending', + $vv_cur_mg->id // will always be set for reconcile + ]; + } + + $this->Breadcrumbs->add( + __($crumbLinkText, [99]), + $target + ); + } + + if(!empty($vv_title)) { + $this->Breadcrumbs->add( + $vv_title + ); + } + + print $this->Breadcrumbs->render( + [], + ['separator' => ' > '] + ); +} \ No newline at end of file diff --git a/app/src/Template/Element/Flash/default.ctp b/app/templates/element/flash/default.php similarity index 100% rename from app/src/Template/Element/Flash/default.ctp rename to app/templates/element/flash/default.php diff --git a/app/src/Template/Element/Flash/error.ctp b/app/templates/element/flash/error.php similarity index 100% rename from app/src/Template/Element/Flash/error.ctp rename to app/templates/element/flash/error.php diff --git a/app/src/Template/Element/Flash/information.ctp b/app/templates/element/flash/information.php similarity index 100% rename from app/src/Template/Element/Flash/information.ctp rename to app/templates/element/flash/information.php diff --git a/app/src/Template/Element/Flash/success.ctp b/app/templates/element/flash/success.php similarity index 100% rename from app/src/Template/Element/Flash/success.ctp rename to app/templates/element/flash/success.php diff --git a/app/src/Template/Element/footer.ctp b/app/templates/element/footer.php similarity index 100% rename from app/src/Template/Element/footer.ctp rename to app/templates/element/footer.php diff --git a/app/templates/element/javascript.php b/app/templates/element/javascript.php new file mode 100644 index 00000000..91553638 --- /dev/null +++ b/app/templates/element/javascript.php @@ -0,0 +1,283 @@ + + + + +Flash->render() ?> \ No newline at end of file diff --git a/app/templates/element/menuMain.php b/app/templates/element/menuMain.php new file mode 100644 index 00000000..1537d4f2 --- /dev/null +++ b/app/templates/element/menuMain.php @@ -0,0 +1,69 @@ + + diff --git a/app/templates/element/menuTop.php b/app/templates/element/menuTop.php new file mode 100644 index 00000000..17601a68 --- /dev/null +++ b/app/templates/element/menuTop.php @@ -0,0 +1,106 @@ + + +
    + +
  • + + + +
  • + +
  • + + + +
  • +
+ + + + Html->link(__('match.op.login'), + ['controller' => 'matchgrids', + 'action' => 'select', + 'plugin' => false], + ['escape' => false, + 'id' => 'login', + 'class' => '']); + } + ?> + diff --git a/app/templates/element/pagination.php b/app/templates/element/pagination.php new file mode 100644 index 00000000..c83fab84 --- /dev/null +++ b/app/templates/element/pagination.php @@ -0,0 +1,114 @@ +Paginator->hasPage(2)) { + $paginationClass = "with-pagination-elements"; + } +?> + + + diff --git a/app/templates/element/search.php b/app/templates/element/search.php new file mode 100644 index 00000000..d6c279a3 --- /dev/null +++ b/app/templates/element/search.php @@ -0,0 +1,141 @@ +name = Models +$modelsName = $this->name; +// $modelName = Model +$modelName = \Cake\Utility\Inflector::singularize($modelsName); + +// Get the query string and separate the search params from the non-search params +$query = $this->request->getQueryParams(); +$non_search_params = array_diff_key($query, $vv_searchable_attributes); +$search_params = array_intersect_key($query, $vv_searchable_attributes); + +// Begin the form +print $this->Form->create(null, [ + 'id' => 'top-search-form', + 'type' => 'get' +]); + +// Pass back the non-search params as hidden fields, but always exclude the page parameter +// because we need to start new searches on page one (or we're likely to end up with a 404). +if(!empty($non_search_params)) { + foreach($non_search_params as $param => $value) { + if($param != 'page') { + print $this->Form->hidden(filter_var($param, FILTER_SANITIZE_SPECIAL_CHARS), array('default' => filter_var($value, FILTER_SANITIZE_SPECIAL_CHARS))) . "\n"; + } + } +} + +// Boolean to distinguish between search filters and sort parameters +$hasActiveFilters = false; +?> + + + +Form->end(); ?> \ No newline at end of file diff --git a/app/src/Template/Email/html/default.ctp b/app/templates/email/html/default.php similarity index 100% rename from app/src/Template/Email/html/default.ctp rename to app/templates/email/html/default.php diff --git a/app/src/Template/Email/text/default.ctp b/app/templates/email/text/default.php similarity index 100% rename from app/src/Template/Email/text/default.ctp rename to app/templates/email/text/default.php diff --git a/app/templates/email/text/potential_match.php b/app/templates/email/text/potential_match.php new file mode 100644 index 00000000..83641abc --- /dev/null +++ b/app/templates/email/text/potential_match.php @@ -0,0 +1,38 @@ + + + + +?> +A new potential match is available for your review. You may access the +pending request at this URL: + + + \ No newline at end of file diff --git a/app/src/Template/Layout/Email/text/default.ctp b/app/templates/layout/ajax.php similarity index 100% rename from app/src/Template/Layout/Email/text/default.ctp rename to app/templates/layout/ajax.php diff --git a/app/src/Template/Layout/default.ctp b/app/templates/layout/default.php similarity index 100% rename from app/src/Template/Layout/default.ctp rename to app/templates/layout/default.php diff --git a/app/src/Template/Layout/Email/html/default.ctp b/app/templates/layout/email/html/default.php similarity index 100% rename from app/src/Template/Layout/Email/html/default.ctp rename to app/templates/layout/email/html/default.php diff --git a/app/src/Template/Layout/ajax.ctp b/app/templates/layout/email/text/default.php similarity index 100% rename from app/src/Template/Layout/ajax.ctp rename to app/templates/layout/email/text/default.php diff --git a/app/src/Template/Layout/error.ctp b/app/templates/layout/error.php similarity index 100% rename from app/src/Template/Layout/error.ctp rename to app/templates/layout/error.php diff --git a/app/src/Template/Layout/rest.ctp b/app/templates/layout/rest.php similarity index 100% rename from app/src/Template/Layout/rest.ctp rename to app/templates/layout/rest.php diff --git a/app/src/Template/Layout/rss/default.ctp b/app/templates/layout/rss/default.php similarity index 100% rename from app/src/Template/Layout/rss/default.ctp rename to app/templates/layout/rss/default.php diff --git a/app/vendor/ajgl/breakpoint-twig-extension/.github/workflows/tests.yaml b/app/vendor/ajgl/breakpoint-twig-extension/.github/workflows/tests.yaml deleted file mode 100644 index 90487262..00000000 --- a/app/vendor/ajgl/breakpoint-twig-extension/.github/workflows/tests.yaml +++ /dev/null @@ -1,47 +0,0 @@ -name: tests - -on: - push: - pull_request: - -jobs: - tests: - runs-on: ubuntu-latest - continue-on-error: ${{ matrix.allow_failure }} - strategy: - fail-fast: false - matrix: - php: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0'] - stability: ['prefer-lowest', 'prefer-stable'] - allow_failure: [false] - include: - - php: '8.0' - stability: 'dev' - allow_failure: true - - name: ${{ matrix.php }}-${{ matrix.stability }} - - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Cache dependencies - uses: actions/cache@v1 - with: - path: ~/.composer/cache/files - key: dependencies-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }} - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - coverage: none - - - name: Install dependencies - run: composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-progress - - - name: Check coding standard - run: composer lint - - - name: Execute tests - run: composer test || ${{ matrix.allow_failure }} diff --git a/app/vendor/ajgl/breakpoint-twig-extension/.gitignore b/app/vendor/ajgl/breakpoint-twig-extension/.gitignore deleted file mode 100644 index 25be7c4d..00000000 --- a/app/vendor/ajgl/breakpoint-twig-extension/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -/vendor/ -*.cache -composer.lock -phpunit.xml diff --git a/app/vendor/ajgl/breakpoint-twig-extension/.php_cs.dist b/app/vendor/ajgl/breakpoint-twig-extension/.php_cs.dist deleted file mode 100644 index 65878857..00000000 --- a/app/vendor/ajgl/breakpoint-twig-extension/.php_cs.dist +++ /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/app/vendor/ajgl/breakpoint-twig-extension/CHANGELOG.md b/app/vendor/ajgl/breakpoint-twig-extension/CHANGELOG.md deleted file mode 100644 index 337f00c3..00000000 --- a/app/vendor/ajgl/breakpoint-twig-extension/CHANGELOG.md +++ /dev/null @@ -1,68 +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.5] - 2021-02-08 - -### Added -- Add support for Symfony 5 -- Add support for Twig 3.x - - -## [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.5...master -[0.3.4]: https://github.com/ajgarlag/AjglBreakpointTwigExtension/compare/0.3.4...0.3.5 -[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/app/vendor/ajgl/breakpoint-twig-extension/LICENSE b/app/vendor/ajgl/breakpoint-twig-extension/LICENSE deleted file mode 100644 index 9aeafa27..00000000 --- a/app/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/app/vendor/ajgl/breakpoint-twig-extension/README.md b/app/vendor/ajgl/breakpoint-twig-extension/README.md deleted file mode 100644 index 18b2e778..00000000 --- a/app/vendor/ajgl/breakpoint-twig-extension/README.md +++ /dev/null @@ -1,122 +0,0 @@ -AjglBreakpointTwigExtension -=========================== - -The AjglBreakpointTwigExtension component allows you set breakpoints in twig templates. - -[![Build Status](https://github.com/ajgarlag/AjglBreakpointTwigExtension/workflows/tests/badge.svg?branch=master)](https://github.com/ajgarlag/AjglBreakpointTwigExtension/actions) -[![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) -[![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/5 - -```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/app/vendor/ajgl/breakpoint-twig-extension/composer.json b/app/vendor/ajgl/breakpoint-twig-extension/composer.json deleted file mode 100644 index cf466f2e..00000000 --- a/app/vendor/ajgl/breakpoint-twig-extension/composer.json +++ /dev/null @@ -1,55 +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.34|^2.0|^3.0" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "^2.18", - "symfony/framework-bundle": "^2.7|^3.4|^4.4|^5.2", - "symfony/phpunit-bridge": "^4.4|^5.2", - "symfony/twig-bundle": "^2.7|^3.4|^4.4|^5.2" - }, - "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": { - "fix-cs": [ - "vendor/bin/php-cs-fixer fix --ansi" - ], - "lint": [ - "vendor/bin/php-cs-fixer fix --dry-run --ansi" - ], - "test": [ - "vendor/bin/simple-phpunit --colors=always" - ] - }, - "config": { - "sort-packages": true - }, - "extra": { - "branch-alias": { - "dev-master": "0.3.x-dev" - } - } -} diff --git a/app/vendor/ajgl/breakpoint-twig-extension/phpunit.xml.dist b/app/vendor/ajgl/breakpoint-twig-extension/phpunit.xml.dist deleted file mode 100644 index ec8dc6e4..00000000 --- a/app/vendor/ajgl/breakpoint-twig-extension/phpunit.xml.dist +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - ./tests - - - - - - ./src - - - - diff --git a/app/vendor/ajgl/breakpoint-twig-extension/src/BreakpointExtension.php b/app/vendor/ajgl/breakpoint-twig-extension/src/BreakpointExtension.php deleted file mode 100644 index f839d683..00000000 --- a/app/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/app/vendor/ajgl/breakpoint-twig-extension/src/SymfonyBundle/AjglBreakpointTwigExtensionBundle.php b/app/vendor/ajgl/breakpoint-twig-extension/src/SymfonyBundle/AjglBreakpointTwigExtensionBundle.php deleted file mode 100644 index 2caa7ca8..00000000 --- a/app/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/app/vendor/ajgl/breakpoint-twig-extension/src/SymfonyBundle/DependencyInjection/AjglBreakpointTwigExtensionExtension.php b/app/vendor/ajgl/breakpoint-twig-extension/src/SymfonyBundle/DependencyInjection/AjglBreakpointTwigExtensionExtension.php deleted file mode 100644 index cf25daac..00000000 --- a/app/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/app/vendor/ajgl/breakpoint-twig-extension/src/SymfonyBundle/Resources/config/twig.xml b/app/vendor/ajgl/breakpoint-twig-extension/src/SymfonyBundle/Resources/config/twig.xml deleted file mode 100644 index e7bd8321..00000000 --- a/app/vendor/ajgl/breakpoint-twig-extension/src/SymfonyBundle/Resources/config/twig.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - diff --git a/app/vendor/ajgl/breakpoint-twig-extension/tests/BreakpointExtensionTest.php b/app/vendor/ajgl/breakpoint-twig-extension/tests/BreakpointExtensionTest.php deleted file mode 100644 index b4316ab3..00000000 --- a/app/vendor/ajgl/breakpoint-twig-extension/tests/BreakpointExtensionTest.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 Ajgl\Twig\Extension\Tests; - -use Ajgl\Twig\Extension\BreakpointExtension; -use PHPUnit\Framework\TestCase; -use Symfony\Bridge\PhpUnit\SetUpTearDownTrait; -use Twig\TwigFunction; - -/** - * @author Antonio J. García Lagar - */ -class BreakpointExtensionTest extends TestCase -{ - use SetUpTearDownTrait; - - /** - * @var BreakpointExtension - */ - protected $extension; - - protected function doSetUp() - { - $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(TwigFunction::class, $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/app/vendor/ajgl/breakpoint-twig-extension/tests/SymfonyBundle/DependencyInjection/AjglBreakpointTwigExtensionExtensionTest.php b/app/vendor/ajgl/breakpoint-twig-extension/tests/SymfonyBundle/DependencyInjection/AjglBreakpointTwigExtensionExtensionTest.php deleted file mode 100644 index f3eebbf8..00000000 --- a/app/vendor/ajgl/breakpoint-twig-extension/tests/SymfonyBundle/DependencyInjection/AjglBreakpointTwigExtensionExtensionTest.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 Ajgl\Twig\Extension\Tests\SymfonyBundle\DependencyInjection; - -use Ajgl\Twig\Extension\SymfonyBundle\DependencyInjection\AjglBreakpointTwigExtensionExtension; -use PHPUnit\Framework\TestCase; -use Symfony\Bridge\PhpUnit\SetUpTearDownTrait; -use Symfony\Component\DependencyInjection\ContainerBuilder; - -/** - * @author Antonio J. García Lagar - */ -class AjglBreakpointTwigExtensionExtensionTest extends TestCase -{ - use SetUpTearDownTrait; - - /** - * @var ContainerBuilder - */ - protected $container; - - /** - * @var AjglBreakpointTwigExtensionExtension - */ - protected $extension; - - protected function doSetUp() - { - $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/app/vendor/aptoma/twig-markdown/.gitignore b/app/vendor/aptoma/twig-markdown/.gitignore deleted file mode 100644 index 91205156..00000000 --- a/app/vendor/aptoma/twig-markdown/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -vendor -composer.phar -phpunit.xml diff --git a/app/vendor/aptoma/twig-markdown/.travis.yml b/app/vendor/aptoma/twig-markdown/.travis.yml deleted file mode 100644 index 62d7420d..00000000 --- a/app/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/app/vendor/aptoma/twig-markdown/CHANGELOG.md b/app/vendor/aptoma/twig-markdown/CHANGELOG.md deleted file mode 100644 index 09db06d3..00000000 --- a/app/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/app/vendor/aptoma/twig-markdown/README.md b/app/vendor/aptoma/twig-markdown/README.md deleted file mode 100644 index b6807ef1..00000000 --- a/app/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/app/vendor/aptoma/twig-markdown/composer.json b/app/vendor/aptoma/twig-markdown/composer.json deleted file mode 100644 index 491c1f06..00000000 --- a/app/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/app/vendor/aptoma/twig-markdown/composer.lock b/app/vendor/aptoma/twig-markdown/composer.lock deleted file mode 100644 index dac9b0d0..00000000 --- a/app/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/app/vendor/aptoma/twig-markdown/phpunit.xml.dist b/app/vendor/aptoma/twig-markdown/phpunit.xml.dist deleted file mode 100644 index f67a5796..00000000 --- a/app/vendor/aptoma/twig-markdown/phpunit.xml.dist +++ /dev/null @@ -1,18 +0,0 @@ - - - - - ./tests/ - - - diff --git a/app/vendor/aptoma/twig-markdown/src/Aptoma/Twig/Extension/MarkdownEngine/GitHubMarkdownEngine.php b/app/vendor/aptoma/twig-markdown/src/Aptoma/Twig/Extension/MarkdownEngine/GitHubMarkdownEngine.php deleted file mode 100644 index 10905c25..00000000 --- a/app/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/app/vendor/aptoma/twig-markdown/src/Aptoma/Twig/Extension/MarkdownEngine/MichelfMarkdownEngine.php b/app/vendor/aptoma/twig-markdown/src/Aptoma/Twig/Extension/MarkdownEngine/MichelfMarkdownEngine.php deleted file mode 100644 index 92899eae..00000000 --- a/app/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/app/vendor/aptoma/twig-markdown/src/Aptoma/Twig/Extension/MarkdownEngine/PHPLeagueCommonMarkEngine.php b/app/vendor/aptoma/twig-markdown/src/Aptoma/Twig/Extension/MarkdownEngine/PHPLeagueCommonMarkEngine.php deleted file mode 100644 index e10a7d22..00000000 --- a/app/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/app/vendor/aptoma/twig-markdown/src/Aptoma/Twig/Extension/MarkdownEngine/ParsedownEngine.php b/app/vendor/aptoma/twig-markdown/src/Aptoma/Twig/Extension/MarkdownEngine/ParsedownEngine.php deleted file mode 100644 index 62ee679c..00000000 --- a/app/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/app/vendor/aptoma/twig-markdown/src/Aptoma/Twig/Extension/MarkdownEngineInterface.php b/app/vendor/aptoma/twig-markdown/src/Aptoma/Twig/Extension/MarkdownEngineInterface.php deleted file mode 100644 index cfc34b36..00000000 --- a/app/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/app/vendor/aptoma/twig-markdown/src/Aptoma/Twig/Extension/MarkdownExtension.php b/app/vendor/aptoma/twig-markdown/src/Aptoma/Twig/Extension/MarkdownExtension.php deleted file mode 100644 index 522d49c1..00000000 --- a/app/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/app/vendor/aptoma/twig-markdown/src/Aptoma/Twig/Node/MarkdownNode.php b/app/vendor/aptoma/twig-markdown/src/Aptoma/Twig/Node/MarkdownNode.php deleted file mode 100644 index 9e38a35b..00000000 --- a/app/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/app/vendor/aptoma/twig-markdown/src/Aptoma/Twig/TokenParser/MarkdownTokenParser.php b/app/vendor/aptoma/twig-markdown/src/Aptoma/Twig/TokenParser/MarkdownTokenParser.php deleted file mode 100644 index 9f587f91..00000000 --- a/app/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/app/vendor/aptoma/twig-markdown/tests/Aptoma/Twig/Extension/MarkdownEngine/GithubMarkdownEngineTest.php b/app/vendor/aptoma/twig-markdown/tests/Aptoma/Twig/Extension/MarkdownEngine/GithubMarkdownEngineTest.php deleted file mode 100644 index 054205b7..00000000 --- a/app/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/app/vendor/aptoma/twig-markdown/tests/Aptoma/Twig/Extension/MarkdownEngine/PHPLeagueCommonMarkEngineTest.php b/app/vendor/aptoma/twig-markdown/tests/Aptoma/Twig/Extension/MarkdownEngine/PHPLeagueCommonMarkEngineTest.php deleted file mode 100644 index 806ca026..00000000 --- a/app/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/app/vendor/aptoma/twig-markdown/tests/Aptoma/Twig/Extension/MarkdownEngine/ParsedownEngineTest.php b/app/vendor/aptoma/twig-markdown/tests/Aptoma/Twig/Extension/MarkdownEngine/ParsedownEngineTest.php deleted file mode 100644 index 5337ca01..00000000 --- a/app/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/app/vendor/aptoma/twig-markdown/tests/Aptoma/Twig/Extension/MarkdownExtensionTest.php b/app/vendor/aptoma/twig-markdown/tests/Aptoma/Twig/Extension/MarkdownExtensionTest.php deleted file mode 100644 index b21dad10..00000000 --- a/app/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/app/vendor/aptoma/twig-markdown/tests/Aptoma/Twig/TokenParser/MarkdownTokenParserTest.php b/app/vendor/aptoma/twig-markdown/tests/Aptoma/Twig/TokenParser/MarkdownTokenParserTest.php deleted file mode 100644 index 34c7a884..00000000 --- a/app/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/app/vendor/asm89/twig-cache-extension/.gitignore b/app/vendor/asm89/twig-cache-extension/.gitignore deleted file mode 100644 index 8844fdc4..00000000 --- a/app/vendor/asm89/twig-cache-extension/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -phpunit.xml -composer.lock -composer.phar -/vendor/ diff --git a/app/vendor/asm89/twig-cache-extension/.travis.yml b/app/vendor/asm89/twig-cache-extension/.travis.yml deleted file mode 100644 index c1380416..00000000 --- a/app/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/app/vendor/asm89/twig-cache-extension/LICENSE b/app/vendor/asm89/twig-cache-extension/LICENSE deleted file mode 100644 index 6e6b0885..00000000 --- a/app/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/app/vendor/asm89/twig-cache-extension/README.md b/app/vendor/asm89/twig-cache-extension/README.md deleted file mode 100644 index 38c08878..00000000 --- a/app/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/app/vendor/asm89/twig-cache-extension/composer.json b/app/vendor/asm89/twig-cache-extension/composer.json deleted file mode 100644 index 176befbf..00000000 --- a/app/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/app/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheProvider/DoctrineCacheAdapter.php b/app/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheProvider/DoctrineCacheAdapter.php deleted file mode 100644 index bb627fa4..00000000 --- a/app/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/app/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheProvider/PsrCacheAdapter.php b/app/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheProvider/PsrCacheAdapter.php deleted file mode 100644 index 3a525bc2..00000000 --- a/app/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/app/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheProviderInterface.php b/app/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheProviderInterface.php deleted file mode 100644 index 7a0a5604..00000000 --- a/app/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/app/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheStrategy/BlackholeCacheStrategy.php b/app/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheStrategy/BlackholeCacheStrategy.php deleted file mode 100644 index fcc9445f..00000000 --- a/app/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/app/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheStrategy/GenerationalCacheStrategy.php b/app/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheStrategy/GenerationalCacheStrategy.php deleted file mode 100644 index a67ea78b..00000000 --- a/app/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/app/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheStrategy/IndexedChainingCacheStrategy.php b/app/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheStrategy/IndexedChainingCacheStrategy.php deleted file mode 100644 index 7305f04c..00000000 --- a/app/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/app/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheStrategy/KeyGeneratorInterface.php b/app/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheStrategy/KeyGeneratorInterface.php deleted file mode 100644 index ed982108..00000000 --- a/app/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/app/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheStrategy/LifetimeCacheStrategy.php b/app/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheStrategy/LifetimeCacheStrategy.php deleted file mode 100644 index cb835160..00000000 --- a/app/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/app/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheStrategyInterface.php b/app/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheStrategyInterface.php deleted file mode 100644 index 4a6e580a..00000000 --- a/app/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/app/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/Exception/BaseException.php b/app/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/Exception/BaseException.php deleted file mode 100644 index 470b1612..00000000 --- a/app/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/app/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/Exception/InvalidCacheKeyException.php b/app/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/Exception/InvalidCacheKeyException.php deleted file mode 100644 index 33275591..00000000 --- a/app/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/app/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/Exception/InvalidCacheLifetimeException.php b/app/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/Exception/InvalidCacheLifetimeException.php deleted file mode 100644 index e7803552..00000000 --- a/app/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/app/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/Exception/NonExistingStrategyException.php b/app/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/Exception/NonExistingStrategyException.php deleted file mode 100644 index c4ea6f67..00000000 --- a/app/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/app/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/Exception/NonExistingStrategyKeyException.php b/app/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/Exception/NonExistingStrategyKeyException.php deleted file mode 100644 index eef30a7a..00000000 --- a/app/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/app/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/Extension.php b/app/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/Extension.php deleted file mode 100644 index b7c653b3..00000000 --- a/app/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/app/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/Node/CacheNode.php b/app/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/Node/CacheNode.php deleted file mode 100644 index 25972890..00000000 --- a/app/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/app/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/TokenParser/Cache.php b/app/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/TokenParser/Cache.php deleted file mode 100644 index 3d45a661..00000000 --- a/app/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/app/vendor/asm89/twig-cache-extension/phpunit.xml.dist b/app/vendor/asm89/twig-cache-extension/phpunit.xml.dist deleted file mode 100644 index 888e3058..00000000 --- a/app/vendor/asm89/twig-cache-extension/phpunit.xml.dist +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - ./test/Asm89/ - - - - - - ./lib/ - - - diff --git a/app/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/CacheProvider/DoctrineCacheAdapterTest.php b/app/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/CacheProvider/DoctrineCacheAdapterTest.php deleted file mode 100644 index bea9851a..00000000 --- a/app/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/app/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/CacheStrategy/GenerationCacheStrategyTest.php b/app/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/CacheStrategy/GenerationCacheStrategyTest.php deleted file mode 100644 index d74ecdee..00000000 --- a/app/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/app/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/CacheStrategy/IndexedChainingCacheStrategyTest.php b/app/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/CacheStrategy/IndexedChainingCacheStrategyTest.php deleted file mode 100644 index 480a0b1a..00000000 --- a/app/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/app/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/CacheStrategy/LifetimeCacheStrategyTest.php b/app/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/CacheStrategy/LifetimeCacheStrategyTest.php deleted file mode 100644 index 10d1a868..00000000 --- a/app/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/app/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/FunctionalExtensionTest.php b/app/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/FunctionalExtensionTest.php deleted file mode 100644 index 77a58e65..00000000 --- a/app/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/app/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/fixtures/annotation_expression.twig b/app/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/fixtures/annotation_expression.twig deleted file mode 100644 index 8f4587b7..00000000 --- a/app/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/app/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/fixtures/annotation_not_string.twig b/app/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/fixtures/annotation_not_string.twig deleted file mode 100644 index d962dedc..00000000 --- a/app/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/app/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/fixtures/gcs_value.twig b/app/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/fixtures/gcs_value.twig deleted file mode 100644 index 59a39bf2..00000000 --- a/app/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/app/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/fixtures/gcs_value_v2.twig b/app/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/fixtures/gcs_value_v2.twig deleted file mode 100644 index e7281174..00000000 --- a/app/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/app/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/fixtures/ics_no_key.twig b/app/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/fixtures/ics_no_key.twig deleted file mode 100644 index 12b924b0..00000000 --- a/app/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/app/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/fixtures/ics_value.twig b/app/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/fixtures/ics_value.twig deleted file mode 100644 index efc52ea6..00000000 --- a/app/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/app/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/fixtures/lcs_value.twig b/app/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/fixtures/lcs_value.twig deleted file mode 100644 index 12b924b0..00000000 --- a/app/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/app/vendor/asm89/twig-cache-extension/test/bootstrap.php b/app/vendor/asm89/twig-cache-extension/test/bootstrap.php deleted file mode 100644 index d4567192..00000000 --- a/app/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/app/vendor/bin/phpstan b/app/vendor/bin/phpstan new file mode 120000 index 00000000..959384f7 --- /dev/null +++ b/app/vendor/bin/phpstan @@ -0,0 +1 @@ +../phpstan/phpstan/phpstan \ No newline at end of file diff --git a/app/vendor/bin/phpstan.phar b/app/vendor/bin/phpstan.phar new file mode 120000 index 00000000..502769be --- /dev/null +++ b/app/vendor/bin/phpstan.phar @@ -0,0 +1 @@ +../phpstan/phpstan/phpstan.phar \ No newline at end of file diff --git a/app/vendor/bin/phpunit b/app/vendor/bin/phpunit new file mode 120000 index 00000000..2c489303 --- /dev/null +++ b/app/vendor/bin/phpunit @@ -0,0 +1 @@ +../phpunit/phpunit/phpunit \ No newline at end of file diff --git a/app/vendor/cakephp-plugins.php b/app/vendor/cakephp-plugins.php index d80def0a..114fb5ee 100644 --- a/app/vendor/cakephp-plugins.php +++ b/app/vendor/cakephp-plugins.php @@ -1,10 +1,11 @@ [ 'Bake' => $baseDir . '/vendor/cakephp/bake/', + 'Cake/TwigView' => $baseDir . '/vendor/cakephp/twig-view/', '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/app/vendor/cakephp/bake/.appveyor.yml b/app/vendor/cakephp/bake/.appveyor.yml new file mode 100644 index 00000000..ed138279 --- /dev/null +++ b/app/vendor/cakephp/bake/.appveyor.yml @@ -0,0 +1,48 @@ +build: false +platform: 'x64' +clone_folder: C:\projects\bake +clone_depth: 10 + +services: + - mssql2012sp1 + +environment: + global: + db_dsn: 'sqlserver://sa:Password12!@.\SQL2012SP1/cakephp?MultipleActiveResultSets=false' + +init: + - SET PATH=C:\Program Files\OpenSSL;c:\php;c:\composer;%PATH% + - SET COMPOSER_NO_INTERACTION=1 + - SET ANSICON=121x90 (121x90) + +install: + - curl -fsS https://windows.php.net/downloads/releases/latest/php-7.2-nts-Win32-VC15-x64-latest.zip -o php.zip + - curl -fsS https://windows.php.net/downloads/pecl/releases/pdo_sqlsrv/5.6.1/php_pdo_sqlsrv-5.6.1-7.2-nts-vc15-x64.zip -o pdosqlsrv.zip + - curl -fsS https://windows.php.net/downloads/pecl/releases/sqlsrv/5.6.1/php_sqlsrv-5.6.1-7.2-nts-vc15-x64.zip -o sqlsrv.zip + - 7z x php.zip -oC:\php\ -aoa > nul + - 7z x pdosqlsrv.zip -oC:\php\ext php_pdo_sqlsrv.dll -aoa > nul + - 7z x sqlsrv.zip -oC:\php\ext php_sqlsrv.dll -aoa > nul + + - cd C:\php + - copy php.ini-production php.ini /Y + - echo date.timezone="UTC" >> php.ini + - echo extension_dir=ext >> php.ini + - echo extension=openssl >> php.ini + - echo extension=mbstring >> php.ini + - echo extension=intl >> php.ini + - echo extension=pdo_sqlsrv >> php.ini + - echo extension=sqlsrv >> php.ini + - php -v + + - mkdir C:\composer + - cd C:\composer + - appveyor-retry appveyor DownloadFile https://getcomposer.org/composer.phar + + - cd C:\projects\bake + - php C:\composer\composer.phar update --no-progress + - php C:\composer\composer.phar show + +test_script: + - sqlcmd -S localhost,1433 -U sa -P Password12! -Q "create database cakephp;" + - cd c:\projects\bake + - vendor\bin\phpunit diff --git a/app/vendor/cakephp/bake/README.md b/app/vendor/cakephp/bake/README.md index 621d2a8d..4c645515 100644 --- a/app/vendor/cakephp/bake/README.md +++ b/app/vendor/cakephp/bake/README.md @@ -1,6 +1,7 @@ # Bake plugin for CakePHP -[![Build Status](https://img.shields.io/travis/cakephp/bake/master.svg?style=flat-square)](https://travis-ci.org/cakephp/bake) +[![Build Status](https://img.shields.io/travis/com/cakephp/bake/master.svg?style=flat-square)](https://travis-ci.com/cakephp/bake) +[![Latest Stable Version](https://img.shields.io/github/v/release/cakephp/bake?sort=semver&style=flat-square)](https://packagist.org/packages/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) @@ -19,7 +20,7 @@ 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). +You can find the documentation for bake [on its own cookbook](https://book.cakephp.org/bake/2). ## Testing diff --git a/app/vendor/cakephp/bake/composer.json b/app/vendor/cakephp/bake/composer.json index 677841f9..104afae3 100644 --- a/app/vendor/cakephp/bake/composer.json +++ b/app/vendor/cakephp/bake/composer.json @@ -1,6 +1,6 @@ { "name": "cakephp/bake", - "description": "Bake plugin for CakePHP 3", + "description": "Bake plugin for CakePHP", "type": "cakephp-plugin", "keywords": ["cakephp", "bake"], "homepage": "https://github.com/cakephp/bake", @@ -18,14 +18,14 @@ "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" + "php": ">=7.2", + "cakephp/cakephp": "^4.0", + "cakephp/twig-view": "^1.0" }, "require-dev": { - "cakephp/cakephp-codesniffer": "^3.0", - "phpunit/phpunit": "^5.7.14|^6.0" + "cakephp/cakephp-codesniffer": "^4.0", + "phpunit/phpunit": "~8.5.0", + "cakephp/debug_kit": "^4.1" }, "autoload": { "psr-4": { @@ -35,10 +35,11 @@ "autoload-dev": { "psr-4": { "BakeTest\\": "tests/test_app/Plugin/BakeTest/src/", + "Company\\Pastry\\": "tests/test_app/Plugin/Company/Pastry/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/" + "Cake\\Test\\": "vendor/cakephp/cakephp/tests/" } }, "scripts": { @@ -48,8 +49,8 @@ ], "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", + "stan": "phpstan analyse src/ && psalm.phar", + "stan-setup": "cp composer.json composer.backup && composer require --dev phpstan/phpstan:^0.12.7 psalm/phar:~3.17.2 && mv composer.backup composer.json", "test": "phpunit", "test-coverage": "phpunit --coverage-clover=clover.xml" } diff --git a/app/vendor/cakephp/bake/docs/config/all.py b/app/vendor/cakephp/bake/docs/config/all.py index b74fcbe0..9e899be5 100644 --- a/app/vendor/cakephp/bake/docs/config/all.py +++ b/app/vendor/cakephp/bake/docs/config/all.py @@ -10,10 +10,10 @@ # # The full version, including alpha/beta/rc tags. -release = '1.x' +release = '2.x' # The search index version. -search_version = 'bake-1' +search_version = 'bake-2' # The marketing display name for the book. version_name = '' @@ -23,8 +23,8 @@ # 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'}, + {'name': '1.x', 'number': '/bake/1.x', 'title': '1.x'}, + {'name': '2.x', 'number': '/bake/2.x', 'title': '2.x', 'current': True}, ] # Languages available. @@ -35,7 +35,7 @@ branch = 'master' # Current version being built -version = '1.x' +version = '2.x' # Language in use for this directory. language = 'en' diff --git a/app/vendor/cakephp/bake/docs/en/development.rst b/app/vendor/cakephp/bake/docs/en/development.rst index 68eebdbd..369367ad 100644 --- a/app/vendor/cakephp/bake/docs/en/development.rst +++ b/app/vendor/cakephp/bake/docs/en/development.rst @@ -105,7 +105,7 @@ bake related event logic and provide callbacks that are easier to test. Bake Template Syntax ==================== -Bake template files use the `Twig `__ 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 @@ -118,7 +118,7 @@ So, for example, when baking a shell like so: bin/cake bake shell Foo -The template used (**vendor/cakephp/bake/src/Template/Bake/Shell/shell.twig**) +The template used (**vendor/cakephp/bake/templates/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 @@ -187,9 +175,9 @@ 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/**. +#. Create a new directory **plugins/[name]/templates/bake**. #. Copy any templates you want to override from - **vendor/cakephp/bake/src/Template/Bake/Template** to matching files in your + **vendor/cakephp/bake/templates/bake** 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 @@ -206,75 +194,76 @@ If you wish to modify the default output produced by the "bake" command, you can create your own bake templates in your application. This way does not use the ``--theme`` option in the command line when baking. The best way to do this is: -#. Create a new directory **/src/Template/Bake/**. +#. Create a new directory **/templates/plugin/Bake/**. #. Copy any templates you want to override from - **vendor/cakephp/bake/src/Template/Bake/** to matching files in your + **vendor/cakephp/bake/templates/bake/** to matching files in your application. Creating New Bake Command Options ================================= It's possible to add new bake command options, or override the ones provided by -CakePHP by creating tasks in your application or plugins. By extending -``Bake\Shell\Task\BakeTask``, bake will find your new task and include it as +CakePHP by creating command in your application or plugins. By extending +``Bake\Command\BakeCommand``, bake will find your new command and include it as part of bake. -As an example, we'll make a task that creates an arbitrary foo class. First, -create the task file **src/Shell/Task/FooTask.php**. We'll extend the -``SimpleBakeTask`` for now as our shell task will be simple. ``SimpleBakeTask`` +As an example, we'll make a command that creates an arbitrary foo class. First, +create the command file **src/Command/FooCommand.php**. We'll extend the +``SimpleBakeCommand`` for now as our shell task will be simple. ``SimpleBakeCommand`` is abstract and requires us to define 3 methods that tell bake what the task is called, where the files it generates should go, and what template to use. Our -FooTask.php file should look like:: +FooCommand.php file should look like:: on( + 'Bake.initialize', + function ($event, $view) { + $view->loadHelper('Foo'); + } + ); .. meta:: :title lang=en: Extending Bake - :keywords lang=en: command line interface,development,bake view, bake template syntax,twig,erb tags,percent tags - + :keywords lang=en: command line interface, development, bake view, bake template syntax, twig, erb tags, percent tags diff --git a/app/vendor/cakephp/bake/docs/en/index.rst b/app/vendor/cakephp/bake/docs/en/index.rst index 1020e904..fc697c5f 100644 --- a/app/vendor/cakephp/bake/docs/en/index.rst +++ b/app/vendor/cakephp/bake/docs/en/index.rst @@ -14,13 +14,13 @@ 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 + composer require --dev cakephp/bake:~2.0 The above will install bake as a development dependency. This means that it will -not be installed when you do production deployments. +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 +``Cake/TwigView`` plugin with its bootstrap. You can also omit it completely which then makes Bake plugin load this plugin on demand. .. meta:: diff --git a/app/vendor/cakephp/bake/docs/en/usage.rst b/app/vendor/cakephp/bake/docs/en/usage.rst index 956efe0c..efac63f1 100644 --- a/app/vendor/cakephp/bake/docs/en/usage.rst +++ b/app/vendor/cakephp/bake/docs/en/usage.rst @@ -1,7 +1,7 @@ Code Generation with Bake ######################### -The cake console is run using the PHP CLI (command line interface). +The Bake 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 diff --git a/app/vendor/cakephp/bake/docs/ja/development.rst b/app/vendor/cakephp/bake/docs/ja/development.rst index 75ffc543..a7d733ed 100644 --- a/app/vendor/cakephp/bake/docs/ja/development.rst +++ b/app/vendor/cakephp/bake/docs/ja/development.rst @@ -207,8 +207,8 @@ Bake テンプレートのカスタマイズ bake テンプレートを作成することができます。この方法では、bake する際、コマンドラインで ``--theme`` オプションを使用していません。これを行うための最善の方法は、次のとおりです。 -#. 新しいディレクトリー **/src/Template/Bake/** を作成します。 -#. **vendor/cakephp/bake/src/Template/Bake/** から上書きしたいテンプレートを +#. 新しいディレクトリー **/templates/plugin/Bake/** を作成します。 +#. **vendor/cakephp/bake/templates/bake/** から上書きしたいテンプレートを あなたのアプリケーションの中の適切なファイルにコピーします。 Bake コマンドオプションの新規作成 diff --git a/app/vendor/cakephp/bake/docs/ja/index.rst b/app/vendor/cakephp/bake/docs/ja/index.rst index a37f45b3..7eeca3dd 100644 --- a/app/vendor/cakephp/bake/docs/ja/index.rst +++ b/app/vendor/cakephp/bake/docs/ja/index.rst @@ -19,7 +19,7 @@ bake は Composer を使ってインストールするプラグインとして 上記のコマンドは、bake を開発環境で使用するパッケージとしてインストールします。 この入れ方の場合、本番環境としてデプロイする際には、 bake はインストールされません。 -Twig テンプレートを使用する場合、 ``WyriHaximus/TwigView`` プラグインをブートストラップとともに +Twig テンプレートを使用する場合、 ``Cake/TwigView`` プラグインをブートストラップとともに 読み込んでいることを確認してください。それを完全に省略して、 Bake プラグインにこのプラグインを読み込ませることもできます。 diff --git a/app/vendor/cakephp/bake/docs/pt/development.rst b/app/vendor/cakephp/bake/docs/pt/development.rst index eeab55e0..5e4fb05f 100644 --- a/app/vendor/cakephp/bake/docs/pt/development.rst +++ b/app/vendor/cakephp/bake/docs/pt/development.rst @@ -1,16 +1,21 @@ -Extendendo o Bake +Estendendo 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. +O Bake fornece uma arquitetura expansível que permite a sua aplicação ou plugin +modificar ou adicionar funcionalidades às suas funções básicas. Bake faz uso de +uma classe view dedicada que usa a ferramenta de templates `Twig +`_. 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.". +Como uma class view , ``BakeView`` emite o mesmo evento como qualquer outra +classe view, mais uma extra que inicializa eventos. No entanto, onde as classes +view padrão usam 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:: +O inicializador de eventos pode ser usado para fazer mudanças quando aplicado +a todas as saídas do Bake, por exemplo, ao adicionar outro helper à classe bake +view este evento pode ser usado:: on('Bake.initialize', function (Event $event) { $view = $event->getSubject(); - // No meu bake de templates, permite uso de MuSpecial helper + // In my bake templates, allow the use of the MySpecial helper $view->loadHelper('MySpecial', ['some' => 'config']); - // E adicionar uma variável $author então este estará sempre disponível + // And add an $author variable so it's always available $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. +Se você deseja modificar o bake de outro plugin, é recomendável colocar os +eventos do bake do seu plugin no arquivo **config/bootstrap.php**. -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:: +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 no +controller/template quando executar o bake, pode-se usar uma função esperando +o ``Bake.beforeRender`` para modificar as variáveis usadas no bake templates:: on('Bake.beforeRender', function (Event $event) { $view = $event->getSubject(); - // Use $ rows para a variável de dados principal em índices + // Use $rows for the main data variable in indexes if ($view->get('pluralName')) { $view->set('pluralName', 'rows'); } @@ -52,7 +59,7 @@ arquivos podem usar uma função ouvindo ``Bake.beforeRender`` para modificar as $view->set('pluralVar', 'rows'); } - // Use $ theOne para a variável de dados principal em exibição / edição + // Use $theOne for the main data variable in view/edit if ($view->get('singularName')) { $view->set('singularName', 'theOne'); } @@ -62,8 +69,10 @@ arquivos podem usar uma função ouvindo ``Bake.beforeRender`` para modificar as }); -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:: +Você também pode abranger os eventos ``Bake.beforeRender`` +e ``Bake.afterRender`` para um arquivo 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:: getSubject(); if ($view->viewVars['name'] == 'Users') { - // adicionar ações de login e logout ao Users controller - $view->viewVars['actions'] = [ + // add the login and logout actions to the Users controller + $view->set('actions', [ 'login', 'logout', 'index', @@ -86,27 +95,30 @@ você pode usar o seguinte evento:: '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. +Ao adicionar eventos que escutam um bake templates específico, você pode +simplesmente relacionar a sua lógica 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 . +Os arquivos de templates do Bake usam a sintaxe `Twig `__. -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 +Uma forma de ver e entender como o bake 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 na pasta **tmp/bake**. -**tmp/bake** folder. - -Então, por exemplo, quando baking a shell é como? +Então, por exemplo, quando você executar algo como:: .. code-block:: bash - bin/cake bake shell Foo + $ bin/cake bake shell Foo O template usado (**vendor/cakephp/bake/src/Template/Bake/Shell/shell.twig**) parece com algo assim:: @@ -132,7 +144,7 @@ parece com algo assim:: } -E o resultado baked é uma classe (**src/Shell/FooShell.php**) que parece algo assim:: +E o resultado baked é uma classe (**src/Shell/FooShell.php**) semelhante a:: `` 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 + * ``<%-`` Um template bake php abre a tag, retirando qualquer espaço em branco antes da tag + * ``-%>`` Um template bake php fecha a tag, retirando 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 é: +Se você deseja modificar a saída produzida com o comando bake, você pode criar +o seu próprio tema para o bake que permitirá você substituir 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:: +#. Bake um novo plugin. O nome do plugin é o 'nome do tema' +#. Crie uma nova pasta em **plugins/[name]/Template/Bake/Template/**. +#. Copie qualquer template que você queira modificar de + **vendor/cakephp/bake/src/Template/Bake/Template** para a pasta acima e modificá-los conforme sua necessidade. +#. Quando executar 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ê também pode definir o seu template customizado para ser usado como + o template padrão:: - ] 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. + --connection, -c The datasource connection to get data from. + (default: default) + --display-field The displayField if you would like to choose one. + --fields A comma separated list of fields to make + accessible. + --force, -f Force overwriting existing files without + prompting. + --help, -h Display this help. + --hidden A comma separated list of fields to hide. + --no-associations Disable generating associations. + --no-entity Disable generating an entity class. + --no-fields Disable generating accessible fields in the + entity. + --no-fixture Do not generate a test fixture skeleton. + --no-hidden Disable generating hidden fields in the entity. + --no-rules Disable generating a rules checker. + --no-table Disable generating a table class. + --no-test Do not generate a test case skeleton. + --no-validation Disable generating validation rules. + --plugin, -p Plugin to bake into. + --primary-key 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. + --quiet, -q Enable quiet output. + --table The table name to use if you have + non-conventional table names. + --theme, -t The theme to use when baking code. + --verbose, -v Enable verbose output. + + Arguments: + + name Name of the model to bake (without the Table suffix). You can use + Plugin.name to bake plugin models. (optional) + + Omitting all arguments and options will list the table names you can + generate models for. + + 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 `. +A opção de tema é comum a todos os comandos do Bake e permite mudar os arquivos de modelo usados por ele. Para criar seus próprios modelos, veja a +:ref:`documentação de criação de temas para o Bake `. .. meta:: :title lang=pt: Geração de código com bake diff --git a/app/vendor/cakephp/bake/phpcs.xml.dist b/app/vendor/cakephp/bake/phpcs.xml.dist index 9e40ece7..ce02df23 100644 --- a/app/vendor/cakephp/bake/phpcs.xml.dist +++ b/app/vendor/cakephp/bake/phpcs.xml.dist @@ -1,11 +1,8 @@ - - - - + + - - - 0 - + + + */comparisons/* diff --git a/app/vendor/cakephp/bake/phpstan.neon b/app/vendor/cakephp/bake/phpstan.neon index 68b9999e..691502eb 100644 --- a/app/vendor/cakephp/bake/phpstan.neon +++ b/app/vendor/cakephp/bake/phpstan.neon @@ -1,7 +1,5 @@ parameters: - level: 5 - autoload_files: + level: 6 + checkMissingIterableValueType: false + bootstrapFiles: - 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/app/vendor/cakephp/bake/psalm-baseline.xml b/app/vendor/cakephp/bake/psalm-baseline.xml new file mode 100644 index 00000000..a49882bc --- /dev/null +++ b/app/vendor/cakephp/bake/psalm-baseline.xml @@ -0,0 +1,19 @@ + + + + + new Filesystem() + + + findRecursive + + + + + new Filesystem() + + + find + + + diff --git a/app/vendor/cakephp/bake/psalm.xml b/app/vendor/cakephp/bake/psalm.xml new file mode 100644 index 00000000..de014916 --- /dev/null +++ b/app/vendor/cakephp/bake/psalm.xml @@ -0,0 +1,18 @@ + + + + + + + + + diff --git a/app/vendor/cakephp/bake/src/Command/AllCommand.php b/app/vendor/cakephp/bake/src/Command/AllCommand.php new file mode 100644 index 00000000..89434754 --- /dev/null +++ b/app/vendor/cakephp/bake/src/Command/AllCommand.php @@ -0,0 +1,123 @@ +_setCommonOptions($parser); + + $parser = $parser->setDescription( + 'Generate the model, controller, template, tests and fixture for a table.' + )->addArgument('name', [ + 'help' => 'Name of the table to generate code for.', + ])->addOption('everything', [ + 'help' => 'Generate code for all tables.', + 'default' => false, + 'boolean' => true, + ])->addOption('prefix', [ + 'help' => 'The namespace prefix to use.', + 'default' => false, + ]); + + return $parser; + } + + /** + * Execute the command. + * + * @param \Cake\Console\Arguments $args The command arguments. + * @param \Cake\Console\ConsoleIo $io The console io + * @return int|null The exit code or null for success + */ + public function execute(Arguments $args, ConsoleIo $io): ?int + { + $this->extractCommonProperties($args); + $name = $args->getArgument('name') ?? ''; + $name = $this->_getName($name); + + $io->out('Bake All'); + $io->hr(); + + /** @var \Cake\Database\Connection $connection */ + $connection = ConnectionManager::get($this->connection); + $scanner = new TableScanner($connection); + if (empty($name) && !$args->getOption('everything')) { + $io->out('Choose a table to generate from the following:'); + foreach ($scanner->listUnskipped() as $table) { + $io->out('- ' . $this->_camelize($table)); + } + + return static::CODE_SUCCESS; + } + if ($args->getOption('everything')) { + $tables = $scanner->listUnskipped(); + } else { + $tables = [$name]; + } + + foreach ($this->commands as $commandName) { + /** @var \Cake\Command\Command $command */ + $command = new $commandName(); + + $options = $args->getOptions(); + if ( + $args->hasOption('prefix') && + !($command instanceof ControllerCommand) && + !($command instanceof TemplateCommand) + ) { + unset($options['prefix']); + } + + foreach ($tables as $table) { + $subArgs = new Arguments([$table], $options, ['name']); + $command->execute($subArgs, $io); + } + } + + $io->out('Bake All complete.', 1, ConsoleIo::QUIET); + + return static::CODE_SUCCESS; + } +} diff --git a/app/vendor/cakephp/bake/src/Command/BakeCommand.php b/app/vendor/cakephp/bake/src/Command/BakeCommand.php new file mode 100644 index 00000000..d8d2a433 --- /dev/null +++ b/app/vendor/cakephp/bake/src/Command/BakeCommand.php @@ -0,0 +1,148 @@ +plugin = $plugin; + } + + return $name; + } + + /** + * Get the prefix name. + * + * Handles camelcasing each namespace in the prefix path. + * + * @param \Cake\Console\Arguments $args Arguments instance to read the prefix option from. + * @return string The inflected prefix path. + */ + protected function getPrefix(Arguments $args): string + { + $prefix = $args->getOption('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. + * + * @param \Cake\Console\Arguments $args Arguments instance to read the prefix option from. + * @return string Path to output. + */ + public function getPath(Arguments $args): string + { + $path = APP . $this->pathFragment; + if ($this->plugin) { + $path = $this->_pluginPath($this->plugin) . 'src/' . $this->pathFragment; + } + $prefix = $this->getPrefix($args); + if ($prefix) { + $path .= $prefix . DIRECTORY_SEPARATOR; + } + + return str_replace('/', DIRECTORY_SEPARATOR, $path); + } + + /** + * Gets the path to the template path for the application or plugin. + * + * @param \Cake\Console\Arguments $args Arguments instance to read the prefix option from. + * @param string|null $container The container directory in the templates directory. + * @return string Path to output. + */ + public function getTemplatePath(Arguments $args, ?string $container = null): string + { + $paths = (array)Configure::read('App.paths.templates'); + if (empty($paths)) { + throw new InvalidArgumentException( + 'Could not read template paths. ' . + 'Ensure `App.paths.templates` is defined in your application configuration.' + ); + } + $path = $paths[0]; + if ($this->plugin) { + $path = $this->_pluginPath($this->plugin) . 'templates' . DIRECTORY_SEPARATOR; + } + if ($container) { + $path .= $container . DIRECTORY_SEPARATOR; + } + $prefix = $this->getPrefix($args); + if ($prefix) { + $path .= $prefix . DIRECTORY_SEPARATOR; + } + + return str_replace('/', DIRECTORY_SEPARATOR, $path); + } + + /** + * Delete empty file in a given path + * + * @param string $path Path to folder which contains 'empty' file. + * @param \Cake\Console\ConsoleIo $io ConsoleIo to delete file with. + * @return void + */ + protected function deleteEmptyFile(string $path, ConsoleIo $io): void + { + if (file_exists($path)) { + unlink($path); + $io->out(sprintf('Deleted `%s`', $path), 1, ConsoleIo::QUIET); + } + } +} diff --git a/app/vendor/cakephp/bake/src/Command/BehaviorCommand.php b/app/vendor/cakephp/bake/src/Command/BehaviorCommand.php new file mode 100644 index 00000000..e5b5e852 --- /dev/null +++ b/app/vendor/cakephp/bake/src/Command/BehaviorCommand.php @@ -0,0 +1,54 @@ +getPrefix($arguments); + 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. + * @param \Cake\Console\Arguments $args The console arguments + * @param \Cake\Console\ConsoleIo $io The console io + * @return void + */ + public function bake(string $name, Arguments $args, ConsoleIo $io): void + { + $this->bakeTemplate($name, $args, $io); + + parent::bake($name, $args, $io); + } + + /** + * Bake an empty file for a cell. + * + * @param string $name The name of the cell a template is needed for. + * @param \Cake\Console\Arguments $args The console arguments + * @param \Cake\Console\ConsoleIo $io The console io + * @return void + */ + protected function bakeTemplate(string $name, Arguments $args, ConsoleIo $io): void + { + $path = $this->getTemplatePath($args, 'cell'); + $path .= implode(DS, [$name, 'display.php']); + + $io->createFile($path, '', $args->getOption('force')); + } + + /** + * Gets the option parser instance and configures it. + * + * @param \Cake\Console\ConsoleOptionParser $parser Parser instance + * @return \Cake\Console\ConsoleOptionParser + */ + public function buildOptionParser(ConsoleOptionParser $parser): ConsoleOptionParser + { + $parser = parent::buildOptionParser($parser); + $parser->addOption('prefix', [ + 'help' => 'The namespace prefix to use.', + ]); + + return $parser; + } +} diff --git a/app/vendor/cakephp/bake/src/Command/CommandCommand.php b/app/vendor/cakephp/bake/src/Command/CommandCommand.php new file mode 100644 index 00000000..dfca1a41 --- /dev/null +++ b/app/vendor/cakephp/bake/src/Command/CommandCommand.php @@ -0,0 +1,54 @@ +controllerCommand = new ControllerCommand(); + } + + /** + * Execute the command. + * + * @param \Cake\Console\Arguments $args The command arguments. + * @param \Cake\Console\ConsoleIo $io The console io + * @return int|null The exit code or null for success + */ + public function execute(Arguments $args, ConsoleIo $io): ?int + { + $this->extractCommonProperties($args); + + /** @var \Cake\Database\Connection $connection */ + $connection = ConnectionManager::get($this->connection); + $scanner = new TableScanner($connection); + foreach ($scanner->listUnskipped() as $table) { + $this->getTableLocator()->clear(); + $controllerArgs = new Arguments([$table], $args->getOptions(), ['name']); + $this->controllerCommand->execute($controllerArgs, $io); + } + + return static::CODE_SUCCESS; + } + + /** + * Gets the option parser instance and configures it. + * + * @param \Cake\Console\ConsoleOptionParser $parser The console option parser + * @return \Cake\Console\ConsoleOptionParser + */ + public function buildOptionParser(ConsoleOptionParser $parser): ConsoleOptionParser + { + $parser = $this->controllerCommand->buildOptionParser($parser); + $parser + ->setDescription('Bake all controller files with tests.') + ->setEpilog(''); + + return $parser; + } +} diff --git a/app/vendor/cakephp/bake/src/Command/ControllerCommand.php b/app/vendor/cakephp/bake/src/Command/ControllerCommand.php new file mode 100644 index 00000000..d83e4396 --- /dev/null +++ b/app/vendor/cakephp/bake/src/Command/ControllerCommand.php @@ -0,0 +1,279 @@ +extractCommonProperties($args); + $name = $args->getArgument('name') ?? ''; + $name = $this->_getName($name); + + if (empty($name)) { + /** @var \Cake\Database\Connection $connection */ + $connection = ConnectionManager::get($this->connection); + $scanner = new TableScanner($connection); + $io->out('Possible controllers based on your current database:'); + foreach ($scanner->listUnskipped() as $table) { + $io->out('- ' . $this->_camelize($table)); + } + + return static::CODE_SUCCESS; + } + + $controller = $this->_camelize($name); + $this->bake($controller, $args, $io); + + return static::CODE_SUCCESS; + } + + /** + * Assembles and writes a Controller file + * + * @param string $controllerName Controller name already pluralized and correctly cased. + * @param \Cake\Console\Arguments $args The console arguments + * @param \Cake\Console\ConsoleIo $io The console io + * @return void + */ + public function bake(string $controllerName, Arguments $args, ConsoleIo $io): void + { + $io->quiet(sprintf('Baking controller class for %s...', $controllerName)); + + $actions = []; + if (!$args->getOption('no-actions') && !$args->getOption('actions')) { + $actions = ['index', 'view', 'add', 'edit', 'delete']; + } + if ($args->getOption('actions')) { + $actions = array_map('trim', explode(',', $args->getOption('actions'))); + $actions = array_filter($actions); + } + + $helpers = $this->getHelpers($args); + $components = $this->getComponents($args); + + $prefix = $this->getPrefix($args); + if ($prefix) { + $prefix = '\\' . str_replace('/', '\\', $prefix); + } + + // Controllers default to importing AppController from `App` + $baseNamespace = $namespace = Configure::read('App.namespace'); + if ($this->plugin) { + $namespace = $this->_pluginNamespace($this->plugin); + } + // If the plugin has an AppController other plugin controllers + // should inherit from it. + if ($this->plugin && class_exists("{$namespace}\Controller\AppController")) { + $baseNamespace = $namespace; + } + + $currentModelName = $controllerName; + $plugin = $this->plugin; + if ($plugin) { + $plugin .= '.'; + } + + if ($this->getTableLocator()->exists($plugin . $currentModelName)) { + $modelObj = $this->getTableLocator()->get($plugin . $currentModelName); + } else { + $modelObj = $this->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', + 'baseNamespace', + 'plugin', + 'pluralHumanName', + 'pluralName', + 'prefix', + 'singularHumanName', + 'singularName' + ); + $data['name'] = $controllerName; + + $this->bakeController($controllerName, $data, $args, $io); + $this->bakeTest($controllerName, $args, $io); + } + + /** + * Generate the controller code + * + * @param string $controllerName The name of the controller. + * @param array $data The data to turn into code. + * @param \Cake\Console\Arguments $args The console args + * @param \Cake\Console\ConsoleIo $io The console io + * @return void + */ + public function bakeController(string $controllerName, array $data, Arguments $args, ConsoleIo $io): void + { + $data += [ + 'name' => null, + 'namespace' => null, + 'prefix' => null, + 'actions' => null, + 'helpers' => null, + 'components' => null, + 'plugin' => null, + 'pluginPath' => null, + ]; + + $renderer = new TemplateRenderer($this->theme); + $renderer->set($data); + + $contents = $renderer->generate('Bake.Controller/controller'); + + $path = $this->getPath($args); + $filename = $path . $controllerName . 'Controller.php'; + $io->createFile($filename, $contents, $args->getOption('force')); + } + + /** + * Assembles and writes a unit test file + * + * @param string $className Controller class name + * @param \Cake\Console\Arguments $args The console arguments + * @param \Cake\Console\ConsoleIo $io The console io + * @return void + */ + public function bakeTest(string $className, Arguments $args, ConsoleIo $io): void + { + if ($args->getOption('no-test')) { + return; + } + $test = new TestCommand(); + $testArgs = new Arguments( + ['controller', $className], + $args->getOptions(), + ['type', 'name'] + ); + $test->execute($testArgs, $io); + } + + /** + * Get the list of components for the controller. + * + * @param \Cake\Console\Arguments $args The console arguments + * @return string[] + */ + public function getComponents(Arguments $args): array + { + $components = []; + if ($args->getOption('components')) { + $components = explode(',', $args->getOption('components')); + $components = array_values(array_filter(array_map('trim', $components))); + } + + return $components; + } + + /** + * Get the list of helpers for the controller. + * + * @param \Cake\Console\Arguments $args The console arguments + * @return string[] + */ + public function getHelpers(Arguments $args): array + { + $helpers = []; + if ($args->getOption('helpers')) { + $helpers = explode(',', $args->getOption('helpers')); + $helpers = array_values(array_filter(array_map('trim', $helpers))); + } + + return $helpers; + } + + /** + * Gets the option parser instance and configures it. + * + * @param \Cake\Console\ConsoleOptionParser $parser The console option parser + * @return \Cake\Console\ConsoleOptionParser + */ + public function buildOptionParser(ConsoleOptionParser $parser): ConsoleOptionParser + { + $parser = $this->_setCommonOptions($parser); + $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.', + ]); + + return $parser; + } +} diff --git a/app/vendor/cakephp/bake/src/Command/EntryCommand.php b/app/vendor/cakephp/bake/src/Command/EntryCommand.php new file mode 100644 index 00000000..6ad97212 --- /dev/null +++ b/app/vendor/cakephp/bake/src/Command/EntryCommand.php @@ -0,0 +1,223 @@ +commands = $commands; + } + + /** + * Run the command. + * + * Override the run() method so that we can splice in dynamic + * subcommand handling for legacy tasks. + * + * @param array $argv Arguments from the CLI environment. + * @param \Cake\Console\ConsoleIo $io The console io + * @return int|null Exit code or null for success. + */ + public function run(array $argv, ConsoleIo $io): ?int + { + $this->initialize(); + + $parser = $this->getOptionParser(); + try { + [$options, $arguments] = $parser->parse($argv); + $args = new Arguments( + $arguments, + $options, + $parser->argumentNames() + ); + } catch (ConsoleException $e) { + $io->err('Error: ' . $e->getMessage()); + + return static::CODE_ERROR; + } + $this->setOutputLevel($args, $io); + + // This is the variance from Command::run() + if (!$args->getArgumentAt(0) && $args->getOption('help')) { + $this->executeCommand($this->help, [], $io); + + return static::CODE_SUCCESS; + } + + return $this->execute($args, $io); + } + + /** + * Execute the command. + * + * This command acts as a catch-all for legacy tasks that may + * be defined in the application or plugins. + * + * @param \Cake\Console\Arguments $args The command arguments. + * @param \Cake\Console\ConsoleIo $io The console io + * @return int|null The exit code or null for success + */ + public function execute(Arguments $args, ConsoleIo $io): ?int + { + if ($args->hasArgumentAt(0)) { + $name = $args->getArgumentAt(0); + $task = $this->createTask($name, $io); + if ($task) { + $argList = $args->getArguments(); + + // Remove command name. + array_shift($argList); + foreach ($args->getOptions() as $key => $value) { + if ($value === false) { + continue; + } elseif ($value === true) { + $argList[] = '--' . $key; + } else { + $argList[] = '--' . $key; + $argList[] = $value; + } + } + + $result = $task->runCommand($argList); + if ($result === false) { + return static::CODE_ERROR; + } + if ($result === true) { + return static::CODE_SUCCESS; + } + + return $result; + } + $io->err("Could not find a task named `{$name}`."); + + return static::CODE_ERROR; + } + $io->err('No command provided. Run `bake --help` to get a list of commands.'); + + return static::CODE_ERROR; + } + + /** + * Find and create a Shell based BakeTask + * + * @param string $name The task name. + * @param \Cake\Console\ConsoleIo $io The console io. + * @return \Cake\Console\Shell|null + */ + protected function createTask(string $name, ConsoleIo $io): ?Shell + { + $found = false; + $name = Inflector::camelize($name); + $factory = function ($className, $io) { + $task = new $className($io); + $task->setRootName('cake bake'); + + return $task; + }; + + // Look in each plugin for the requested task + foreach (CorePlugin::loaded() as $plugin) { + $namespace = str_replace('/', '\\', $plugin); + $candidate = $namespace . '\Shell\Task\\' . $name . 'Task'; + if (class_exists($candidate) && is_subclass_of($candidate, BakeTask::class)) { + return $factory($candidate, $io); + } + } + + // Try the app as well + $namespace = Configure::read('App.namespace'); + $candidate = $namespace . '\Shell\Task\\' . $name . 'Task'; + if (class_exists($candidate) && is_subclass_of($candidate, BakeTask::class)) { + return $factory($candidate, $io); + } + + return null; + } + + /** + * Gets the option parser instance and configures it. + * + * @param \Cake\Console\ConsoleOptionParser $parser The console option parser + * @return \Cake\Console\ConsoleOptionParser + */ + public function buildOptionParser(ConsoleOptionParser $parser): ConsoleOptionParser + { + $this->help = new HelpCommand(); + /** @psalm-suppress InaccessibleMethod Protected methods as class based */ + $parser = $this->help->buildOptionParser($parser); + $parser + ->setDescription( + 'Bake generates code for your application. Different types of classes can be generated' . + ' with the subcommands listed below. For example run bake controller --help' . + ' to learn more about generating a controller.' + ) + ->setEpilog('Older Shell based tasks will not be listed here, but can still be run.'); + $commands = []; + foreach ($this->commands as $command => $class) { + if (substr($command, 0, 4) === 'bake') { + $parts = explode(' ', $command); + + // Remove `bake` + array_shift($parts); + if (count($parts) === 0) { + continue; + } + $commands[$command] = $class; + } + } + + $CommandCollection = new CommandCollection($commands); + $this->help->setCommandCollection($CommandCollection); + + return $parser; + } +} diff --git a/app/vendor/cakephp/bake/src/Command/FixtureAllCommand.php b/app/vendor/cakephp/bake/src/Command/FixtureAllCommand.php new file mode 100644 index 00000000..88e29a39 --- /dev/null +++ b/app/vendor/cakephp/bake/src/Command/FixtureAllCommand.php @@ -0,0 +1,88 @@ +_setCommonOptions($parser); + + $parser = $parser->setDescription( + 'Generate all fixtures for use with the test suite.' + )->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', + ]); + + return $parser; + } + + /** + * Execute the command. + * + * @param \Cake\Console\Arguments $args The command arguments. + * @param \Cake\Console\ConsoleIo $io The console io + * @return int|null + */ + public function execute(Arguments $args, ConsoleIo $io): ?int + { + $this->extractCommonProperties($args); + + /** @var \Cake\Database\Connection $connection */ + $connection = ConnectionManager::get($args->getOption('connection') ?? 'default'); + $scanner = new TableScanner($connection); + $fixture = new FixtureCommand(); + foreach ($scanner->listUnskipped() as $table) { + $fixtureArgs = new Arguments([$table], $args->getOptions(), ['name']); + $fixture->execute($fixtureArgs, $io); + } + + return static::CODE_SUCCESS; + } +} diff --git a/app/vendor/cakephp/bake/src/Command/FixtureCommand.php b/app/vendor/cakephp/bake/src/Command/FixtureCommand.php new file mode 100644 index 00000000..ec92e87d --- /dev/null +++ b/app/vendor/cakephp/bake/src/Command/FixtureCommand.php @@ -0,0 +1,456 @@ +plugin) { + $path = $this->_pluginPath($this->plugin) . 'tests/' . $dir; + } + + return str_replace('/', DS, $path); + } + + /** + * Gets the option parser instance and configures it. + * + * @param \Cake\Console\ConsoleOptionParser $parser Option parser to update. + * @return \Cake\Console\ConsoleOptionParser + */ + public function buildOptionParser(ConsoleOptionParser $parser): ConsoleOptionParser + { + $parser = $this->_setCommonOptions($parser); + + $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', + ]); + + return $parser; + } + + /** + * Execute the command. + * + * @param \Cake\Console\Arguments $args The command arguments. + * @param \Cake\Console\ConsoleIo $io The console io + * @return int|null The exit code or null for success + */ + public function execute(Arguments $args, ConsoleIo $io): ?int + { + $this->extractCommonProperties($args); + $name = $args->getArgument('name') ?? ''; + $name = $this->_getName($name); + + /** @var \Cake\Database\Connection $connection */ + $connection = ConnectionManager::get($this->connection); + $scanner = new TableScanner($connection); + if (empty($name)) { + $io->out('Choose a fixture to bake from the following:'); + foreach ($scanner->listUnskipped() as $table) { + $io->out('- ' . $this->_camelize($table)); + } + + return static::CODE_SUCCESS; + } + + $table = $args->getOption('table') ?? ''; + $model = $this->_camelize($name); + $this->bake($model, $table, $args, $io); + + return static::CODE_SUCCESS; + } + + /** + * Assembles and writes a Fixture file + * + * @param string $model Name of model to bake. + * @param string $useTable Name of table to use. + * @param \Cake\Console\Arguments $args The command arguments. + * @param \Cake\Console\ConsoleIo $io The console io + * @return void + * @throws \RuntimeException + */ + protected function bake(string $model, string $useTable, Arguments $args, ConsoleIo $io): void + { + $table = $schema = $records = $import = $modelImport = null; + + if (!$useTable) { + $useTable = Inflector::tableize($model); + } elseif ($useTable !== Inflector::tableize($model)) { + $table = $useTable; + } + + $importBits = []; + if ($args->getOption('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) { + $this->getTableLocator()->remove($model); + $useTable = Inflector::underscore($model); + $table = $useTable; + $data = $this->readSchema($model, $useTable); + } + + if ($modelImport === null) { + $schema = $this->_generateSchema($data); + } + + if ($args->getOption('records')) { + $records = $this->_makeRecordString($this->_getRecordsFromTable($args, $model, $useTable)); + } else { + $recordCount = 1; + if ($args->hasOption('count')) { + $recordCount = (int)$args->getOption('count'); + } + $records = $this->_makeRecordString($this->_generateRecords($data, $recordCount)); + } + + $this->generateFixtureFile($args, $io, $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\TableSchemaInterface + */ + public function readSchema(string $name, string $table): TableSchemaInterface + { + $connection = ConnectionManager::get($this->connection); + + if ($this->getTableLocator()->exists($name)) { + $model = $this->getTableLocator()->get($name); + } else { + $model = $this->getTableLocator()->get($name, [ + 'table' => $table, + 'connection' => $connection, + ]); + } + + return $model->getSchema(); + } + + /** + * Generate the fixture file, and write to disk + * + * @param \Cake\Console\Arguments $args The CLI arguments. + * @param \Cake\Console\ConsoleIo $io The console io instance. + * @param string $model name of the model being generated + * @param array $otherVars Contents of the fixture file. + * @return void + */ + public function generateFixtureFile(Arguments $args, ConsoleIo $io, string $model, array $otherVars): void + { + $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($args); + $filename = $vars['name'] . 'Fixture.php'; + + $renderer = new TemplateRenderer($args->getOption('theme')); + $renderer->set('model', $model); + $renderer->set($vars); + $content = $renderer->generate('Bake.tests/fixture'); + + $io->out("\n" . sprintf('Baking test fixture for %s...', $model), 1, ConsoleIo::QUIET); + $io->createFile($path . $filename, $content, $args->getOption('force')); + $emptyFile = $path . '.gitkeep'; + $this->deleteEmptyFile($emptyFile, $io); + } + + /** + * Generates a string representation of a schema. + * + * @param \Cake\Database\Schema\TableSchemaInterface $table Table schema + * @return string fields definitions + */ + protected function _generateSchema(TableSchemaInterface $table): string + { + $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 string[] Formatted values + */ + protected function _values(array $values): array + { + $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\TableSchemaInterface $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(TableSchemaInterface $table, int $recordCount = 1): array + { + $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->getPrimaryKey()); + 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': + case 'timestampfractional': + $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(array $records): string + { + $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 \Cake\Console\Arguments $args CLI arguments + * @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(Arguments $args, string $modelName, ?string $useTable = null): array + { + $recordCount = ($args->getOption('count') ?? 10); + /** @var string $conditions */ + $conditions = ($args->getOption('conditions') ?? '1=1'); + if ($this->getTableLocator()->exists($modelName)) { + $model = $this->getTableLocator()->get($modelName); + } else { + $model = $this->getTableLocator()->get($modelName, [ + 'table' => $useTable, + 'connection' => ConnectionManager::get($this->connection), + ]); + } + $records = $model->find('all') + ->where($conditions) + ->limit((int)$recordCount) + ->enableHydration(false); + + return $records->toArray(); + } +} diff --git a/app/vendor/cakephp/bake/src/Command/FormCommand.php b/app/vendor/cakephp/bake/src/Command/FormCommand.php new file mode 100644 index 00000000..f84572ba --- /dev/null +++ b/app/vendor/cakephp/bake/src/Command/FormCommand.php @@ -0,0 +1,54 @@ +modelCommand = new ModelCommand(); + } + + /** + * Gets the option parser instance and configures it. + * + * @param \Cake\Console\ConsoleOptionParser $parser The parser to configure + * @return \Cake\Console\ConsoleOptionParser + */ + public function buildOptionParser(ConsoleOptionParser $parser): ConsoleOptionParser + { + $parser = $this->modelCommand->buildOptionParser($parser); + $parser + ->setDescription('Bake all model files with associations and validation.') + ->setEpilog(''); + + return $parser; + } + + /** + * Execute the command. + * + * @param \Cake\Console\Arguments $args The command arguments. + * @param \Cake\Console\ConsoleIo $io The console io + * @return int|null The exit code or null for success + */ + public function execute(Arguments $args, ConsoleIo $io): ?int + { + $this->extractCommonProperties($args); + /** @var \Cake\Database\Connection $connection */ + $connection = ConnectionManager::get($this->connection); + $scanner = new TableScanner($connection); + foreach ($scanner->listUnskipped() as $table) { + $this->getTableLocator()->clear(); + $modelArgs = new Arguments([$table], $args->getOptions(), ['name']); + $this->modelCommand->execute($modelArgs, $io); + } + + return static::CODE_SUCCESS; + } +} diff --git a/app/vendor/cakephp/bake/src/Command/ModelCommand.php b/app/vendor/cakephp/bake/src/Command/ModelCommand.php new file mode 100644 index 00000000..87a4f2c9 --- /dev/null +++ b/app/vendor/cakephp/bake/src/Command/ModelCommand.php @@ -0,0 +1,1205 @@ +extractCommonProperties($args); + $name = $this->_getName($args->getArgument('name') ?? ''); + + if (empty($name)) { + $io->out('Choose a model to bake from the following:'); + foreach ($this->listUnskipped() as $table) { + $io->out('- ' . $this->_camelize($table)); + } + + return static::CODE_SUCCESS; + } + + $this->bake($this->_camelize($name), $args, $io); + + return static::CODE_SUCCESS; + } + + /** + * Generate code for the given model name. + * + * @param string $name The model name to generate. + * @param \Cake\Console\Arguments $args Console Arguments. + * @param \Cake\Console\ConsoleIo $io Console Io. + * @return void + */ + public function bake(string $name, Arguments $args, ConsoleIo $io): void + { + $table = $this->getTable($name, $args); + $tableObject = $this->getTableObject($name, $table); + $data = $this->getTableContext($tableObject, $table, $name, $args, $io); + $this->bakeTable($tableObject, $data, $args, $io); + $this->bakeEntity($tableObject, $data, $args, $io); + $this->bakeFixture($tableObject->getAlias(), $tableObject->getTable(), $args, $io); + $this->bakeTest($tableObject->getAlias(), $args, $io); + } + + /** + * 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. + * @param \Cake\Console\Arguments $args CLI Arguments + * @param \Cake\Console\ConsoleIo $io CLI io + * @return array + */ + public function getTableContext( + Table $tableObject, + string $table, + string $name, + Arguments $args, + ConsoleIo $io + ): array { + $associations = $this->getAssociations($tableObject, $args, $io); + $this->applyAssociations($tableObject, $associations); + $associationInfo = $this->getAssociationInfo($tableObject); + + $primaryKey = $this->getPrimaryKey($tableObject, $args); + $displayField = $this->getDisplayField($tableObject, $args); + $propertySchema = $this->getEntityPropertySchema($tableObject); + $fields = $this->getFields($tableObject, $args); + $validation = $this->getValidation($tableObject, $associations, $args); + $rulesChecker = $this->getRules($tableObject, $associations, $args); + $behaviors = $this->getBehaviors($tableObject); + $connection = $this->connection; + $hidden = $this->getHiddenFields($tableObject, $args); + + return compact( + 'associations', + 'associationInfo', + 'primaryKey', + 'displayField', + 'table', + 'propertySchema', + 'fields', + 'validation', + 'rulesChecker', + 'behaviors', + 'connection', + 'hidden' + ); + } + + /** + * 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(string $className, string $table): Table + { + if (!empty($this->plugin)) { + $className = $this->plugin . '.' . $className; + } + + if ($this->getTableLocator()->exists($className)) { + return $this->getTableLocator()->get($className); + } + + return $this->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. + * @param \Cake\Console\Arguments $args CLI Arguments + * @param \Cake\Console\ConsoleIo $io CLI io + * @return array + */ + public function getAssociations(Table $table, Arguments $args, ConsoleIo $io): array + { + if ($args->getOption('no-associations')) { + return []; + } + $io->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) { + $io->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(Table $model, array $associations): void + { + if (get_class($model) !== Table::class) { + 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): array + { + $info = []; + + $appNamespace = Configure::read('App.namespace'); + + foreach ($table->associations() as $association) { + /** @var \Cake\ORM\Association $association */ + + $tableClass = get_class($association->getTarget()); + if ($tableClass === Table::class) { + $namespace = $appNamespace; + + $className = $association->getClassName(); + [$plugin, $className] = pluginSplit($className); + if ($plugin !== null) { + $namespace = $plugin; + } + + $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(Table $model, array $associations): array + { + $schema = $model->getSchema(); + foreach ($schema->columns() as $fieldName) { + if (!preg_match('/^.+_id$/', $fieldName) || ($schema->getPrimaryKey() === [$fieldName])) { + 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, true)) { + $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\TableSchemaInterface $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(TableSchemaInterface $schema, string $keyField): ?string + { + 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 = $this->tablePrefix ? mb_strlen($this->tablePrefix) : 0; + 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(Table $model, array $associations): array + { + $schema = $model->getSchema(); + $primaryKey = $schema->getPrimaryKey(); + $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(Table $model, array $associations): array + { + $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. + * @param \Cake\Console\Arguments $args CLI Arguments + * @return string|null + * @psalm-suppress InvalidReturnType + */ + public function getDisplayField(Table $model, Arguments $args): ?string + { + if ($args->getOption('display-field')) { + return (string)$args->getOption('display-field'); + } + + /** @psalm-suppress InvalidReturnStatement */ + return $model->getDisplayField(); + } + + /** + * Get the primary key field from the model or parameters + * + * @param \Cake\ORM\Table $model The model to introspect. + * @param \Cake\Console\Arguments $args CLI Arguments + * @return string[] The columns in the primary key + */ + public function getPrimaryKey(Table $model, Arguments $args): array + { + if ($args->getOption('primary-key')) { + $fields = explode(',', $args->getOption('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): array + { + $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'); + + [$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. + * @param \Cake\Console\Arguments $args CLI Arguments + * @return string[]|false|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 $table, Arguments $args) + { + if ($args->getOption('no-fields')) { + return false; + } + if ($args->getOption('fields')) { + $fields = explode(',', $args->getOption('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->getPrimaryKey(); + + 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. + * @param \Cake\Console\Arguments $args CLI Arguments + * @return string[] The columns to make accessible + */ + public function getHiddenFields(Table $model, Arguments $args): array + { + if ($args->getOption('no-hidden')) { + return []; + } + if ($args->getOption('hidden')) { + $fields = explode(',', $args->getOption('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. + * @param \Cake\Console\Arguments $args CLI Arguments + * @return array|false The validation rules. + */ + public function getValidation(Table $model, array $associations, Arguments $args) + { + if ($args->getOption('no-validation')) { + return []; + } + $schema = $model->getSchema(); + $fields = $schema->columns(); + if (!$fields) { + return false; + } + + $validate = []; + $primaryKey = $schema->getPrimaryKey(); + $foreignKeys = []; + if (isset($associations['belongsTo'])) { + foreach ($associations['belongsTo'] as $assoc) { + $foreignKeys[] = $assoc['foreignKey']; + } + } + foreach ($fields as $fieldName) { + if (in_array($fieldName, $foreignKeys, true)) { + continue; + } + $field = $schema->getColumn($fieldName); + $validation = $this->fieldValidation($schema, $fieldName, $field, $primaryKey); + if ($validation) { + $validate[$fieldName] = $validation; + } + } + + return $validate; + } + + /** + * Does individual field validation handling. + * + * @param \Cake\Database\Schema\TableSchemaInterface $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( + TableSchemaInterface $schema, + string $fieldName, + array $metaData, + array $primaryKey + ): array { + $ignoreFields = ['lft', 'rght', 'created', 'modified', 'updated']; + if (in_array($fieldName, $ignoreFields, true)) { + 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 (strpos($metaData['type'], 'datetime') === 0) { + $rules['dateTime'] = []; + } elseif (strpos($metaData['type'], 'timestamp') === 0) { + $rules['dateTime'] = []; + } elseif ($metaData['type'] === 'inet') { + $rules['ip'] = []; + } elseif (in_array($metaData['type'], ['char', 'string', 'text'], true)) { + $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, true)) { + $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'], true) || count($constraint['columns']) > 1) { + continue; + } + + $timeTypes = [ + 'datetime', + 'timestamp', + 'datetimefractional', + 'timestampfractional', + 'timestamptimezone', + 'date', + 'time', + ]; + $notDatetime = !in_array($metaData['type'], $timeTypes, true); + 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(string $fieldName, array $metaData, string $prefix = 'allow'): string + { + switch ($metaData['type']) { + case 'date': + return $prefix . 'EmptyDate'; + + case 'time': + return $prefix . 'EmptyTime'; + + case 'datetime': + case 'datetimefractional': + case 'timestamp': + case 'timestampfractional': + case 'timestamptimezone': + 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. + * @param \Cake\Console\Arguments $args CLI Arguments + * @return array The rules to be applied. + */ + public function getRules(Table $model, array $associations, Arguments $args): array + { + if ($args->getOption('no-rules')) { + return []; + } + $schema = $model->getSchema(); + $fields = $schema->columns(); + if (empty($fields)) { + return []; + } + + $uniqueColumns = ['username', 'login']; + if (in_array($model->getAlias(), ['Users', 'Accounts'])) { + $uniqueColumns[] = 'email'; + } + + $rules = []; + foreach ($fields as $fieldName) { + if (in_array($fieldName, $uniqueColumns, true)) { + $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(Table $model): array + { + $behaviors = []; + $schema = $model->getSchema(); + $fields = $schema->columns(); + if (empty($fields)) { + return []; + } + if (in_array('created', $fields, true) || in_array('modified', $fields, true)) { + $behaviors['Timestamp'] = []; + } + + if ( + in_array('lft', $fields, true) + && $schema->getColumnType('lft') === 'integer' + && in_array('rght', $fields, true) + && $schema->getColumnType('rght') === 'integer' + && in_array('parent_id', $fields, true) + ) { + $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 string[] CounterCache configurations + */ + public function getCounterCache(Table $model): array + { + $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 (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 + * @param \Cake\Console\Arguments $args CLI Arguments + * @param \Cake\Console\ConsoleIo $io CLI io + * @return void + */ + public function bakeEntity(Table $model, array $data, Arguments $args, ConsoleIo $io): void + { + if ($args->getOption('no-entity')) { + return; + } + $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' => [], + ]; + + $renderer = new TemplateRenderer($this->theme); + $renderer->set($data); + $out = $renderer->generate('Bake.Model/entity'); + + $path = $this->getPath($args); + $filename = $path . 'Entity' . DS . $name . '.php'; + $io->out("\n" . sprintf('Baking entity class for %s...', $name), 1, ConsoleIo::QUIET); + $io->createFile($filename, $out, $args->getOption('force')); + + $emptyFile = $path . 'Entity' . DS . '.gitkeep'; + $this->deleteEmptyFile($emptyFile, $io); + } + + /** + * Bake a table class. + * + * @param \Cake\ORM\Table $model Model name or object + * @param array $data An array to use to generate the Table + * @param \Cake\Console\Arguments $args CLI Arguments + * @param \Cake\Console\ConsoleIo $io CLI Arguments + * @return void + */ + public function bakeTable(Table $model, array $data, Arguments $args, ConsoleIo $io): void + { + if ($args->getOption('no-table')) { + return; + } + + $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, + ]; + + $renderer = new TemplateRenderer($this->theme); + $renderer->set($data); + $out = $renderer->generate('Bake.Model/table'); + + $path = $this->getPath($args); + $filename = $path . 'Table' . DS . $name . 'Table.php'; + $io->out("\n" . sprintf('Baking table class for %s...', $name), 1, ConsoleIo::QUIET); + $io->createFile($filename, $out, $args->getOption('force')); + + // 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; + } + $this->getTableLocator()->clear(); + + $emptyFile = $path . 'Table' . DS . '.gitkeep'; + $this->deleteEmptyFile($emptyFile, $io); + } + + /** + * Outputs the a list of possible models or controllers from database + * + * @return string[] + */ + public function listAll(): array + { + if (!empty($this->_tables)) { + return $this->_tables; + } + + /** @var \Cake\Database\Connection $connection */ + $connection = ConnectionManager::get($this->connection); + $scanner = new TableScanner($connection); + $this->_tables = $scanner->listAll(); + + return $this->_tables; + } + + /** + * Outputs the a list of unskipped models or controllers from database + * + * @return string[] + */ + public function listUnskipped(): array + { + /** @var \Cake\Database\Connection $connection */ + $connection = ConnectionManager::get($this->connection); + $scanner = new TableScanner($connection); + + return $scanner->listUnskipped(); + } + + /** + * Get the table name for the model being baked. + * + * Uses the `table` option if it is set. + * + * @param string $name Table name + * @param \Cake\Console\Arguments $args The CLI arguments + * @return string + */ + public function getTable(string $name, Arguments $args): string + { + if ($args->getOption('table')) { + return (string)$args->getOption('table'); + } + + return Inflector::underscore($name); + } + + /** + * Gets the option parser instance and configures it. + * + * @param \Cake\Console\ConsoleOptionParser $parser The parser to configure + * @return \Cake\Console\ConsoleOptionParser + */ + public function buildOptionParser(ConsoleOptionParser $parser): ConsoleOptionParser + { + $parser = $this->_setCommonOptions($parser); + + $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.', + ])->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 $useTable Optional table name for fixture to use. + * @param \Cake\Console\Arguments $args Arguments instance + * @param \Cake\Console\ConsoleIo $io ConsoleIo instance + * @return void + */ + public function bakeFixture( + string $className, + string $useTable, + Arguments $args, + ConsoleIo $io + ): void { + if ($args->getOption('no-fixture')) { + return; + } + $fixture = new FixtureCommand(); + $fixtureArgs = new Arguments( + [$className], + ['table' => $useTable] + $args->getOptions(), + ['name'] + ); + $fixture->execute($fixtureArgs, $io); + } + + /** + * Assembles and writes a unit test file + * + * @param string $className Model class name + * @param \Cake\Console\Arguments $args Arguments instance + * @param \Cake\Console\ConsoleIo $io ConsoleIo instance + * @return void + */ + public function bakeTest(string $className, Arguments $args, ConsoleIo $io): void + { + if ($args->getOption('no-test')) { + return; + } + $test = new TestCommand(); + $testArgs = new Arguments( + ['table', $className], + $args->getOptions(), + ['type', 'name'] + ); + $test->execute($testArgs, $io); + } +} diff --git a/app/vendor/cakephp/bake/src/Command/PluginCommand.php b/app/vendor/cakephp/bake/src/Command/PluginCommand.php new file mode 100644 index 00000000..9afc3558 --- /dev/null +++ b/app/vendor/cakephp/bake/src/Command/PluginCommand.php @@ -0,0 +1,425 @@ +path = current(App::path('plugins')); + } + + /** + * Execute the command. + * + * @param \Cake\Console\Arguments $args The command arguments. + * @param \Cake\Console\ConsoleIo $io The console io + * @return int|null The exit code or null for success + */ + public function execute(Arguments $args, ConsoleIo $io): ?int + { + $name = $args->getArgument('name'); + if (empty($name)) { + $io->err('You must provide a plugin name in CamelCase format.'); + $io->err('To make an "MyExample" plugin, run `cake bake plugin MyExample`.'); + + return static::CODE_ERROR; + } + $parts = explode('/', $name); + $plugin = implode('/', array_map([Inflector::class, 'camelize'], $parts)); + + $pluginPath = $this->_pluginPath($plugin); + if (is_dir($pluginPath)) { + $io->out(sprintf('Plugin: %s already exists, no action taken', $plugin)); + $io->out(sprintf('Path: %s', $pluginPath)); + + return static::CODE_ERROR; + } + if (!$this->bake($plugin, $args, $io)) { + $io->error(sprintf('An error occurred trying to bake: %s in %s', $plugin, $this->path . $plugin)); + $this->abort(); + } + + return static::CODE_SUCCESS; + } + + /** + * 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 + * @param \Cake\Console\Arguments $args The command arguments. + * @param \Cake\Console\ConsoleIo $io The console io + * @return bool|null + */ + public function bake(string $plugin, Arguments $args, ConsoleIo $io): ?bool + { + $pathOptions = App::path('plugins'); + if (count($pathOptions) > 1) { + $this->findPath($pathOptions, $io); + } + $io->out(sprintf('Plugin Name: %s', $plugin)); + $io->out(sprintf('Plugin Directory: %s', $this->path . $plugin)); + $io->hr(); + + $looksGood = $io->askChoice('Look okay?', ['y', 'n', 'q'], 'y'); + + if (strtolower($looksGood) !== 'y') { + return null; + } + + $this->_generateFiles($plugin, $this->path, $args, $io); + + $this->_modifyAutoloader($plugin, $this->path, $args, $io); + $this->_modifyApplication($plugin, $io); + + $io->hr(); + $io->out(sprintf('Created: %s in %s', $plugin, $this->path . $plugin), 2); + + $emptyFile = $this->path . '.gitkeep'; + $this->deleteEmptyFile($emptyFile, $io); + + return true; + } + + /** + * Modify the application class + * + * @param string $plugin Name of plugin the plugin. + * @param \Cake\Console\ConsoleIo $io ConsoleIo + * @return void + */ + protected function _modifyApplication(string $plugin, ConsoleIo $io): void + { + $this->executeCommand(PluginLoadCommand::class, [$plugin], $io); + } + + /** + * 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) + * @param \Cake\Console\Arguments $args CLI arguments. + * @param \Cake\Console\ConsoleIo $io The io instance. + * @return void + */ + protected function _generateFiles( + string $pluginName, + string $path, + Arguments $args, + ConsoleIo $io + ): void { + $namespace = str_replace('/', '\\', $pluginName); + $baseNamespace = Configure::read('App.namespace'); + + $name = $pluginName; + $vendor = 'your-name-here'; + if (strpos($pluginName, '/') !== false) { + [$vendor, $name] = explode('/', $pluginName); + } + $package = Inflector::dasherize($vendor) . '/' . Inflector::dasherize($name); + + /** @psalm-suppress UndefinedConstant */ + $composerConfig = json_decode( + file_get_contents(ROOT . DS . 'composer.json'), + true + ); + + $renderer = new TemplateRenderer($args->getOption('theme')); + $renderer->set([ + 'package' => $package, + 'namespace' => $namespace, + 'baseNamespace' => $baseNamespace, + 'plugin' => $pluginName, + 'routePath' => Inflector::dasherize($pluginName), + 'path' => $path, + 'root' => ROOT, + 'cakeVersion' => $composerConfig['require']['cakephp/cakephp'], + ]); + + $root = $path . $pluginName . DS; + + $paths = []; + if ($args->hasOption('theme')) { + $paths[] = Plugin::templatePath($args->getOption('theme')); + } + + $paths = array_merge($paths, Configure::read('App.paths.templates')); + $paths[] = Plugin::templatePath('Bake'); + + $fs = new Filesystem(); + $templates = []; + do { + $templatesPath = array_shift($paths) . BakeView::BAKE_TEMPLATE_FOLDER . '/Plugin'; + if (is_dir($templatesPath)) { + $templates = array_keys(iterator_to_array( + $fs->findRecursive($templatesPath, '/.*\.(twig|php)/') + )); + } + } while (!$templates); + + sort($templates); + foreach ($templates as $template) { + $template = substr($template, strrpos($template, 'Plugin' . DIRECTORY_SEPARATOR) + 7, -4); + $template = rtrim($template, '.'); + $this->_generateFile($renderer, $template, $root, $io); + } + } + + /** + * Generate a file + * + * @param \Bake\Utility\TemplateRenderer $renderer The renderer to use. + * @param string $template The template to render + * @param string $root The path to the plugin's root + * @param \Cake\Console\ConsoleIo $io The io instance. + * @return void + */ + protected function _generateFile( + TemplateRenderer $renderer, + string $template, + string $root, + ConsoleIo $io + ): void { + $io->out(sprintf('Generating %s file...', $template)); + $out = $renderer->generate('Bake.Plugin/' . $template); + $io->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. + * @param \Cake\Console\Arguments $args The Arguments instance. + * @param \Cake\Console\ConsoleIo $io The io instance. + * @return bool True if composer could be modified correctly + */ + protected function _modifyAutoloader( + string $plugin, + string $path, + Arguments $args, + ConsoleIo $io + ): bool { + $file = $this->_rootComposerFilePath(); + + if (!file_exists($file)) { + $io->out(sprintf('Main composer file %s not found', $file)); + + return false; + } + + $autoloadPath = str_replace(ROOT . DS, '', $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/'; + + $io->out('Modifying composer autoloader'); + + $out = json_encode($config, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE) . "\n"; + $io->createFile($file, $out, (bool)$args->getOption('force')); + + $composer = $this->findComposer($args, $io); + + if (!$composer) { + $io->error('Could not locate composer. Add composer to your PATH, or use the --composer option.'); + $this->abort(); + } + + try { + $cwd = getcwd(); + + // Windows makes running multiple commands at once hard. + chdir(dirname($this->_rootComposerFilePath())); + $command = 'php ' . escapeshellarg($composer) . ' dump-autoload'; + $process = new Process($io); + $io->out($process->call($command)); + + chdir($cwd); + } catch (\RuntimeException $e) { + $error = $e->getMessage(); + $io->error(sprintf('Could not run `composer dump-autoload`: %s', $error)); + $this->abort(); + } + + 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(): string + { + return ROOT . DS . 'composer.json'; + } + + /** + * find and change $this->path to the user selection + * + * @param array $pathOptions The list of paths to look in. + * @param \Cake\Console\ConsoleIo $io The io object + * @return void + */ + public function findPath(array $pathOptions, ConsoleIo $io): void + { + $valid = false; + foreach ($pathOptions as $i => $path) { + if (!is_dir($path)) { + unset($pathOptions[$i]); + } + } + $pathOptions = array_values($pathOptions); + $max = count($pathOptions); + + if ($max === 0) { + $io->error('No valid plugin paths found! Please configure a plugin path that exists.'); + $this->abort(); + } + + if ($max === 1) { + $this->path = $pathOptions[0]; + + return; + } + + $choice = 0; + while (!$valid) { + foreach ($pathOptions as $i => $option) { + $io->out($i + 1 . '. ' . $option); + } + $prompt = 'Choose a plugin path from the paths above.'; + $choice = (int)$io->ask($prompt); + if ($choice > 0 && $choice <= $max) { + $valid = true; + } + } + $this->path = $pathOptions[$choice - 1]; + } + + /** + * Gets the option parser instance and configures it. + * + * @param \Cake\Console\ConsoleOptionParser $parser The option parser + * @return \Cake\Console\ConsoleOptionParser + */ + public function buildOptionParser(ConsoleOptionParser $parser): ConsoleOptionParser + { + $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.', + ]); + + return $parser; + } + + /** + * Uses either the CLI option or looks in $PATH and cwd for composer. + * + * @param \Cake\Console\Arguments $args The command arguments. + * @param \Cake\Console\ConsoleIo $io The console io + * @return string|bool Either the path to composer or false if it cannot be found. + */ + public function findComposer(Arguments $args, ConsoleIo $io) + { + if ($args->hasOption('composer')) { + /** @var string $path */ + $path = $args->getOption('composer'); + if (file_exists($path)) { + return $path; + } + } + $composer = false; + $path = env('PATH'); + if (!empty($path)) { + $paths = explode(PATH_SEPARATOR, $path); + $composer = $this->_searchPath($paths, $io); + } + + return $composer; + } + + /** + * Search the $PATH for composer. + * + * @param array $path The paths to search. + * @param \Cake\Console\ConsoleIo $io The console io + * @return string|bool + */ + protected function _searchPath(array $path, ConsoleIo $io) + { + $composer = ['composer.phar', 'composer']; + foreach ($path as $dir) { + foreach ($composer as $cmd) { + if (is_file($dir . DS . $cmd)) { + $io->verbose('Found composer executable in ' . $dir); + + return $dir . DS . $cmd; + } + } + } + + return false; + } +} diff --git a/app/vendor/cakephp/bake/src/Command/ShellCommand.php b/app/vendor/cakephp/bake/src/Command/ShellCommand.php new file mode 100644 index 00000000..a724415b --- /dev/null +++ b/app/vendor/cakephp/bake/src/Command/ShellCommand.php @@ -0,0 +1,54 @@ +plugin) { + $namespace = $this->_pluginNamespace($this->plugin); + } + + return ['namespace' => $namespace]; + } + + /** + * Execute the command. + * + * @param \Cake\Console\Arguments $args The command arguments. + * @param \Cake\Console\ConsoleIo $io The console io + * @return int|null The exit code or null for success + */ + public function execute(Arguments $args, ConsoleIo $io): ?int + { + $this->extractCommonProperties($args); + $name = $args->getArgumentAt(0); + if (empty($name)) { + $io->err('You must provide a name to bake a ' . $this->name()); + $this->abort(); + + return null; + } + $name = $this->_getName($name); + $name = Inflector::camelize($name); + $this->bake($name, $args, $io); + $this->bakeTest($name, $args, $io); + + return static::CODE_SUCCESS; + } + + /** + * Generate a class stub + * + * @param string $name The class name + * @param \Cake\Console\Arguments $args The console arguments + * @param \Cake\Console\ConsoleIo $io The console io + * @return void + */ + protected function bake(string $name, Arguments $args, ConsoleIo $io): void + { + $renderer = new TemplateRenderer($args->getOption('theme')); + $renderer->set('name', $name); + $renderer->set($this->templateData($args)); + $contents = $renderer->generate($this->template()); + + $filename = $this->getPath($args) . $this->fileName($name); + $io->createFile($filename, $contents, (bool)$args->getOption('force')); + + $emptyFile = $this->getPath($args) . '.gitkeep'; + $this->deleteEmptyFile($emptyFile, $io); + } + + /** + * Generate a test case. + * + * @param string $className The class to bake a test for. + * @param \Cake\Console\Arguments $args The console arguments + * @param \Cake\Console\ConsoleIo $io The console io + * @return void + */ + public function bakeTest(string $className, Arguments $args, ConsoleIo $io): void + { + if ($args->getOption('no-test')) { + return; + } + $test = new TestCommand(); + $test->plugin = $this->plugin; + $test->bake($this->name(), $className, $args, $io); + } + + /** + * Gets the option parser instance and configures it. + * + * @param \Cake\Console\ConsoleOptionParser $parser Option parser to update. + * @return \Cake\Console\ConsoleOptionParser + */ + public function buildOptionParser(ConsoleOptionParser $parser): ConsoleOptionParser + { + $parser = $this->_setCommonOptions($parser); + $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/app/vendor/cakephp/bake/src/Command/TaskCommand.php b/app/vendor/cakephp/bake/src/Command/TaskCommand.php new file mode 100644 index 00000000..e508e537 --- /dev/null +++ b/app/vendor/cakephp/bake/src/Command/TaskCommand.php @@ -0,0 +1,54 @@ +templateCommand = new TemplateCommand(); + } + + /** + * Execute the command. + * + * @param \Cake\Console\Arguments $args The command arguments. + * @param \Cake\Console\ConsoleIo $io The console io + * @return int The exit code + */ + public function execute(Arguments $args, ConsoleIo $io): int + { + $this->extractCommonProperties($args); + /** @var \Cake\Database\Connection $connection */ + $connection = ConnectionManager::get($this->connection); + $scanner = new TableScanner($connection); + + foreach ($scanner->listUnskipped() as $table) { + $templateArgs = new Arguments([$table], $args->getOptions(), ['name']); + $this->templateCommand->execute($templateArgs, $io); + } + + return static::CODE_SUCCESS; + } + + /** + * Gets the option parser instance and configures it. + * + * @param \Cake\Console\ConsoleOptionParser $parser The option parser to update. + * @return \Cake\Console\ConsoleOptionParser + */ + public function buildOptionParser(ConsoleOptionParser $parser): ConsoleOptionParser + { + $parser = $this->_setCommonOptions($parser); + $parser + ->setDescription('Bake all view template files.') + ->addOption('prefix', [ + 'help' => 'The routing prefix to generate views for.', + ])->addOption('index-columns', [ + 'help' => 'Limit for the number of index columns', + 'default' => 0, + ]); + + return $parser; + } +} diff --git a/app/vendor/cakephp/bake/src/Command/TemplateCommand.php b/app/vendor/cakephp/bake/src/Command/TemplateCommand.php new file mode 100644 index 00000000..bb8bfd90 --- /dev/null +++ b/app/vendor/cakephp/bake/src/Command/TemplateCommand.php @@ -0,0 +1,435 @@ +path = current(App::path('templates')); + } + + /** + * Execute the command. + * + * @param \Cake\Console\Arguments $args The command arguments. + * @param \Cake\Console\ConsoleIo $io The console io + * @return int|null The exit code or null for success + */ + public function execute(Arguments $args, ConsoleIo $io): ?int + { + $this->extractCommonProperties($args); + $name = $args->getArgument('name') ?? ''; + $name = $this->_getName($name); + + if (empty($name)) { + $io->out('Possible tables to bake view templates for based on your current database:'); + /** @var \Cake\Database\Connection $connection */ + $connection = ConnectionManager::get($this->connection); + $scanner = new TableScanner($connection); + foreach ($scanner->listUnskipped() as $table) { + $io->out('- ' . $this->_camelize($table)); + } + + return static::CODE_SUCCESS; + } + $template = $args->getArgument('template'); + $action = $args->getArgument('action'); + + $controller = $args->getOption('controller'); + $this->controller($args, $name, $controller); + $this->model($name); + + if ($template && $action === null) { + $action = $template; + } + if ($template) { + $this->bake($args, $io, $template, true, $action); + + return static::CODE_SUCCESS; + } + + $vars = $this->_loadController($io); + $methods = $this->_methodsToBake(); + + foreach ($methods as $method) { + try { + $content = $this->getContent($args, $io, $method, $vars); + $this->bake($args, $io, $method, $content); + } catch (MissingTemplateException $e) { + $io->verbose($e->getMessage()); + } catch (RuntimeException $e) { + $io->error($e->getMessage()); + } + } + + return static::CODE_SUCCESS; + } + + /** + * Set the model class for the table. + * + * @param string $table The table/model that is being baked. + * @return void + */ + public function model(string $table): void + { + $tableName = $this->_camelize($table); + $plugin = $this->plugin; + if ($plugin) { + $plugin = $plugin . '.'; + } + $this->modelName = $plugin . $tableName; + } + + /** + * Set the controller related properties. + * + * @param \Cake\Console\Arguments $args The arguments + * @param string $table The table/model that is being baked. + * @param string|null $controller The controller name if specified. + * @return void + */ + public function controller(Arguments $args, string $table, ?string $controller = null): void + { + $tableName = $this->_camelize($table); + if (empty($controller)) { + $controller = $tableName; + } + $this->controllerName = $controller; + + $plugin = $this->plugin; + if ($plugin) { + $plugin .= '.'; + } + $prefix = $this->getPrefix($args); + if ($prefix) { + $prefix .= '/'; + } + $this->controllerClass = (string)App::className($plugin . $prefix . $controller, 'Controller', 'Controller'); + } + + /** + * Get the path base for view templates. + * + * @param \Cake\Console\Arguments $args The arguments + * @param string|null $container Unused. + * @return string + */ + public function getTemplatePath(Arguments $args, ?string $container = null): string + { + $path = parent::getTemplatePath($args, $container); + $path .= $this->controllerName . DS; + + return $path; + } + + /** + * Get a list of actions that can / should have view templates baked for them. + * + * @return string[] Array of action names that should be baked + */ + protected function _methodsToBake(): array + { + $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; + } + + /** + * Loads Controller and sets variables for the template + * Available template variables: + * + * - 'modelObject' + * - 'modelClass' + * - 'entityClass' + * - 'primaryKey' + * - 'displayField' + * - 'singularVar' + * - 'pluralVar' + * - 'singularHumanName' + * - 'pluralHumanName' + * - 'fields' + * - 'keyFields' + * - 'schema' + * + * @param \Cake\Console\ConsoleIo $io Instance of the ConsoleIO + * @return array Returns variables to be made available to a view template + */ + protected function _loadController(ConsoleIo $io): array + { + if ($this->getTableLocator()->exists($this->modelName)) { + $modelObject = $this->getTableLocator()->get($this->modelName); + } else { + $modelObject = $this->getTableLocator()->get($this->modelName, [ + 'connectionName' => $this->connection, + ]); + } + + $namespace = Configure::read('App.namespace'); + + $primaryKey = $displayField = $singularVar = $singularHumanName = null; + $schema = $fields = $modelClass = null; + try { + $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; + } catch (\Exception $exception) { + $io->error($exception->getMessage()); + $this->abort(); + } + + [, $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 \Cake\Console\Arguments $args CLI arguments + * @param \Cake\Console\ConsoleIo $io Console io + * @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 void + */ + public function bake( + Arguments $args, + ConsoleIo $io, + string $template, + $content = '', + ?string $outputFile = null + ): void { + if ($outputFile === null) { + $outputFile = $template; + } + if ($content === true) { + $content = $this->getContent($args, $io, $template); + } + if (empty($content)) { + $io->err("No generated content for '{$template}.php', not generating template."); + + return; + } + $path = $this->getTemplatePath($args); + $filename = $path . Inflector::underscore($outputFile) . '.php'; + + $io->out("\n" . sprintf('Baking `%s` view template file...', $outputFile), 1, ConsoleIo::QUIET); + $io->createFile($filename, $content, $args->getOption('force')); + } + + /** + * Builds content from template and variables + * + * @param \Cake\Console\Arguments $args The CLI arguments + * @param \Cake\Console\ConsoleIo $io The console io + * @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(Arguments $args, ConsoleIo $io, string $action, ?array $vars = null) + { + if (!$vars) { + $vars = $this->_loadController($io); + } + + if (empty($vars['primaryKey'])) { + $io->error('Cannot generate views for models with no primary key'); + $this->abort(); + } + + $renderer = new TemplateRenderer($args->getOption('theme')); + $renderer->set('action', $action); + $renderer->set('plugin', $this->plugin); + $renderer->set($vars); + + $indexColumns = 0; + if ($action === 'index' && $args->getOption('index-columns') !== null) { + $indexColumns = $args->getOption('index-columns'); + } + $renderer->set('indexColumns', $indexColumns); + + return $renderer->generate("Bake.Template/$action"); + } + + /** + * Gets the option parser instance and configures it. + * + * @param \Cake\Console\ConsoleOptionParser $parser The option parser to update. + * @return \Cake\Console\ConsoleOptionParser + */ + public function buildOptionParser(ConsoleOptionParser $parser): ConsoleOptionParser + { + $parser = $this->_setCommonOptions($parser); + + $parser->setDescription( + 'Bake views for a controller, using built-in or custom templates. ' + )->addArgument('name', [ + 'help' => 'Name of the controller views to bake. You can use Plugin.name as a shortcut for plugin baking.', + ])->addArgument('template', [ + 'help' => "Will bake a single action's file. core templates are (index, add, edit, view)", + ])->addArgument('action', [ + 'help' => 'Will bake the template in